Some BlockFace improvements

By: Dinnerbone <dinnerbone@dinnerbone.com>
This commit is contained in:
Bukkit/Spigot
2011-01-07 10:32:36 +00:00
parent 99ed6048d7
commit e5f9932bad
2 changed files with 49 additions and 1 deletions

View File

@@ -10,6 +10,10 @@ public enum BlockFace {
West(0, 0, 1),
Up(0, 1, 0),
Down(0, -1, 0),
NorthEast(North, East),
NorthWest(North, West),
SouthEast(South, East),
SouthWest(South, West),
Self(0, 0, 0);
private final int modX;
@@ -22,6 +26,12 @@ public enum BlockFace {
this.modZ = modZ;
}
private BlockFace(final BlockFace face1, final BlockFace face2) {
this.modX = face1.getModX() + face2.getModX();
this.modY = face1.getModY() + face2.getModY();
this.modZ = face1.getModZ() + face2.getModZ();
}
/**
* Get the amount of X-coordinates to modify to get the represented block
* @return Amount of X-coordinates to modify