Created
November 21, 2014 11:49
-
-
Save LexManos/3fb8fccb65676a2a21dc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public boolean rotateBlock(World world, BlockPos pos, EnumFacing axis) | |
{ | |
IBlockState state = world.getBlockState(pos); | |
for (IProperty prop : (java.util.Set<IProperty>)state.getProperties().keySet()) | |
{ | |
if (prop.getName().equals("facing")) | |
{ | |
world.setBlockState(pos, state.cycleProperty(prop)); | |
return true; | |
} | |
} | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment