Posted July 26, 201312 yr Hi, I'm initialising my TileEntity in the Constructor of it, but at the point when i want to open my GUI the data is null. My code is here: https://github.com/siiikooo0743/Extradimensional-Hotbar Siiikooo0743 Minecraft!
July 26, 201312 yr what exactly is null ? because there nothing initialized in the tile entity related to NBT and the gui doesnt ask for anything either (anything related to NBT ) how to debug 101:http://www.minecraftforge.net/wiki/Debug_101 -hydroflame, author of the forge revolution-
July 26, 201312 yr First, don't use this: Minecraft.getMinecraft().theWorld.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord); You set your world object for the tile entity and then don't use it? Using that could be bad. Aside from that tidbit (and the way you did your NBT, that was just strange), what hydroflame said.
July 27, 201312 yr Author @Guff I set the worldObj. because otherwise this happens: java.lang.NullPointerException at net.minecraft.tileentity.TileEntity.getBlockMetadata(TileEntity.java:177) at siiikooo0743.EXDIHO.TileEntityControler.<init>(TileEntityControler.java:30) at siiikooo0743.EXDIHO.Controler.createNewTileEntity(Controler.java:78) at net.minecraft.block.Block.createTileEntity(Block.java:1779) at net.minecraft.world.chunk.Chunk.getChunkBlockTileEntity(Chunk.java:987) at net.minecraft.world.chunk.Chunk.setBlockIDWithMetadata(Chunk.java:759) at net.minecraft.world.World.setBlock(World.java:557) at siiikooo0743.EXDIHO.ItemBlockControler.placeBlockAt(ItemBlockControler.java:39) at net.minecraft.item.ItemBlock.onItemUse(ItemBlock.java:119) at net.minecraft.item.ItemStack.tryPlaceItemIntoWorld(ItemStack.java:152) at net.minecraft.client.multiplayer.PlayerControllerMP.onPlayerRightClick(PlayerControllerMP.java:401) at net.minecraft.client.Minecraft.clickMouse(Minecraft.java:1378) at net.minecraft.client.Minecraft.runTick(Minecraft.java:1854) at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:898) at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:826) at net.minecraft.client.main.Main.main(Main.java:93) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at net.minecraft.launchwrapper.Launch.launch(Launch.java:57) at net.minecraft.launchwrapper.Launch.main(Launch.java:18) EDIT: I removed the Minecraft.getMinecraft().theWorld.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord); Minecraft!
July 27, 201312 yr Author @ hydroflame The Array "content" is null and the int sze is 0. because there nothing initialized in the tile entity related to NBT and the gui doesnt ask for anything either (anything related to NBT ) What do I need to do? I did it like in the tutorial: http://www.minecraftforge.net/wiki/Basic_Tile_Entity Thanks for answering btw Minecraft!
July 27, 201312 yr Author @diesieben07 Why can't I? I just pass the World- Parameter of the createNewTileEntity as an parameter to my TE. That seemed to work fine. Minecraft!
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.