Chickens disappear when rotating nesting pens with an EnderIO wrench
EdgarAllen opened this issue ยท 4 comments
I took a quick glance at the code and it doesn't look like you overrode the shouldRefresh method from the TileEntity class. The default implementation has vanilla blocks only refreshing if the block type has changed, where as modded blocks are the opposite. They will create a new tileEntity every time the blockState changes. More often than not, this isn't the behavior we want and need to override the method to act like vanilla blocks. Something like the following should do the trick:
@Override
public boolean shouldRefresh(World world, BlockPos pos, IBlockState oldState, IBlockState newState) {
return oldState.getBlock() != newState.getBlock();
}
If I had to quess, when the EnderIO YetaWrench is calling Block.rotateBlock, it's updating the block state and deleting your tileEntity and creating a new one.
Your pretty much correct. The last time I messed with should refresh though, it would not delete tile entities when the blocks were removed from the world. I also had issues that were worst and needed fixing, But I don't have a lot of major issues right now. I could at least look into it more. I am adding couple new blocks/items for next update.
I appreciate ya looking though, points me in the right direction.
Ive already been trying to figgure this one out. Wrenchs cause them to lose the nbt data. Im working on some other issues atm. But will get to this when I can.