Title: ItemEntangledChalice.appendHoverText NPE on dedicated client breaks vanilla creative search
Environment
- Minecraft: 26.1.2
- NeoForge: 26.1.2.12-beta
- EvilCraft: 1.2.85 (26.1.1-neoforge)
- CyclopsCore: 1.29.2 (26.1.1-neoforge)
- Side: Client connected to a dedicated server (does not reproduce in singleplayer / Open-to-LAN)
Summary
When connected to a dedicated server, every keystroke in the vanilla creative inventory's search box throws a NullPointerException from ItemEntangledChalice.appendHoverText. The exception is wrapped by KeyboardHandler.charTyped as ReportedException: charTyped event handler, which aborts the keypress before the search tree finishes building. So basically what happens is the typed characters appear in the search box but the item grid never filters resulting in creative search being completely non-functional.
Steps to reproduce
- Install EvilCraft 1.2.85 on a NeoForge 26.1.2 dedicated server and a matching client.
- Connect from the client. Be op / in creative.
- Open the creative inventory and click the Search tab (compass).
- Items are listed normally. Type any character items do not filter, and the client log records a ReportedException: charTyped event handler with the trace below.
Reproduces 100% on every keystroke.
Stack trace
net.minecraft.ReportedException: charTyped event handler
at net.minecraft.client.KeyboardHandler.charTyped(KeyboardHandler.java:623)
at net.minecraft.client.KeyboardHandler.lambda$setup$3(KeyboardHandler.java:664)
...
Caused by: java.lang.NullPointerException: Cannot invoke
"net.minecraft.server.MinecraftServer.getLevel(net.minecraft.resources.ResourceKey)"
because "server" is null
at org.cyclops.cyclopscore.persist.world.WorldStorage$Access.get(WorldStorage.java:44)
at org.cyclops.cyclopscore.persist.world.WorldStorage$Access.get(WorldStorage.java:48)
at org.cyclops.evilcraft.core.fluid.WorldSharedTankCache.getTankContent(WorldSharedTankCache.java:70)
at org.cyclops.evilcraft.item.ItemEntangledChalice$FluidHandler.getFluid(ItemEntangledChalice.java:117)
at org.cyclops.evilcraft.item.ItemEntangledChalice$FluidHandler.getResourceFrom(ItemEntangledChalice.java:122)
at org.cyclops.evilcraft.item.ItemEntangledChalice$FluidHandler.getResourceFrom(ItemEntangledChalice.java:105)
at net.neoforged.neoforge.transfer.ItemAccessResourceHandler.getResource(ItemAccessResourceHandler.java:98)
at net.neoforged.neoforge.transfer.fluid.FluidUtil.getStack(FluidUtil.java:54)
at net.neoforged.neoforge.transfer.fluid.FluidUtil.getFirstStackContained(FluidUtil.java:80)
at org.cyclops.evilcraft.core.helper.BlockTankHelpers.getInfoTank(BlockTankHelpers.java:45)
at org.cyclops.evilcraft.core.item.ItemBlockFluidContainer.appendHoverText(ItemBlockFluidContainer.java:114)
at org.cyclops.evilcraft.item.ItemEntangledChalice.appendHoverText(ItemEntangledChalice.java:87)
at net.minecraft.world.item.ItemStack.addDetailsToTooltip(ItemStack.java:924)
at net.minecraft.world.item.ItemStack.getTooltipLines(ItemStack.java:915)
at net.minecraft.client.multiplayer.SessionSearchTrees.lambda$getTooltipLines$0(SessionSearchTrees.java:53)
...
at net.minecraft.client.searchtree.SearchTree.plainText(SearchTree.java:24)
Title: ItemEntangledChalice.appendHoverText NPE on dedicated client breaks vanilla creative search
Environment
Summary
When connected to a dedicated server, every keystroke in the vanilla creative inventory's search box throws a NullPointerException from ItemEntangledChalice.appendHoverText. The exception is wrapped by KeyboardHandler.charTyped as ReportedException: charTyped event handler, which aborts the keypress before the search tree finishes building. So basically what happens is the typed characters appear in the search box but the item grid never filters resulting in creative search being completely non-functional.
Steps to reproduce
Reproduces 100% on every keystroke.
Stack trace