Skip to content

Commit

Permalink
Fixes a bug when setLocation could be done in any overworld.
Browse files Browse the repository at this point in the history
  • Loading branch information
BONNe committed Aug 20, 2021
1 parent 12ba271 commit 474daea
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,13 @@ else if (user.getLocation() == null || !World.Environment.NORMAL.equals(user.get
Utils.sendMessage(user, user.getTranslation(Constants.ERRORS + "not-in-overworld"));
return false;
}
else if (user.getLocation().getWorld() != this.getWorld())
{
// User must be in gamemode world.
Utils.sendMessage(user, user.getTranslation(Constants.ERRORS + "not-in-correct-world",
Constants.PARAMETER_GAMEMODE, Utils.getGameMode(this.getWorld())));
return false;
}
else if (!island.getProtectionBoundingBox().contains(user.getLocation().toVector()))
{
// User must be in protected area.
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/locales/en-US.yml
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ visit:
not-in-overworld: '&rv You must be in overworld to change visitor spawn location! Operation is cancelled.'
not-in-protected-area: '&r&c You must be in your island protected area! Operation is cancelled.'
not-safe-location: '&r&c Cannot set this location, it is not safe for teleportation! Operation is cancelled.'
not-in-correct-world: '&r&c You are not in [gamemode] world! Operation is cancelled.'
conversations:
# List of strings that are valid for confirming input. (separated with ,)
confirm-string: "true, on, yes, confirm, y, valid, correct"
Expand Down

0 comments on commit 474daea

Please sign in to comment.