Closed Shovinus closed 6 years ago
@Nedelosk I take it I would have to update the tile entities position when it finishes falling?
You don't realy have to move the tile entity. You only have to transfer the data the tile had before you felled it. You can do that with writeToNBT
and readFromNBT
. Never use setWorld
or setPos
only vanila should call them.
public static class EntityFallingBlock extends net.minecraft.entity.item.EntityFallingBlock {
EntityFallingBlock(World worldIn, double x, double y, double z, IBlockState fallingBlockState,TileEntity tile) {
super(worldIn, x, y, z, fallingBlockState);
super.readFromNBT(tile.getTileData());
}
would that in theory work then if I passed the tile in (will add exceptions for not existing)
Nope, the leaves disappear in that scenario
You can't use getTileData
you have to use tile.writeToNBT
and it is tileEntityData = tile.writeToNBT(new NBTTagCompound())
and not super.readFromNBT(tile.getTileData())
.
Ffs can't debug on 1.10.2 with forestry for some reason, even tried reinstalling the enviroment: https://pastebin.com/Wke7dZS5
OK well got it to work on 1.12.2 and that works :) the falling entity changes to the default texture while it falls but when it lands it corrects itself. I wonder if I could maybe lookup the texture from a mapping if a forestry tree. https://imgur.com/a/dQ0xVi7
Thank you for your help Nedelosk :)
bb8825c2635793783d75b2c885a71b05eb88740e fixes most of the issue but not textures on falling
ForestryMC/ForestryMC#2118