Storage Drawers

Storage Drawers

151M Downloads

[1.15.2] [Crash] NPE in BlockDrawers.isReplaceable when there is no Player or FakePlayer.

Laikulo opened this issue ยท 0 comments

commented

This was found as an incompatibility with xreliquary, where an item automatically places torches, and in doing so, calls isReplaceable without a player. While it would be nice if xreliquary provided a fake player (and I will open a bug on their tracker for that) it would be preferable to not crash the server (or embedded server) in this case.

It is also possible that other mods do this, and they would also trigger a crash in this case.

Location of crash:

if (useContext.getPlayer().isCreative() && useContext.getHand() == Hand.OFF_HAND) {

Crash Report:

---- Minecraft Crash Report ----
// Shall we play a game?

Time: 4/14/20 7:38 PM
Description: Ticking player

java.lang.NullPointerException: Ticking player
	at com.jaquadro.minecraft.storagedrawers.block.BlockDrawers.func_196253_a(BlockDrawers.java:235) ~[?:1.15.2-7.0.2] {re:classloading}
	at net.minecraft.block.BlockState.func_196953_a(BlockState.java:294) ~[?:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:phosphor.mixins.json:block.MixinBlockState,pl:mixin:A}
	at net.minecraft.item.BlockItemUseContext.<init>(SourceFile:27) ~[?:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.item.DirectionalPlaceContext.<init>(SourceFile:14) ~[?:?] {re:classloading}
	at xreliquary.items.LanternOfParanoiaItem.lambda$inventoryTick$0(LanternOfParanoiaItem.java:67) ~[?:1.15.2-1.3.4.960] {re:classloading}
	at java.util.stream.MatchOps$1MatchSink.accept(Unknown Source) ~[?:1.8.0_241] {}
	at net.minecraft.util.math.BlockPos$1.tryAdvance(SourceFile:455) ~[?:?] {re:classloading}
	at java.util.stream.ReferencePipeline.forEachWithCancel(Unknown Source) ~[?:1.8.0_241] {}
	at java.util.stream.AbstractPipeline.copyIntoWithCancel(Unknown Source) ~[?:1.8.0_241] {}
	at java.util.stream.AbstractPipeline.copyInto(Unknown Source) ~[?:1.8.0_241] {}
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source) ~[?:1.8.0_241] {}
	at java.util.stream.MatchOps$MatchOp.evaluateSequential(Unknown Source) ~[?:1.8.0_241] {}
	at java.util.stream.MatchOps$MatchOp.evaluateSequential(Unknown Source) ~[?:1.8.0_241] {}
	at java.util.stream.AbstractPipeline.evaluate(Unknown Source) ~[?:1.8.0_241] {}
	at java.util.stream.ReferencePipeline.anyMatch(Unknown Source) ~[?:1.8.0_241] {}
	at xreliquary.items.LanternOfParanoiaItem.func_77663_a(LanternOfParanoiaItem.java:59) ~[?:1.15.2-1.3.4.960] {re:classloading}
	at net.minecraft.item.ItemStack.func_77945_a(ItemStack.java:414) ~[?:?] {re:mixin,re:classloading,xf:fml:quark:add-spacing-for-stack}
	at net.minecraft.entity.player.PlayerInventory.func_70429_k(PlayerInventory.java:265) ~[?:?] {re:classloading}
	at net.minecraft.entity.player.PlayerEntity.func_70636_d(PlayerEntity.java:505) ~[?:?] {re:classloading,pl:accesstransformer:B,re:mixin,pl:accesstransformer:B}
	at net.minecraft.entity.LivingEntity.func_70071_h_(LivingEntity.java:2104) ~[?:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,xf:fml:caelus:coremodone,pl:mixin:APP:performant.mixins.json:entity.LivingEntityMixin,pl:mixin:A}
	at net.minecraft.entity.player.PlayerEntity.func_70071_h_(PlayerEntity.java:233) ~[?:?] {re:classloading,pl:accesstransformer:B,re:mixin,pl:accesstransformer:B}
	at net.minecraft.entity.player.ServerPlayerEntity.func_71127_g(ServerPlayerEntity.java:361) ~[?:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.network.play.ServerPlayNetHandler.func_73660_a(ServerPlayNetHandler.java:183) ~[?:?] {re:classloading,pl:accesstransformer:B,xf:fml:randompatches:RandomPatches ServerPlayNetHandler Transformer}
	at net.minecraft.network.NetworkManager.func_74428_b(NetworkManager.java:228) ~[?:?] {re:classloading}
	at net.minecraft.network.NetworkSystem.func_151269_c(NetworkSystem.java:135) ~[?:?] {re:classloading}
	at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:866) ~[?:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:784) ~[?:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.server.integrated.IntegratedServer.func_71217_p(IntegratedServer.java:114) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:637) [?:?] {re:classloading,pl:accesstransformer:B}
	at java.lang.Thread.run(Unknown Source) [?:1.8.0_241] {}


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- Head --
Thread: Server thread
Stacktrace:
	at com.jaquadro.minecraft.storagedrawers.block.BlockDrawers.func_196253_a(BlockDrawers.java:235)
	at net.minecraft.block.BlockState.func_196953_a(BlockState.java:294)
	at net.minecraft.item.BlockItemUseContext.<init>(SourceFile:27)
	at net.minecraft.item.DirectionalPlaceContext.<init>(SourceFile:14)
	at xreliquary.items.LanternOfParanoiaItem.lambda$inventoryTick$0(LanternOfParanoiaItem.java:67)
	at java.util.stream.MatchOps$1MatchSink.accept(Unknown Source)
	at net.minecraft.util.math.BlockPos$1.tryAdvance(SourceFile:455)
	at java.util.stream.ReferencePipeline.forEachWithCancel(Unknown Source)
	at java.util.stream.AbstractPipeline.copyIntoWithCancel(Unknown Source)
	at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
	at java.util.stream.MatchOps$MatchOp.evaluateSequential(Unknown Source)
	at java.util.stream.MatchOps$MatchOp.evaluateSequential(Unknown Source)
	at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
	at java.util.stream.ReferencePipeline.anyMatch(Unknown Source)
	at xreliquary.items.LanternOfParanoiaItem.func_77663_a(LanternOfParanoiaItem.java:59)
	at net.minecraft.item.ItemStack.func_77945_a(ItemStack.java:414)
	at net.minecraft.entity.player.PlayerInventory.func_70429_k(PlayerInventory.java:265)
	at net.minecraft.entity.player.PlayerEntity.func_70636_d(PlayerEntity.java:505)
	at net.minecraft.entity.LivingEntity.func_70071_h_(LivingEntity.java:2104)
	at net.minecraft.entity.player.PlayerEntity.func_70071_h_(PlayerEntity.java:233)

-- Player being ticked --
Details:
	Entity Type: minecraft:player (net.minecraft.entity.player.ServerPlayerEntity)
	Entity ID: 6
	Entity Name: Quarut
	Entity's Exact location: 12.94, 118.00, 476.03
	Entity's Block location: World: (12,118,476), Chunk: (at 12,7,12 in 0,29; contains blocks 0,0,464 to 15,255,479), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)
	Entity's Momentum: 0.00, -0.08, 0.00
	Entity's Passengers: []
	Entity's Vehicle: ~~ERROR~~ NullPointerException: null
Stacktrace:
	at net.minecraft.entity.player.ServerPlayerEntity.func_71127_g(ServerPlayerEntity.java:361)
	at net.minecraft.network.play.ServerPlayNetHandler.func_73660_a(ServerPlayNetHandler.java:183)
	at net.minecraft.network.NetworkManager.func_74428_b(NetworkManager.java:228)

-- Ticking connection --
Details:
	Connection: net.minecraft.network.NetworkManager@1fc1e385
Stacktrace:
	at net.minecraft.network.NetworkSystem.func_151269_c(NetworkSystem.java:135)
	at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:866)
	at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:784)
	at net.minecraft.server.integrated.IntegratedServer.func_71217_p(IntegratedServer.java:114)
	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:637)
	at java.lang.Thread.run(Unknown Source)

