Comments (10)
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
from moreoverlays.
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.
from moreoverlays.
After a quick look into the source code for the magmablock it either seems that it's canEntitySpawn
method was programmed without keeping in mind that the EntityType can be null or the method is documented wrong since they marked that parameter as Nullable.
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.
from moreoverlays.
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 @Nullable
notation on the EntityType parameter in either the BlockState implementation or the actual Block implementation. I'm not sure if my code has had it stripped out, however.
Of note, though, it seems that BlockMagma
is one of the few that actually implement canEntitySpawn
. I'm not sure whether that's helpful or not, though, as that can't really be used as a heuristic given modded blocks exist...
I personally would definitely recommend making the Zombie EntityType default, however, and adding an option for the "test every monster entitytype".
from moreoverlays.
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.
from moreoverlays.
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.
from moreoverlays.
Already out in 1.16.1 alpha release on curseforge. Along with some other fixes and features.
https://www.curseforge.com/minecraft/mc-mods/more-overlays/files/2829171
EDIT: There it is still alpha since there are some more things planed for 1.14.4.
- The config gui will get it's own list system since the vanilla AbstractList doesn't fit very well from the way it handles gui events, rendering and init-calls
- I want to add some way to open the config ui ingame either by adding a button to the pause screen or via a client side command
- The current system to detect mob spawns should get more options to set it into light only mode and maybe find a better way to detect mobspawns without checking all mobs.
- I want to add IMC messages for the API.
from moreoverlays.
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.
I will try to add more options like a true ligt only mode and maybe I or someone else finds a better way to optimize the check (maybe caching the blocks spawn mode).
from moreoverlays.
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 "@Nullable
" annotation remaining was an oversight from 1.12, where I presume it was accepting an Entity(Living?)
instead of an EntityType
.
from moreoverlays.
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".
from moreoverlays.
Related Issues (20)
- Regions are offset at negative chunks
- Region filename doesn't show up sometimes
- F7 Light level overlay doesn't work in multiplayer. HOT 2
- [1.14.4] Config UI values reset when resizing the window
- Crash on dedicated server HOT 3
- [1.12.2] NullPointerException Crash HOT 1
- Hunger shanks are glitched in chunk boundary mod 3
- F7 (light overlay) not working. HOT 1
- F3 Debug screen won't open after installing MoreOverlays
- Light Level Toggle not showing up in controls
- Bedrock...
- Glitching out and not showing on certain blocks
- Crash to Desktop from java.lang.NoSuchMethodError HOT 1
- [1.12.2] Lighting Overlay not compatible with Twilight Forest
- Light level overlay does not show up HOT 1
- The light overlay has no color HOT 1
- World change causes crash with Mo'Creatures installed HOT 1
- MC Crashed after toggling light ovrlay
- [1.16.5] Search function for crafting station linked inventories
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from moreoverlays.