mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-20 03:59:37 +00:00
Move to Forge block rotation implementation.
Hopefully the configurator should rotate more stuff now and more wrenches should be able to rotate our blocks
This commit is contained in:
1 parent
14b40d901a
commit
799f49d9b6
6 files changed
+188
-20
No files matched your search
@@ -1279,4 +1279,37 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds, IPer
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public ForgeDirection[] getValidRotations(World world, int x, int y, int z)
|
||||
{
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
ForgeDirection[] valid = new ForgeDirection[6];
|
||||
if(tile instanceof TileEntityBasicBlock)
|
||||
{
|
||||
TileEntityBasicBlock basicTile = (TileEntityBasicBlock)tile;
|
||||
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
|
||||
{
|
||||
if(basicTile.canSetFacing(dir.ordinal()))
|
||||
{
|
||||
valid[dir.ordinal()] = dir;
|
||||
}
|
||||
}
|
||||
}
|
||||
return valid;
|
||||
}
|
||||
|
||||
public boolean rotateBlock(World world, int x, int y, int z, ForgeDirection axis)
|
||||
{
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
if(tile instanceof TileEntityBasicBlock)
|
||||
{
|
||||
TileEntityBasicBlock basicTile = (TileEntityBasicBlock)tile;
|
||||
if(basicTile.canSetFacing(axis.ordinal()))
|
||||
{
|
||||
basicTile.setFacing((short)axis.ordinal());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user