use of net.minecraft.block.BlockDoor.EnumHingePosition in project BuildCraft by BuildCraft.
the class VanillaRotationHandlers method rotateDoor.
private static EnumActionResult rotateDoor(World world, BlockPos pos, IBlockState state, EnumFacing sideWrenched) {
if (state.getBlock() instanceof BlockDoor) {
// Just check to make sure we have the right block...
EnumDoorHalf half = state.getValue(BlockDoor.HALF);
if (half == EnumDoorHalf.UPPER) {
EnumHingePosition hinge = state.getValue(BlockDoor.HINGE);
if (hinge == EnumHingePosition.LEFT)
hinge = EnumHingePosition.RIGHT;
else
hinge = EnumHingePosition.LEFT;
world.setBlockState(pos, state.withProperty(BlockDoor.HINGE, hinge));
} else {
// Lower
rotateOnce(world, pos, state, BlockDoor.FACING, ROTATE_HORIZONTAL);
}
return EnumActionResult.SUCCESS;
}
return EnumActionResult.PASS;
}
Aggregations