Skip to content

Commit

Permalink
Moar rotation fixes. I'm thinking this may not be the best way to do …
Browse files Browse the repository at this point in the history
…this.
  • Loading branch information
hunterboerner committed Jul 25, 2013
1 parent bc3d4a1 commit 2fde4ac
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import mods.quantumcraft.machine.TileQDeenergizer;
import mods.quantumcraft.machine.TileQDematerializer;
import mods.quantumcraft.machine.TileQDislocator;
import mods.quantumcraft.machine.TileQEInjector;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
Expand Down Expand Up @@ -76,6 +77,20 @@ public void onBlockPlacedBy(World world, int x, int y, int z,
((TileQDematerializer) te).rotateDirectlyTo(5);
}
}
if (te instanceof TileQDislocator
&& ((TileQDislocator) te).canRotate()) {
int facing = MathHelper
.floor_double((entity.rotationYaw * 4F) / 360F + 0.5D) & 3;
if (facing == 0) {
((TileQDislocator) te).rotateDirectlyTo(3);
} else if (facing == 1) {
((TileQDislocator) te).rotateDirectlyTo(4);
} else if (facing == 2) {
((TileQDislocator) te).rotateDirectlyTo(2);
} else if (facing == 3) {
((TileQDislocator) te).rotateDirectlyTo(5);
}
}
}

}

0 comments on commit 2fde4ac

Please sign in to comment.