mirror of
https://github.com/Minestom/Minestom.git
synced 2024-12-26 11:07:53 +01:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
93f1b240da
@ -10,4 +10,23 @@ public enum Direction {
|
||||
|
||||
public static final Direction[] HORIZONTAL = { SOUTH, WEST, NORTH, EAST };
|
||||
|
||||
public Direction opposite() {
|
||||
switch (this) {
|
||||
case UP:
|
||||
return DOWN;
|
||||
case DOWN:
|
||||
return UP;
|
||||
case EAST:
|
||||
return WEST;
|
||||
case WEST:
|
||||
return EAST;
|
||||
case NORTH:
|
||||
return SOUTH;
|
||||
case SOUTH:
|
||||
return NORTH;
|
||||
|
||||
default:
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user