package xyz.brassgoggledcoders.boilerplate.lib.common.blocks;

import net.minecraft.block.ITileEntityProvider;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.world.World;
import xyz.brassgoggledcoders.boilerplate.lib.common.utils.Utils;

public abstract class BlockTEBase extends BlockBase implements IHasTileEntity, ITileEntityProvider
{
	public BlockTEBase(Material material, String name)
	{
		super(material, name);
		this.isBlockContainer = true;
	}

	public int getRenderType()
	{
		return 3;
	}

	public void breakBlock(World worldIn, BlockPos pos, IBlockState state)
	{
		super.breakBlock(worldIn, pos, state);
		worldIn.removeTileEntity(pos);
	}

	public boolean onBlockEventReceived(World worldIn, BlockPos pos, IBlockState state, int eventID, int eventParam)
	{
		super.onBlockEventReceived(worldIn, pos, state, eventID, eventParam);
		TileEntity tileentity = worldIn.getTileEntity(pos);
		return tileentity != null && tileentity.receiveClientEvent(eventID, eventParam);
	}

	@Override
	public TileEntity createNewTileEntity(World worldIn, int meta)
	{
		Object tileEntity = Utils.createObjectInstance(getTileEntityClass());
		if(tileEntity instanceof TileEntity)
		{
			return (TileEntity)tileEntity;
		}
		return null;
	}
}

@@ -60,56 +60,8 @@
 s;%0A%0A
-import net.minecraft.block.ITileEntityProvider;%0A
 impo
@@ -410,29 +410,8 @@
 tity
-, ITileEntityProvider
 %0A%7B%0A%09
@@ -1055,16 +1055,98 @@
 m);%0A%09%7D%0A%0A
+%09@Override%0A%09public boolean hasTileEntity(IBlockState state)%0A%09%7B%0A%09%09return true;%0A%09%7D%0A%0A
 %09@Overri
@@ -1177,11 +1177,8 @@
 eate
-New
 Tile
@@ -1199,20 +1199,27 @@
 orld
-In, int meta
+, IBlockState state
 )%0A%09%7B

Change to use State aware TE methods