
Null Pointer Exception crash when using Hoe of Growth's right click ability
krallendertoten opened this issue ยท 21 comments
Please check any boxes that apply to you and your issue
-
I use a translator application to post this issue.
-
[ x] This is a crash. Please upload, Pastebin, Gist or copypaste the whole crash report along with this issue.
https://pastebin.com/fPE7JjUB -
[x ] This is a mod incompatibility. If I do this in vanilla Forge with only Et Futurum Requiem installed, it works normally.
Version number of Et-Futurum-Requiem (IMPORTANT)
2.4.4 (compiled from source)
Describe the issue (IMPORTANT)
Using the Thaumcraft Hoe of Growth's right click ability on a plant, in this case a Greatwood Sapling planted on dirt, which is supposed to apply an enhanced bonemeal effect, causes a crash due to a null pointer exception
When you have the time, deleting groups of mods to find the mod causing Thaumcraft and EFR to collide would work.
Here are the mod versions:
CodeChickenCore-1.7.10-1.0.7.48-universal.jar Et_Futurum_Requiem-2.4.4.jar NotEnoughItems-1.7.10-2.1.5-GTNH-universal.jar Thaumcraft-1.7.10-4.2.3.5.jar
inside of the 1.7.10 folder:
Baubles-1.7.10-1.0.1.10.jar CodeChickenLib-1.7.10-1.1.3.141-universal.jar
Forge version: 10.13.4.1614
I did that already and was able to reproduce the crash with just this set of mods. Nothing else in the instance
I'm able to reproduce this by right clicking a nearby block immediately after looking at a distant point. No other mods are necessary.
hoecrash.mp4
Stack trace
java.lang.NullPointerException: Ticking memory connection
at ganymedes01.etfuturum.core.handlers.ServerEventHandler.onHoeUseEvent(ServerEventHandler.java:1065)
at cpw.mods.fml.common.eventhandler.ASMEventHandler_26_ServerEventHandler_onHoeUseEvent_UseHoeEvent.invoke(.dynamic)
at cpw.mods.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:54)
at cpw.mods.fml.common.eventhandler.EventBus.post(EventBus.java:140)
at net.minecraft.item.ItemHoe.func_77648_a(ItemHoe.java:37)
at net.minecraftforge.common.ForgeHooks.onPlaceItemIntoWorld(ForgeHooks.java:505)
at net.minecraft.item.ItemStack.func_77943_a(ItemStack.java:128)
at net.minecraft.server.management.ItemInWorldManager.func_73078_a(ItemInWorldManager.java:389)
at net.minecraft.network.NetHandlerPlayServer.func_147346_a(NetHandlerPlayServer.java:556)
at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.func_148833_a(SourceFile:60)
at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.func_148833_a(SourceFile:9)
at net.minecraft.network.NetworkManager.func_74428_b(NetworkManager.java:212)
at net.minecraft.network.NetworkSystem.func_151269_c(NetworkSystem.java:165)
at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:659)
at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:547)
at net.minecraft.server.integrated.IntegratedServer.func_71217_p(IntegratedServer.java:111)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:427)
at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:685)
Ah right, looking into the Sky causes a NaN, but if you're fast enough it still thinks you're looking at the Sky while clicking a Block, because Minecraft has latency even in Singleplayer...
Also explains why it did not happen to me, I have a habit of looking at the ground most of the time.
But yeah as I said earlier, the Bugfix is as trivial as just checking for a null where a null can happen. ;)
Uhm, cant you fix it first on a test branch, and then tell them to download and test it on their Machine? I mean, that would be the easiest way to test if it works. ;)
I was able to reproduce the issue with just Thaumcraft, NEI (and codechickencore), and etfuturum 2.4.4. Just a dirt block with a sapling of any kind, right click with the hoe. Same stack trace
Odd, I have all of those in my dev environment and I cannot reproduce this crash. Growing saplings on dirt works just fine for me.
Here are the mod versions:
CodeChickenCore-1.7.10-1.0.7.48-universal.jar
Et_Futurum_Requiem-2.4.4.jar
NotEnoughItems-1.7.10-2.1.5-GTNH-universal.jar
Thaumcraft-1.7.10-4.2.3.5.jar
inside of the 1.7.10 folder:
Baubles-1.7.10-1.0.1.10.jar
CodeChickenLib-1.7.10-1.1.3.141-universal.jar
Forge version: 10.13.4.1614
Uh you say Mods shouldn't be passing NaN, but you literally take only World and Player as a Parameter, and having an Entity with NaN Coordinates is a sign that it may be a fake player, which is not forbidden and should always be safeguarded against.
Putting Safeguards in for Code you do not control yourself is always important, you cant just say you wont bother fixing it, while at the same time participating in a conversation that takes literally longer than just fixing it. I appreciate trying to find the underlying Issue, but threatening to not fix an Issue is not the way to go about it.
I opened MC myself with my normal instance that happens to have Thaumcraft and Et Futurum, but I can easily just place a Silverwood Sapling in each of the 4 quadrants of the Map and grow it with the Hoe in Creative Mode.
So I was not able to reproduce it myself either, but when I looked at your Code I instantly knew there could be some source of that function turning into Nullpointers, and that it is better to be safe than sorry in situations like this. Afterall a Null Check is not eating performance, especially not if it is only for something that a User Input causes and doesn't result in recurring Lag.
Oh yeah fake players exist oops
Really wish mods weren't passing fake players into events not made for fake players ;/
Once I can reproduce this I'll fix it but I want to narrow down the extra culprit mods so I can reproduce the crash first, to verify the fix will work.
I don't like making unnecessary branches for small fixes, and I also do not like relying on other people downloading my changes, and waiting for their response, that is a very slow and tumultuous way to debug an issue. I would rather have the issue producible on my own machine so I can fix it with less hassle.
I'm happy to provide more info if I can but I can't think of anything else that would be causing a different result than what you guys are getting, unless the mod versions are different
Am i assuming right that the MovingObjectPosition is null here? Because pretty sure that can happen.
Edit: As in this function might be able to return null over here:
I can't reproduce this, but the only way for that to return null appears to be if it has NaN coords meaning Thaumcraft could possibly be passing NaN as the coords for some reason.
@krallendertoten I cannot reproduce this crash, there's likely another mod in the mix causing EFR and Thaumcraft to collide in a way it doesn't like. Are you using any special forks of Thaumcraft, and can you please narrow down the other conflicting mods for me?
Here's the total modlist, it's mostly what comes with Blightfall-3.0.1-CE
00gasstation-mc1.7.10-0.5.1.jar
1.7.10
AppleCore-mc1.7.10-3.1.1.jar
ArchimedesShips-1.7.1.jar
ArmorStatusHUD-client-1.28.jar
Aroma1997Core-1.7.10-1.0.2.16.jar
AromaBackup-1.7.10-0.1.0.0.jar
Automagy-1.7.10-0.28.2.jar
BetterFps-1.0.1.jar
BetterStorage-1.7.10-0.13.1.126-nosplode.jar
'BiblioCraft[v1.11.7][MC1.7.10].jar'
'BiblioWoods[Natura][v1.4].jar'
BigReactors-0.4.3A.jar
BloodMagic-1.7.10-1.3.4-blight.jar
Botania+r1.7-208.jar
ChickenChunks-1.7.10-1.3.4.19-universal.jar
Chisel-1.7.10-1.5.7.jar
'CoFHCore-[1.7.10]3.1.4-329.jar'
CodeChickenCore-1.7.10-1.0.7.48-universal.jar
Controlling-1.7.10-1.0.0.jar
CoreTweaks-1.7.10-0.3.0.1.jar
CosmeticArmorReworked-1.7.10-v7.jar
CustomNPCs-1.7.10c-herohack3.jar
EnderStorage-1.7.10-1.4.7.37-universal.jar
Et_Futurum_Requiem-2.4.4.jar.
ExtraCells-1.7.10-2.3.14b200.jar
ExtraTiC-1.7.10-1.4.6.jar
ExtraUtilitiesTweaks-1.0.0.jar
FoamFix-1.7.10-universal-1.0.2.jar
'Forbidden Magic-1.7.10-0.575.jar'
ForgeMultipart-1.7.10-1.2.0.345-universal.jar
'HQM-The Journey (4.2.3).jar'
HelpFixer-1.0.7.jar
HungerOverhaul-1.7.10-1.0.0-ConfigHack-2.jar
'INpureCore-[1.7.10]1.0.0B9-62.jar'
IguanaTinkerTweaks-1.7.10-2.1.6.jar
ImLookingAtBlood-1.7.2-1.1a.jar
Jabba-1.2.2_1.7.10.jar
JustEnoughCalculation-1.7.10-3.8.5.jar
Lockdown-2.0.0.0.jar
LumySkinPatch-1.0.10.jar
LunatriusCore-1.7.10-1.1.2.21-universal.jar
Mantle-1.7.10-0.3.2b.jar
Metallurgy-1.7.10-4.0.9.148.jar
MetallurgyCore-1.7.10-4.0.5.30.jar
'MineFactoryReloaded-[1.7.10]2.8.1-174.jar'
MineTweaker3-1.7.10-3.0.10B.jar
MobiusCore-1.2.5_1.7.10.jar
ModTweaker2-0.9.6.jar
ModelCitizens-mc1.7.10-1.0.1.jar
MouseTweaks-2.4.4-mc1.7.10.jar
NEIPlugins-MC1.7.10-1.1.0.10-unofficial.jar
'NetherOres-[1.7.10]2.3.1-22.jar'
NotEnoughItems-1.7.10-2.1.5-GTNH-universal.jar
OptiFine_1.7.10_HD_U_D6.jar
"Pam's HarvestCraft 1.7.10Lb.jar"
PerfectSpawn-1.1.jar
PlayerAPI-1.7.10-1.4.jar
RPGAdvMod-1.0.0_1.7.10.jar
'RedstoneArsenal-[1.7.10]1.1.2-92.jar'
Satchels-1.7.10-1.0.7.jar
Schematica-1.7.10-1.7.5-GenHack3.jar
SleepingBag-1.7.10-0.1.1.jar
SpiceOfLife-mc1.7.10-1.3.11.jar
StorageDrawers-1.7.10-1.10.9.jar
TConstruct-1.7.10-1.8.8.jar
TMechworks-1.7.10-0.2.15.106.jar
'TabulaRasa-[1.7.10]1.0.1-3-Blight4.jar'
TaintedPlayers-v1.1-1.7.10.jar
TerrainControl
Thaumcraft-1.7.10-4.2.3.5.jar
ThaumicTinkerer-2.5-1.7.10-blight.jar
'ThermalDynamics-[1.7.10]1.2.1-172.jar'
'ThermalExpansion-[1.7.10]4.1.5-248.jar'
'ThermalFoundation-[1.7.10]1.2.6-118.jar'
TiCTooltips-mc1.7.10-1.2.4.jar
TooMuchLoot-1.7.10-4.0.1.B0.jar
Translocator-1.7.10-1.1.2.16-universal.jar
UBCOres-1.7.10-0.2.9.4.jar
UndergroundBiomesConstructs-1.7.10-0.8-beta49.jar
VoxelMods
Waila-1.5.10_1.7.10.jar
WailaHarvestability-mc1.7.10-1.1.6.jar
'[1.7.10]StatusEffectHUD-client-1.27.jar'
appliedenergistics2-rv3-beta-6.jar
betterrain-1.7.2-1.7.10_0.15-core.jar
betterrain-1.7.2-1.7.10_0.15.jar
blightbuster-2.0.5.jar
blightcore-1.3.0.jar
blightfall-filefix-v1.0.0.jar
cookingbook-mc1.7.10-1.0.140.jar
extrautilities-1.2.12.jar
falsepatternlib-mc1.7.10-0.10.15.jar
falsetweaks-mc1.7.10-2.2.1.jar
fastcraft-1.23.jar
inventorytweaks-1.58-147.jar
leafculling-mc1.7.10-1.0.9.jar
liteloader-1.7.10.jar
mod_voxelMap_1.7.0b_for_1.7.10.litemod
natura-1.7.10-2.2.0.1.jar
neiaddons-1.12.14.40-mc1.7.10.jar
neodymium-1.7.10-0.1.6.jar
netherless-1.0.jar
newradicalbotany-1.1.2.jar
notimefix-2.1.0.jar
purplepanic-1.0.6.jar
ssmlegacy-mc1.7.10-1.2.0.jar
tcinventoryscan-mc1.7.10-1.0.11.jar
tcnodetracker-1.7.10-1.1.2.jar
terraincontrol-forge-2.7.0-colored-lockhack-spawnfix.jar
thaumcraftneiplugin-1.7.10-1.7a.jar
thaumicenergistics-1.1.3.0.jar
thaumichorizons-1.7.10-1.1.9.jar
Mods shouldn't be passing NaN doubles into the event... Before I can fix it I need to be able to reproduce it but if it's due to passing in NAN values I won't even bother.
Nah nothing was adjacent. I was able to reproduce the crash with a regular oak sapling too, since I wasn't sure if it had something to do with the greatwood sapling trying to grow into a 4x4 tree. It seems to specifically be on the activation of the hoe itself
Was something adjacent to the Sapling that could grow too? Maybe that adjacent thing tried to grow and that crashed.
What happens if the thing that the Hoe rightclicks does not have a collision or hit box? Can that end up in a NaN Coordinate? Afterall the Thaumcraft Hoe does do Bonemeal on rightclick, so the clicked thing was clearly not a Dirt Block like usual.
Regardless of what it is, I would highly recommend just checking if that MovingObjectPosition is null, because clearly that is an intended case to be possible to happen, and not handling an intended null is a mistake.
I see it now. Not sure how that happens since it's fired on block clicked but yeah this is easy.
I noticed when fixing it the hoe is actually supposed to till a 3x3 square of land (it does this when it would usually crash) so I think I'll also need to exempt the hoe from the code I run as it's a copy of the vanilla code.