-
Notifications
You must be signed in to change notification settings - Fork 18
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
1.14.4/optifine magma block causes NPE #69
Comments
I can reproduce it without optifine. The problem seems to be something about getting the spawn information from magma blocks. Just turning on the overlay and placing a magmablock in rage of the overlay is enough to crash immediately. |
After a quick look into the source code for the magmablock it either seems that it's The fix sadly reduces performance a bit since I have to check every singe monster entitytype that might spawn. So I added a config option to make a simple check just for the Zombie entity. |
That's interesting, I was just coming to report this and was checking through closed issues to see if it had already been discussed. It got brought up on our discord and there was some conversation about it. I did have a look at the decompiled code from IntelliJ and interestingly enough it doesn't have a Of note, though, it seems that I personally would definitely recommend making the Zombie EntityType default, however, and adding an option for the "test every monster entitytype". |
Here is a link to the source: https://github.com/MinecraftForge/MinecraftForge/blob/6422310453fe4029a409adf19d3bac6bfb3ea589/src/main/java/net/minecraftforge/common/extensions/IForgeBlock.java#L269 IForgeBlock is implemented by Block because Forge uses a .patch file to add it. And I used that method to determine if mobs can spawn. |
Thanks for the super fast fix! Any idea what release this'll be in? Just curious, I've no problems building it for myself, but its nice to be lazy and just click the button in the launcher :) I'd also second making zombie default and the option to check all. |
Already out in 1.16.1 alpha release on curseforge. Along with some other fixes and features. EDIT: There it is still alpha since there are some more things planed for 1.14.4.
|
That's definitely a bug on Forge's part, then, because neither the function they call in the state nor the function that it calls in the block will accept a null entity type... I might go file a bug. EDIT: Especially demonstrable by the fact that the Vanilla magma block is accessing the EntityType directly without testing for null first. EDIT 2: I've filed a Forge issue for this: MinecraftForge/MinecraftForge#6326 |
Also I should add that only checking for the EntityType "Zombie" has the problem, that blocks like the magma block won't show any overlay, since they only allow monsters that resist fire, thats why I currently set the default to check all mobs, because usually users will complain that the overlay doesn't work when they just had to change to the less performant setting. |
Perhaps Zombie Pigman could be an alternative to zombie? I believe they should satisfy most conditions. Additionally, a block(state?) -> boolean conditional map that could be cached might also help to simplify things, or at least speed up the process. EDIT: Judging by the adjustment of tags to "1.14" and "cleanup", I'm going to presume that the " |
In 1.12 there was no extra parameter at least not in the method I used. It simply required the BlockState and the SpawnPlacementType. I don't know if spawns based on State, Placement and Entity were a thing in 1.12 but I assume "no". |
Not sure if it is optifine related, but I'm guessing so. Was doing some mining and hit a cave, turning on the light level overlay immediately causes an NPE.
crash report: crash-2019-11-18_08.30.23-client.txt
The text was updated successfully, but these errors were encountered: