Merge pull request #1158 from IronApollo/master

Added -f flag to bypass findFreePosition in jumpto
This commit is contained in:
NotMyFault 2018-10-15 11:36:46 +02:00 committed by GitHub
commit abe8b3f99a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -168,7 +168,10 @@ public class NavigationCommands {
@Command(
aliases = {"jumpto", "j"},
usage = "[world,x,y,z]",
desc = "Teleport to a location",
desc = "Teleport to a location" +
"Flags:\n" +
" -f forces the specified position to be used",
flags = "f",
min = 0,
max = 1
)
@ -189,7 +192,7 @@ public class NavigationCommands {
pos = player.getSolidBlockTrace(300);
}
if (pos != null) {
player.findFreePosition(pos);
if(args.hasFlag('f')) player.setPosition(pos); else player.findFreePosition(pos);
BBC.POOF.send(player);
} else {
BBC.NO_BLOCK.send(player);