Posted May 15, 20196 yr i looked around the internet to create an GUI and i tried my best to create an gui that shouldnt be able to do anything right now, i only wanted to test out if it will work but my minecraft crashed all the time and i dont know the mistakeforgebench.javaforgebenchcontainer.javaforgebenchgui.javaforgebenchinventory.java thats my code and here the crash log, it seems all caused by one null pointer but why and how? [17:43:48] [Server thread/FATAL] [minecraft/MinecraftServer]: Error executing task java.util.concurrent.ExecutionException: java.lang.NullPointerException: The validated object is null at java.util.concurrent.FutureTask.report(Unknown Source) ~[?:1.8.0_211] at java.util.concurrent.FutureTask.get(Unknown Source) ~[?:1.8.0_211] at net.minecraft.util.Util.runTask(Util.java:54) [Util.class:?] at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:798) [MinecraftServer.class:?] at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:743) [MinecraftServer.class:?] at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:192) [IntegratedServer.class:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:592) [MinecraftServer.class:?] at java.lang.Thread.run(Unknown Source) [?:1.8.0_211] Caused by: java.lang.NullPointerException: The validated object is null at org.apache.commons.lang3.Validate.notNull(Validate.java:225) ~[commons-lang3-3.5.jar:3.5] at org.apache.commons.lang3.Validate.notNull(Validate.java:206) ~[commons-lang3-3.5.jar:3.5] at net.minecraft.util.NonNullList.add(NonNullList.java:62) ~[NonNullList.class:?] at java.util.AbstractList.add(Unknown Source) ~[?:1.8.0_211] at net.minecraft.inventory.Container.getInventory(Container.java:75) ~[Container.class:?] at net.minecraft.inventory.Container.addListener(Container.java:61) ~[Container.class:?] at net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.openGui(FMLNetworkHandler.java:101) ~[FMLNetworkHandler.class:?] at net.minecraft.entity.player.EntityPlayer.openGui(EntityPlayer.java:2809) ~[EntityPlayer.class:?] at com.Schleimtime.Wasteland.blocks.castfurnace.forgebench.onBlockActivated(forgebench.java:56) ~[forgebench.class:?] at net.minecraft.server.management.PlayerInteractionManager.processRightClickBlock(PlayerInteractionManager.java:475) ~[PlayerInteractionManager.class:?] at net.minecraft.network.NetHandlerPlayServer.processTryUseItemOnBlock(NetHandlerPlayServer.java:769) ~[NetHandlerPlayServer.class:?] at net.minecraft.network.play.client.CPacketPlayerTryUseItemOnBlock.processPacket(CPacketPlayerTryUseItemOnBlock.java:68) ~[CPacketPlayerTryUseItemOnBlock.class:?] at net.minecraft.network.play.client.CPacketPlayerTryUseItemOnBlock.processPacket(CPacketPlayerTryUseItemOnBlock.java:13) ~[CPacketPlayerTryUseItemOnBlock.class:?] at net.minecraft.network.PacketThreadUtil$1.run(PacketThreadUtil.java:21) ~[PacketThreadUtil$1.class:?] at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_211] at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_211] at net.minecraft.util.Util.runTask(Util.java:53) ~[Util.class:?] ... 5 more [17:43:48] [Server thread/ERROR] [minecraft/MinecraftServer]: Encountered an unexpected exception net.minecraft.util.ReportedException: Ticking player at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:848) ~[MinecraftServer.class:?] at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:743) ~[MinecraftServer.class:?] at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:192) ~[IntegratedServer.class:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:592) [MinecraftServer.class:?] at java.lang.Thread.run(Unknown Source) [?:1.8.0_211] Caused by: java.lang.NullPointerException at net.minecraft.item.ItemStack.areItemStacksEqual(ItemStack.java:495) ~[ItemStack.class:?] at net.minecraft.inventory.Container.detectAndSendChanges(Container.java:100) ~[Container.class:?] at net.minecraft.entity.player.EntityPlayerMP.onUpdate(EntityPlayerMP.java:365) ~[EntityPlayerMP.class:?] at net.minecraft.world.World.updateEntityWithOptionalForce(World.java:2171) ~[World.class:?] at net.minecraft.world.WorldServer.updateEntityWithOptionalForce(WorldServer.java:871) ~[WorldServer.class:?] at net.minecraft.world.World.updateEntity(World.java:2130) ~[World.class:?] at net.minecraft.world.WorldServer.tickPlayers(WorldServer.java:672) ~[WorldServer.class:?] at net.minecraft.world.World.updateEntities(World.java:1906) ~[World.class:?] at net.minecraft.world.WorldServer.updateEntities(WorldServer.java:643) ~[WorldServer.class:?] at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:842) ~[MinecraftServer.class:?] ... 4 more
May 15, 20196 yr Author public class guihandler implements IGuiHandler{ @Override public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { if(ID == reference.GUI_FORGEBENCH) { forgebenchcontainer con = new forgebenchcontainer(player.inventory, new forgebenchinventory()); return con; } else {return null;} } @Override public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { if(ID == reference.GUI_FORGEBENCH) { forgebenchgui gui = new forgebenchgui(player.inventory, new forgebenchinventory()); return gui; } else {return null;} } } and thats my handler
May 15, 20196 yr Author ok okay i did something completly whrong at end, but the game still crashes for the same reason, now i extended with a tileentity and registered it and addet to the block and all that stuff
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.