Skip to content

Instantly share code, notes, and snippets.

@LexManos
Created November 21, 2014 11:49
Show Gist options
  • Save LexManos/3fb8fccb65676a2a21dc to your computer and use it in GitHub Desktop.
Save LexManos/3fb8fccb65676a2a21dc to your computer and use it in GitHub Desktop.
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