Fixed the phantom placer crashing in pulse mode.

Closes #216
This commit is contained in:
Ellpeck 2016-08-24 13:17:12 +02:00
parent 1f31705dc4
commit 124df2dd70
2 changed files with 20 additions and 18 deletions

View file

@ -132,6 +132,7 @@ public class TileEntityPhantomPlacer extends TileEntityInventoryBase implements
}
private void doWork(){
if(this.isBoundThingInRange()){
if(this.isBreaker){
Block blockToBreak = this.worldObj.getBlockState(this.boundPosition).getBlock();
if(blockToBreak != null && blockToBreak.getBlockHardness(this.worldObj.getBlockState(this.boundPosition), this.worldObj, this.boundPosition) > -1.0F){
@ -156,6 +157,7 @@ public class TileEntityPhantomPlacer extends TileEntityInventoryBase implements
}
}
}
}
@SideOnly(Side.CLIENT)
public void renderParticles(){

View file

@ -181,7 +181,7 @@ public final class WorldUtil{
}
public static ItemStack useItemAtSide(EnumFacing side, World world, BlockPos pos, ItemStack stack){
if(world instanceof WorldServer && stack != null && stack.getItem() != null){
if(world instanceof WorldServer && stack != null && stack.getItem() != null && pos != null){
BlockPos offsetPos = pos.offset(side);
IBlockState state = world.getBlockState(offsetPos);
Block block = state.getBlock();