38 lines
1.2 KiB
Java
38 lines
1.2 KiB
Java
package WayofTime.bloodmagic.block.base;
|
|
|
|
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.math.BlockPos;
|
|
import net.minecraft.world.World;
|
|
|
|
public abstract class BlockIntegerContainer extends BlockInteger implements ITileEntityProvider
|
|
{
|
|
public BlockIntegerContainer(Material material, int maxMeta, String propName)
|
|
{
|
|
super(material, maxMeta, propName);
|
|
|
|
this.isBlockContainer = true;
|
|
}
|
|
|
|
public BlockIntegerContainer(Material material, int maxMeta)
|
|
{
|
|
this(material, maxMeta, "meta");
|
|
}
|
|
|
|
@Override
|
|
public void breakBlock(World worldIn, BlockPos pos, IBlockState state)
|
|
{
|
|
super.breakBlock(worldIn, pos, state);
|
|
worldIn.removeTileEntity(pos);
|
|
}
|
|
|
|
@Override
|
|
public boolean eventReceived(IBlockState state, World worldIn, BlockPos pos, int eventID, int eventParam)
|
|
{
|
|
super.eventReceived(state, worldIn, pos, eventID, eventParam);
|
|
TileEntity tileentity = worldIn.getTileEntity(pos);
|
|
return tileentity != null && tileentity.receiveClientEvent(eventID, eventParam);
|
|
}
|
|
}
|