Add more fast methods to BetterBlockPos

This commit is contained in:
Brady 2018-09-24 19:03:19 -05:00
parent 529f8dae47
commit ce39183482
No known key found for this signature in database
GPG Key ID: 73A788379A197567

View File

@ -126,18 +126,38 @@ public final class BetterBlockPos extends BlockPos {
return new BetterBlockPos(x, y, z - 1);
}
@Override
public BetterBlockPos north(int amt) {
return amt == 0 ? this : new BetterBlockPos(x, y, z - amt);
}
@Override
public BetterBlockPos south() {
return new BetterBlockPos(x, y, z + 1);
}
@Override
public BetterBlockPos south(int amt) {
return amt == 0 ? this : new BetterBlockPos(x, y, z + amt);
}
@Override
public BetterBlockPos east() {
return new BetterBlockPos(x + 1, y, z);
}
@Override
public BetterBlockPos east(int amt) {
return amt == 0 ? this : new BetterBlockPos(x + amt, y, z);
}
@Override
public BetterBlockPos west() {
return new BetterBlockPos(x - 1, y, z);
}
@Override
public BetterBlockPos west(int amt) {
return amt == 0 ? this : new BetterBlockPos(x - amt, y, z);
}
}