Convert forge has/createTileEntity back into ITEP for portability.Once upon a time this was 'best practice' but it never seemed to provide any benefit.

This commit is contained in:
Vincent Lee committed 2020-06-24 20:17:53 -05:00
1 parent 7c77a31347
commit 75a4dd16cc
55 files changed
+140 -317

No files matched your search

@@ -10,6 +10,7 @@ package vazkii.botania.common.block;
import net.minecraft.block.BlockRenderType;
import net.minecraft.block.BlockState;
import net.minecraft.block.ITileEntityProvider;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity;
@@ -38,7 +39,7 @@ import vazkii.botania.common.block.tile.TileAnimatedTorch;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public class BlockAnimatedTorch extends BlockModWaterloggable implements IWandable, IManaTrigger, IHourglassTrigger, IWandHUD {
public class BlockAnimatedTorch extends BlockModWaterloggable implements ITileEntityProvider, IWandable, IManaTrigger, IHourglassTrigger, IWandHUD {
private static final VoxelShape SHAPE = makeCuboidShape(0, 0, 0, 16, 4, 16);
@@ -123,15 +124,10 @@ public class BlockAnimatedTorch extends BlockModWaterloggable implements IWandab
}
@Override
public TileEntity createTileEntity(@Nonnull BlockState state, @Nonnull IBlockReader world) {
public TileEntity createNewTileEntity(@Nonnull IBlockReader world) {
return new TileAnimatedTorch();
}
@Override
public boolean hasTileEntity(BlockState state) {
return true;
}
@Override
public void onPlayerDestroy(IWorld world, BlockPos pos, BlockState state) {
// TE is already gone so best we can do is just notify everyone