2015-11-17 23:52:31 +00:00
|
|
|
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;
|
2016-03-18 19:01:58 +00:00
|
|
|
import net.minecraft.util.math.BlockPos;
|
2015-11-17 23:52:31 +00:00
|
|
|
import net.minecraft.world.World;
|
|
|
|
|
2015-12-30 20:34:40 +00:00
|
|
|
public abstract class BlockStringContainer extends BlockString implements ITileEntityProvider
|
|
|
|
{
|
|
|
|
public BlockStringContainer(Material material, String[] values, String propName)
|
|
|
|
{
|
2015-11-17 23:52:31 +00:00
|
|
|
super(material, values, propName);
|
|
|
|
|
|
|
|
this.isBlockContainer = true;
|
|
|
|
}
|
|
|
|
|
2015-12-30 20:34:40 +00:00
|
|
|
public BlockStringContainer(Material material, String[] values)
|
|
|
|
{
|
2015-11-17 23:52:31 +00:00
|
|
|
this(material, values, "type");
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2015-12-30 20:34:40 +00:00
|
|
|
public void breakBlock(World worldIn, BlockPos pos, IBlockState state)
|
|
|
|
{
|
2015-11-17 23:52:31 +00:00
|
|
|
super.breakBlock(worldIn, pos, state);
|
|
|
|
worldIn.removeTileEntity(pos);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2016-05-20 00:43:33 +00:00
|
|
|
public boolean eventReceived(IBlockState state, World worldIn, BlockPos pos, int eventID, int eventParam)
|
2015-12-30 20:34:40 +00:00
|
|
|
{
|
2016-05-20 00:43:33 +00:00
|
|
|
super.eventReceived(state, worldIn, pos, eventID, eventParam);
|
2015-11-17 23:52:31 +00:00
|
|
|
TileEntity tileentity = worldIn.getTileEntity(pos);
|
|
|
|
return tileentity != null && tileentity.receiveClientEvent(eventID, eventParam);
|
|
|
|
}
|
|
|
|
}
|