Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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

  • 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

  • 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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.