Jump to content

Recommended Posts

Posted

I've been updating my first ever minecraft project from 1.7.10 to 1.10.2, and been confronted with a quite bizarre issue.

If I'm in a completely new map, and in a fresh instance of minecraft, my tile works perfectly. If I as much as even touch or cause the block to update, the tile just dies. No matter if I place a new one, the block will not issue what is inside of it's

update()

method which is inherited from ITickable. The issue follows through new maps & games, unless I create a new map in a new game. Where it works fine once again, till anything happens to it.

 

The block does contain the tile, that is sure. My debugger item outprints "contains tile: se.Matryoshika.Saligia.Content.Tiles.TileRitualCOTH@..." when used on the block.

Not even just a simple

System.out.println("Update")

works in it's

update()

method.

 

Anyone able to see what the heck is wrong with this specific tile?

 

TileEntity Code: https://github.com/Matryoshika/Saligia/blob/master/src/main/java/se/Matryoshika/Saligia/Content/Tiles/TileRitualCOTH.java

Also previously known as eAndPi.

"Pi, is there a station coming up where we can board your train of thought?" -Kronnn

Published Mods: Underworld

Handy links: Vic_'s Forge events Own WIP Tutorials.

Posted

First thing first do you only ever create one instance of Your TileEntity in the hashmap in RitualRegistry. And do you ever call RitualRegistry.add()

Both of those are done in the SaligiaBaseMultiblocks.class which is called from the CommonProxy postInit.

https://github.com/Matryoshika/Saligia/blob/master/src/main/java/se/Matryoshika/Saligia/Utils/SaligiaBaseMultiblocks.java

Also previously known as eAndPi.

"Pi, is there a station coming up where we can board your train of thought?" -Kronnn

Published Mods: Underworld

Handy links: Vic_'s Forge events Own WIP Tutorials.

Posted

Yeah, issue was a logical one =_=

HashMap was getting an instance of the tile, but that same instance would then be used when the block was placed. I replaced the RitualRegistry parameters to make use of the class directly, and then invoking a new instance when the block is placed.

 

It works now :)

When creating a new TileEntity for your ritual block just return a new instance of the TileEntity to see if that works.

I'm using my own API, as each ritual makes use of the same block, which changes the placed tile based to what RitualName is set to when it gets registered.

I have at least 16 tiles planned, which will all be connected to the same block. API is there to allow anyone else who wants to easily add their own ritual (multiblock based tile) to my mod. Simply returning a new TileRitual.... would have fixed that issue, yes, but would have left the whole point of a central block used by all tiles, including other's, pointless.

Also previously known as eAndPi.

"Pi, is there a station coming up where we can board your train of thought?" -Kronnn

Published Mods: Underworld

Handy links: Vic_'s Forge events Own WIP Tutorials.

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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