public class ExtendedCommandBlock
extends BlockCommandBlock
{
private String command;
public ExtendedCommandBlock(int ID, String command)
{
super(ID);
this.command = command;
}
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entityLivingBase, ItemStack itemStack)
{
TileEntityCommandBlock tileEntityCommandBlock = (TileEntityCommandBlock)world.getBlockTileEntity(x, y, z);
if (itemStack.hasDisplayName())
{
tileEntityCommandBlock.setCommandSenderName(itemStack.getDisplayName());
}
tileEntityCommandBlock.setCommand(command);
}
}