13
0
geforkt von Mirrors/Paper

Correct 1.5 material data. Fixes BUKKIT-4004, BUKKIT-3785

By: Travis Watkins <amaranth@ubuntu.com>
Dieser Commit ist enthalten in:
Bukkit/Spigot 2013-04-12 16:20:50 -05:00
Ursprung 740df1695d
Commit c22b602d2b
2 geänderte Dateien mit 59 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -220,8 +220,8 @@ public enum Material {
HOPPER(154),
QUARTZ_BLOCK(155),
QUARTZ_STAIRS(156, Stairs.class),
ACTIVATOR_RAIL(157),
DROPPER(158, DirectionalContainer.class),
ACTIVATOR_RAIL(157, PoweredRail.class),
DROPPER(158, Dispenser.class),
// ----- Item Separator -----
IRON_SPADE(256, 1, 250),
IRON_PICKAXE(257, 1, 250),

Datei anzeigen

@ -33,6 +33,63 @@ public class Dispenser extends FurnaceAndDispenser {
super(type, data);
}
public void setFacingDirection(BlockFace face) {
byte data;
switch (face) {
case DOWN:
data = 0x0;
break;
case UP:
data = 0x1;
break;
case NORTH:
data = 0x2;
break;
case SOUTH:
data = 0x3;
break;
case WEST:
data = 0x4;
break;
case EAST:
default:
data = 0x5;
}
setData(data);
}
public BlockFace getFacing() {
int data = getData() & 0x7;
switch (data) {
case 0x0:
return BlockFace.DOWN;
case 0x1:
return BlockFace.UP;
case 0x2:
return BlockFace.NORTH;
case 0x3:
return BlockFace.SOUTH;
case 0x4:
return BlockFace.WEST;
case 0x5:
default:
return BlockFace.EAST;
}
}
@Override
public Dispenser clone() {
return (Dispenser) super.clone();