Stop nuke's exploding when broken

This commit is contained in:
modmuss50 2016-03-16 16:38:44 +00:00
parent 65a64e650b
commit f532ce15c0

View file

@ -67,7 +67,7 @@ public class BlockNuke extends BaseBlock implements ITexturedBlock {
public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) { public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) {
super.onBlockAdded(worldIn, pos, state); super.onBlockAdded(worldIn, pos, state);
if (worldIn.isBlockPowered(pos)) { if (worldIn.isBlockPowered(pos)) {
this.onBlockDestroyedByPlayer(worldIn, pos, state); this.explode(worldIn, pos, state, null););
worldIn.setBlockToAir(pos); worldIn.setBlockToAir(pos);
} }
} }
@ -77,16 +77,11 @@ public class BlockNuke extends BaseBlock implements ITexturedBlock {
*/ */
public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) { public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) {
if (worldIn.isBlockPowered(pos)) { if (worldIn.isBlockPowered(pos)) {
this.onBlockDestroyedByPlayer(worldIn, pos, state); this.explode(worldIn, pos, state, null);
worldIn.setBlockToAir(pos); worldIn.setBlockToAir(pos);
} }
} }
public void onBlockDestroyedByPlayer(World worldIn, BlockPos pos, IBlockState state)
{
this.explode(worldIn, pos, state, (EntityLivingBase)null);
}
@Override @Override
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) { public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) {
return false; //No flint and steel return false; //No flint and steel