Jump to content

[1.6.2]TileEntity losing it's custom data


siiikooo0743

Recommended Posts

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-

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

@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!

Link to comment
Share on other sites

@ 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!

Link to comment
Share on other sites

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

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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