-- System Details --
Details:
	Minecraft Version: 1.15.2
	Minecraft Version ID: 1.15.2
	Operating System: Windows 10 (amd64) version 10.0
	Java Version: 1.8.0_241, Oracle Corporation
	Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
	Memory: 854693272 bytes (815 MB) / 3948412928 bytes (3765 MB) up to 3948412928 bytes (3765 MB)
	CPUs: 8
	JVM Flags: 3 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xms1024m -Xmx4096m
	ModLauncher: 5.0.0-milestone.4+67+b1a340b
	ModLauncher launch target: fmlclient
	ModLauncher naming: srg
	ModLauncher services: 
		/eventbus-2.0.0-milestone.1-service.jar eventbus PLUGINSERVICE 
		/forge-1.15.2-31.1.25-launcher.jar object_holder_definalize PLUGINSERVICE 
		/forge-1.15.2-31.1.25-launcher.jar runtime_enum_extender PLUGINSERVICE 
		/accesstransformers-2.0.4-shadowed.jar accesstransformer PLUGINSERVICE 
		/forge-1.15.2-31.1.25-launcher.jar capability_inject_definalize PLUGINSERVICE 
		/forge-1.15.2-31.1.25-launcher.jar runtimedistcleaner PLUGINSERVICE 
		/forge-1.15.2-31.1.25-launcher.jar fml TRANSFORMATIONSERVICE 
		/MixinBootstrap-1.0.2.jar mixinbootstrap TRANSFORMATIONSERVICE 
		/MixinBootstrap-1.0.2.jar mixin PLUGINSERVICE 
		/MixinBootstrap-1.0.2.jar mixinbootstrap PLUGINSERVICE 
	FML: 31.1
	Forge: net.minecraftforge:31.1.25
	FML Language Providers: 
		[email protected]
		minecraft@1
	Mod List: 
		QuarkOddities-1.15.2.jar Quark Oddities {[email protected] DONE}
		TrashSlot_1.15.2-11.0.0.jar TrashSlot {[email protected] DONE}
		NetherPortalFix_1.15.2-6.0.0.jar NetherPortalFix {[email protected] DONE}
		jei-1.15.2-6.0.0.2.jar Just Enough Items {[email protected] DONE}
		AttributeFix-1.15.2-7.0.2.jar AttributeFix {[email protected] DONE}
		Mekanism-1.15.2-9.9.20.412.jar Mekanism {[email protected] DONE}
		mcw-windows-1.0.1-mc1.15.2_1.15.1.jar Macaw's Windows {[email protected] DONE}
		caelus-FORGE-1.15.2-2.0-beta1.jar Caelus API {[email protected] DONE}
		Waystones_1.15.2-6.0.1.jar Waystones {[email protected] DONE}
		TerraForged-1.15.2-0.0.12.jar TerraForged {[email protected] DONE}
		CookingForBlockheads_1.15.2-8.0.1.jar Cooking for Blockheads {[email protected] DONE}
		Placebo-1.15.2-3.0.2.jar Placebo {[email protected] DONE}
		NaturesCompass-1.15.2-1.8.5.jar Nature's Compass {[email protected] DONE}
		FruitTrees-1.15.2-1.1.6.jar Fruit Trees {[email protected] DONE}
		Kiwi-1.15.2-2.6.5.jar Kiwi {[email protected] DONE}
		DungeonCrawl-1.15.2-1.6.3.jar Dungeon Crawl {[email protected] DONE}
		Bookshelf-1.15.2-5.3.9.jar Bookshelf {[email protected] DONE}
		Reliquary-1.15.2-1.3.4.960.jar Reliquary {[email protected] DONE}
		u_team_core-1.15.2-2.11.0.156.jar U Team Core {[email protected] DONE}
		randompatches-1.15.2-1.21.1.1.jar RandomPatches {[email protected] DONE}
		DarkUtilities-1.15.2-3.0.3.jar Dark Utilities {[email protected] DONE}
		MekanismGenerators-1.15.2-9.9.20.412.jar Mekanism: Generators {[email protected] DONE}
		forge-1.15.2-31.1.25-universal.jar Forge {[email protected] DONE}
		refinedstorage-1.8.1.jar Refined Storage {[email protected] DONE}
		forge-1.15.2-31.1.25-client.jar Minecraft {[email protected] DONE}
		industrial-foregoing-1.15.2-2.2.2-28d4a81.jar Industrial Foregoing {[email protected] DONE}
		useful_backpacks-1.15.2-1.9.4.63.jar Useful Backpacks {[email protected] DONE}
		titanium-1.15.2-2.3.7.jar Titanium {[email protected] DONE}
		BiomesOPlenty-1.15.2-10.0.0.345-universal.jar Biomes O' Plenty {[email protected] DONE}
		phosphor-forge-mc1.15.2-0.5.2+build.4.jar Phosphor {[email protected]+build.4 DONE}
		curios-FORGE-1.15.2-2.0.2.1.jar Curios API {[email protected] DONE}
		Botania+r1.15-382.jar Botania {[email protected] DONE}
		Patchouli-1.15.2-1.2-31.jar Patchouli {[email protected] DONE}
		FastWorkbench-1.15.1-3.0.0.jar FastWorkbench {[email protected] DONE}
		AutoRegLib-1.5-40.jar AutoRegLib {[email protected] DONE}
		StorageDrawers-1.15.2-7.0.2.jar Storage Drawers {[email protected] DONE}
		OreExcavation-1.7.151.jar Ore Excavation {oreexcavation@NONE DONE}
		performant-1.15-2.06m.jar Performant {[email protected] DONE}
		themidnight-0.5.6.jar The Midnight {[email protected] DONE}
		Harvest-forge-1.15.1-1.2.11-24.jar Harvest {harvest@version DONE}
		tombstone-4.3.4-1.15.2.jar Corail Tombstone {[email protected] DONE}
		Quark-r2.1-230.jar Quark {[email protected] DONE}
		MekanismTools-1.15.2-9.9.20.412.jar Mekanism: Tools {[email protected] DONE}
		FastFurnace-1.15.1-3.0.0.jar FastFurnace {[email protected] DONE}
		mcw-roofs-1.0.2-mc1.15.2_1.15.1.jar Macaw's Roofs {[email protected] DONE}
		AppleSkin-mc1.15.2-forge-1.0.13.jar AppleSkin {[email protected] DONE}
		curiouselytra-FORGE-1.15.2-2.0.jar Curious Elytra {[email protected] DONE}
		mcw-furniture-1.0.1-mc1.15.1+1.15.2.jar Macaw's Furnitures {[email protected] DONE}
		globalxp-1.15.2-v1.4.11.jar Global XP {[email protected] DONE}
		Aquaculture-1.15.2-2.0.13.jar Aquaculture 2 {[email protected] DONE}
		refinedstorageaddons-0.6.1.jar Refined Storage Addons {[email protected] DONE}
		FastLeafDecay-v22.jar FastLeafDecay {fastleafdecay@v22 DONE}
		CosmeticArmorReworked-1.15.2-v1a.jar CosmeticArmorReworked {[email protected] DONE}
		Cyclic-1.15.2-0.3.2.jar Cyclic {[email protected] DONE}
	Kiwi Modules: 
		fruittrees:fruittrees
		fruittrees:hybridization
		kiwi:contributors
	Player Count: 1 / 8; [ServerPlayerEntity['Quarut'/6, l='Test World', x=12.94, y=118.00, z=476.03]]
	Data Packs: vanilla, mod:appleskin (incompatible), mod:aquaculture, mod:attributefix (incompatible), mod:autoreglib (incompatible), mod:biomesoplenty, mod:bookshelf (incompatible), mod:botania (incompatible), mod:caelus (incompatible), mod:cookingforblockheads (incompatible), mod:cosmeticarmorreworked (incompatible), mod:curios (incompatible), mod:curiouselytra (incompatible), mod:cyclic (incompatible), mod:darkutils (incompatible), mod:dungeoncrawl (incompatible), mod:fastbench (incompatible), mod:fastfurnace (incompatible), mod:fastleafdecay, mod:forge (incompatible), mod:fruittrees, mod:globalxp (incompatible), mod:harvest (incompatible), mod:industrialforegoing (incompatible), mod:jei (incompatible), mod:kiwi, mod:mcwfurnitures, mod:mcwroofs, mod:mcwwindows, mod:mekanism, mod:mekanismgenerators, mod:mekanismtools, mod:midnight, mod:naturescompass (incompatible), mod:netherportalfix (incompatible), mod:oreexcavation (incompatible), mod:patchouli (incompatible), mod:performant (incompatible), mod:phosphor, mod:placebo (incompatible), mod:quark, mod:quarkoddities, mod:randompatches (incompatible), mod:refinedstorage (incompatible), mod:refinedstorageaddons (incompatible), mod:storagedrawers (incompatible), mod:terraforged, mod:titanium (incompatible), mod:tombstone, mod:trashslot (incompatible), mod:usefulbackpacks, mod:uteamcore, mod:waystones (incompatible), mod:xreliquary (incompatible)
	Type: Integrated Server (map_client.txt)
	Is Modded: Definitely; Client brand changed to 'forge'