Cleanup and a few bugfixes

This commit is contained in:
Wizjany
2011-09-24 15:24:10 -04:00
parent a2e23fedf7
commit b5b55a2775
30 changed files with 170 additions and 191 deletions

View File

@@ -240,8 +240,7 @@ public abstract class LocalPlayer {
// Found a ceiling!
if (!BlockType.canPassThrough(world.getBlockType(new Vector(x, y, z)))) {
int platformY = Math.max(initialY, y - 3 - clearance);
world.setBlockType(new Vector(x, platformY, z),
BlockID.GLASS);
world.setBlockType(new Vector(x, platformY, z), BlockID.GLASS);
setPosition(new Vector(x + 0.5, platformY + 1, z + 0.5));
return true;
}
@@ -273,8 +272,7 @@ public abstract class LocalPlayer {
} else if (y > maxY + 1) {
break;
} else if (y == maxY + 1) {
world.setBlockType(new Vector(x, y - 2, z),
BlockID.GLASS);
world.setBlockType(new Vector(x, y - 2, z), BlockID.GLASS);
setPosition(new Vector(x + 0.5, y - 1, z + 0.5));
return true;
}
@@ -351,10 +349,12 @@ public abstract class LocalPlayer {
* @return
*/
public PlayerDirection getCardinalDirection() {
if (getPitch() > 67.5)
if (getPitch() > 67.5) {
return PlayerDirection.DOWN;
if (getPitch() < -67.5)
}
if (getPitch() < -67.5) {
return PlayerDirection.UP;
}
// From hey0's code
double rot = (getYaw() - 90) % 360;