crash when mining compact skeleton ore with ore excavator
LlubNek opened this issue ยท 4 comments
Versions (Be specific, do not write "latest"):
Compact Ores DoubleNegation compactores-1.15.2-2.1.3.jar
Curios API TheIllusiveC4 curios-FORGE-1.15.2-2.0.2.4.jar
Enigmatic Legacy VictorShadow_ EnigmaticLegacy-1.7.0.jar
Fun Ores SilentChaos512 FunOres-1.15.2-2.5.1+17.jar
Ore Excavation Funwayguy OreExcavation-1.7.151.jar
Silent Lib SilentChaos512 SilentLib-1.15.2-4.6.4+56.jar
Minecraft 1.15.2
Forge 31.2.28 and 31.2.30
Description of the Bug:
When mining compact skeleton ore with ore excavator when enigmatic legacy is installed, minecraft crashes.
This is specifically with compact skeleton ore: skeleton ore by itself or other compact ores are fine.
How to Reproduce:
- Install the mods listed under versions
- start a creative world
- place at least two compact skeleton ore adjacent to each other
- give yourself a pickaxe
- switch to survival mode
- mine the compact skeleton ore using ore excavator
Logs:
java.lang.NullPointerException
at com.integral.enigmaticlegacy.handlers.EnigmaticEventHandler.onLooting(EnigmaticEventHandler.java:176)
at net.minecraftforge.eventbus.ASMEventHandler_24_EnigmaticEventHandler_onLooting_LootingLevelEvent.invoke(.dynamic)
Ah shit, here we go again.
The issue is likely on my side, looks like event.getDamageSource()
returns null in event handler for LootingLevelEvent
. Fixing this won't be difficult though.
I did a bit of testing and I don't think that Enigmatic Legacy is at fault here at all, since getDamageSource()
should return a non-null value (because everything in Forge is @MethodsReturnNonnullByDefault
).
A better fix to the issue would be one that stops the damage source from being null in the first place.
The tests that I did showed the following results:
- The crash happens with all "compact fun ores" that use the
random_chance_with_looting
condition in their Fun Ores block loot table. - The
NullPointerException
also gets thrown when not using Ore Excavation's excavate function, but it is handled so that the game at least doesn't crash. Completely uninstalling Ore Excavation makes the game crash when mining any of the problematic ores normally. This means the problem is not with Ore Excavation. - All vanilla entity loot tables that use the
random_chance_with_looting
condition hide it behind akilled_by_player
condition. Adding this condition to a Fun Ores loot table prevents the crash and allows the ore to work as intended.
I still can't explain why the crash only happens when the Fun Ores ore is wrapped by a Compact Ore.
However, I would like to suggest fixing the issue by adding the minecraft:killed_by_player
condition to the Fun Ores loot tables.
However, I would like to suggest fixing the issue by adding the minecraft:killed_by_player condition to the Fun Ores loot tables.
"minecraft:killed_by_player" makes no sense for an ore block loot table (which might be part of the problem).
I think replacing looting with fortune might make more sense.
Not what I've done here, but this fixes things:
funoresfix.datapack.zip
a better fix (turns out comments aren't a thing in JSON)
funoresfix.datapack.zip