Skip to content

Commit f861b20

Browse files
committed
fix(barrel): Use different method to discern direction
1 parent 38ca452 commit f861b20

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

src/main/java/com/dre/brewery/BarrelBody.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,7 @@ public BarrelWoodType getWood() {
135135
if (direction == null) {
136136
return BarrelWoodType.ANY;
137137
}
138-
// TODO: replace this with Block#getRelative(BlockFace)
139-
Block wood = switch (direction) {
140-
case WEST -> spigot.getRelative(1, 0, 0);
141-
case EAST -> spigot.getRelative(-1, 0, 0);
142-
case SOUTH -> spigot.getRelative(0, 0, 1);
143-
case NORTH -> spigot.getRelative(0, 0, -1);
144-
};
138+
Block wood = spigot.getRelative(direction.getFace());
145139
return BarrelWoodType.fromMaterial(wood.getType());
146140
}
147141

0 commit comments

Comments
 (0)