diff --git a/paper-api/src/main/java/org/bukkit/Material.java b/paper-api/src/main/java/org/bukkit/Material.java index b2d13ec757..6fb6bb4aaa 100644 --- a/paper-api/src/main/java/org/bukkit/Material.java +++ b/paper-api/src/main/java/org/bukkit/Material.java @@ -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), diff --git a/paper-api/src/main/java/org/bukkit/material/Dispenser.java b/paper-api/src/main/java/org/bukkit/material/Dispenser.java index 4168d88adf..34228827c3 100644 --- a/paper-api/src/main/java/org/bukkit/material/Dispenser.java +++ b/paper-api/src/main/java/org/bukkit/material/Dispenser.java @@ -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();