Toggle facing across opposites
This commit is contained in:
parent
256b3f1b47
commit
f633df81c2
1 changed files with 7 additions and 1 deletions
|
@ -79,7 +79,13 @@ public class ItemWrench extends ItemTR implements ITexturedItem {
|
|||
}
|
||||
IBlockState state = world.getBlockState(pos);
|
||||
if(state.getBlock() instanceof BlockEnergyStorage){
|
||||
world.setBlockState(pos, state.withProperty(BlockEnergyStorage.FACING, side.getOpposite()));
|
||||
EnumFacing facing = state.getValue(BlockEnergyStorage.FACING);
|
||||
if(facing.getOpposite() == side){
|
||||
facing = side;
|
||||
} else {
|
||||
facing = side.getOpposite();
|
||||
}
|
||||
world.setBlockState(pos, state.withProperty(BlockEnergyStorage.FACING, facing));
|
||||
return EnumActionResult.SUCCESS;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue