13
0
geforkt von Mirrors/Paper

Added additional BlockFace enum members and fixed Sign class.

By: sunkid <sunkid@iminurnetz.com>
Dieser Commit ist enthalten in:
Bukkit/Spigot 2011-07-13 14:14:04 -07:00
Ursprung 77399b9d2e
Commit 656403dc86
2 geänderte Dateien mit 89 neuen und 9 gelöschten Zeilen

Datei anzeigen

@ -14,6 +14,14 @@ public enum BlockFace {
NORTH_WEST(NORTH, WEST),
SOUTH_EAST(SOUTH, EAST),
SOUTH_WEST(SOUTH, WEST),
WEST_NORTH_WEST(WEST, NORTH_WEST),
NORTH_NORTH_WEST(NORTH, NORTH_WEST),
NORTH_NORTH_EAST(NORTH, NORTH_EAST),
EAST_NORTH_EAST(EAST, NORTH_EAST),
EAST_SOUTH_EAST(EAST, SOUTH_EAST),
SOUTH_SOUTH_EAST(SOUTH, SOUTH_EAST),
SOUTH_SOUTH_WEST(SOUTH, SOUTH_WEST),
WEST_SOUTH_WEST(WEST, SOUTH_WEST),
SELF(0, 0, 0);
private final int modX;
@ -88,6 +96,30 @@ public enum BlockFace {
case SOUTH_WEST:
return BlockFace.NORTH_EAST;
case WEST_NORTH_WEST:
return BlockFace.EAST_SOUTH_EAST;
case NORTH_NORTH_WEST:
return BlockFace.SOUTH_SOUTH_EAST;
case NORTH_NORTH_EAST:
return BlockFace.SOUTH_SOUTH_WEST;
case EAST_NORTH_EAST:
return BlockFace.WEST_SOUTH_WEST;
case EAST_SOUTH_EAST:
return BlockFace.WEST_NORTH_WEST;
case SOUTH_SOUTH_EAST:
return BlockFace.NORTH_NORTH_WEST;
case SOUTH_SOUTH_WEST:
return BlockFace.NORTH_NORTH_EAST;
case WEST_SOUTH_WEST:
return BlockFace.EAST_NORTH_EAST;
case SELF:
return BlockFace.SELF;
}

Datei anzeigen

@ -77,36 +77,52 @@ public class Sign extends MaterialData implements Attachable {
if (!isWallSign()) {
switch (data) {
case 0x0:
case 0x1:
return BlockFace.WEST;
case 0x1:
return BlockFace.WEST_NORTH_WEST;
case 0x2:
case 0x3:
return BlockFace.NORTH_WEST;
case 0x3:
return BlockFace.NORTH_NORTH_WEST;
case 0x4:
case 0x5:
return BlockFace.NORTH;
case 0x5:
return BlockFace.NORTH_NORTH_EAST;
case 0x6:
case 0x7:
return BlockFace.NORTH_EAST;
case 0x7:
return BlockFace.EAST_NORTH_EAST;
case 0x8:
case 0x9:
return BlockFace.EAST;
case 0x9:
return BlockFace.EAST_SOUTH_EAST;
case 0xA:
case 0xB:
return BlockFace.SOUTH_EAST;
case 0xB:
return BlockFace.SOUTH_SOUTH_EAST;
case 0xC:
case 0xD:
return BlockFace.SOUTH;
case 0xD:
return BlockFace.SOUTH_SOUTH_WEST;
case 0xE:
case 0xF:
return BlockFace.SOUTH_WEST;
case 0xF:
return BlockFace.WEST_SOUTH_WEST;
}
return null;
@ -139,36 +155,68 @@ public class Sign extends MaterialData implements Attachable {
} else {
switch (face) {
case WEST:
data = 0x0;
break;
case WEST_NORTH_WEST:
data = 0x1;
break;
case NORTH_WEST:
data = 0x2;
break;
case NORTH_NORTH_WEST:
data = 0x3;
break;
case NORTH:
data = 0x4;
break;
case NORTH_NORTH_EAST:
data = 0x5;
break;
case NORTH_EAST:
data = 0x6;
break;
case EAST_NORTH_EAST:
data = 0x7;
break;
case EAST:
data = 0x8;
break;
case EAST_SOUTH_EAST:
data = 0x9;
break;
case SOUTH_EAST:
data = 0xA;
break;
case SOUTH_SOUTH_EAST:
data = 0xB;
break;
case SOUTH:
data = 0xC;
break;
case SOUTH_SOUTH_WEST:
data = 0xD;
break;
case WEST_SOUTH_WEST:
data = 0xF;
break;
case SOUTH_WEST:
default:
data = 0xF;
data = 0xE;
}
}