renderTileEntityFast(TileEntity te, double x, double y, double z, float partialTicks, int destroyStage, VertexBuffer VertexBuffer)
Is the TE for this TESR. So do the same if check.
No....Are we looking at the same code? You need a new class that extends FastTESR. This will render the lasers and dragon FX. The TEs update does not have access to rendering code, meaning you cant render from there.
Where is your FastTESR? and you are still calling renderFX()
https://github.com/LambdaXV/PlentifulUtilities/blob/master/src/main/java/com/lambda/plentifulutilities/block/tile/TileEntityRestorer.java#L59
int xCoord = (getPos().getX() >> 4) + 1;
int zCoord = (getPos().getZ() >> 4) + 1;
worldObj.getChunkFromChunkCoords(xCoord, zCoord);
This will get a chunk that is offset by one in the x and z (chunk)position.
Why are you using World#getChunkFromChunkCoords and then to get the chunk coords you get the chunk from the block coords... Just use World#getChunkFromBlockCoords(BlockPos).
public void update() {
structureCheck();
}
public int structureCheck() {
int structureCount = 0;
for (int i = 0; i < 10; i++) {
structureCount++;
}
return structureCount;
}
What is the value of structureCheck every time it is called?
...Obviously it is being called because it is erroring on line 25. And try removing any calls to send the packet. Make sure that you check if you are sending the correct packet. Does ModelTogglePacket extend PacketSyncData?
To do what Choonster said you cant use a world Capability. Instead use just the events he suggested. Mainly the ChunkDataEvent ones. They will allow you to save specifically to a chunk. Through the usage of the ChunkDataEvent.Load/Save#getData which returns an NBTTagCompound. I didn't know these events existed and glossed over the ChunkDataEvent in Choonsters post.
You can use a
World
capability to store the
Map
at runtime, it just won't save the data to NBT itself; that will be handled with
ChunkDataEvent.Load
/
Save
.
Then what is the point of having the capability? You could just store it in the event then access the event through the instance of your mod.