Clean up some stuff using ForgeDirection's rotation matrix.

This commit is contained in:
Ben Spiers committed 2014-08-28 20:59:22 +01:00
1 parent 9294719ab2
commit e2fd40543e
4 files changed
+9 -81

No files matched your search

@@ -33,8 +33,6 @@ import cpw.mods.fml.relauncher.SideOnly;
public class BlockGasTank extends BlockContainer
{
public Random machineRand = new Random();
public BlockGasTank()
{
super(Material.iron);
@@ -83,7 +81,7 @@ public class BlockGasTank extends BlockContainer
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityplayer, int facing, float playerX, float playerY, float playerZ)
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityplayer, int side, float playerX, float playerY, float playerZ)
{
if(ItemAttacher.canAttach(entityplayer.getCurrentEquippedItem()))
{
@@ -112,23 +110,7 @@ public class BlockGasTank extends BlockContainer
if(ModAPIManager.INSTANCE.hasAPI("BuildCraftAPI|tools") && tool instanceof IToolWrench)
((IToolWrench)tool).wrenchUsed(entityplayer, x, y, z);
int change = 0;
switch(tileEntity.facing)
{
case 3:
change = 5;
break;
case 5:
change = 2;
break;
case 2:
change = 4;
break;
case 4:
change = 3;
break;
}
int change = ForgeDirection.ROTATION_MATRIX[ForgeDirection.UP.ordinal()][tileEntity.facing];
tileEntity.setFacing((short)change);
world.notifyBlocksOfNeighborChange(x, y, z, this);