-
-
Notifications
You must be signed in to change notification settings - Fork 211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error is thrown for key not found even when not checking for that key #3337
Comments
This isn't an API error, but potentially an implementation one, so moving this issue. We need to know the version of the implementation you're running, not the API version (whether you're running SpongeForge or SpongeVanilla and what version) |
I'm running on SpongeForge for 1.12.2 |
Try the latest please - 7.2.1 is very old now and the issue may have been fixed: https://github.com/SpongePowered/SpongeForge/actions/runs/570272675 - select the production jar at the bottom. |
I tried with the latest download from the Sponge page, 7.3.0, and with the linked production jar, but it still throws the error |
Signed-off-by: Gabriel Harris-Rouquette <gabizou@me.com>
ERROR
Sponge throws an error when a certain key is expected for a block, but that block doesn't have that key. For instance, Sponge expects a leaf block to have a property called
decayable
. But if that block doesn't have that property, than any other property checks will throw an error, even if you are not checking thedecayable
propertyEXAMPLE
Let's hook the block placing event. In that event let's check if the block has a specific Key, for example
extended
in it's propertiesNow, let's go into the server and place a block via
/setblock
command. For this example we will use theleaves_flowering
block from DynamicTreesBOP. This is a leaf block, so Sponge thinks it will have a property nameddecayable
. However that block does not have this property. Anyway, when you place that block via the/setblock dynamictreesbop:leaves_flowering
command, theonBlockPlaced
listener comes in. Remember, in this listener we check if the placed block has theextended
key, and if so do some stuff. When the listener checks for that key, an error is thrownAs you can see Sponge complains about the lack of the
decayable
property. However no one asked for that! And even if asked, we didn't get the value directly, but just check if that property is present or notAPI VERSION 7.1.0
The text was updated successfully, but these errors were encountered: