1
0
mirror of https://github.com/BentoBoxWorld/Warps.git synced 2024-11-22 02:25:31 +01:00

Merge pull request #136 from TreemanKing/fix-other-worlds

fix (partial): other worlds can be used
This commit is contained in:
tastybento 2024-06-21 08:16:47 -07:00 committed by GitHub
commit 7f9f35253d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -158,12 +158,17 @@ public class WarpSignsListener implements Listener {
if (noPerms(user, b.getWorld(), inWorld)) { if (noPerms(user, b.getWorld(), inWorld)) {
return; return;
} }
// TODO: These checks are useless if the sign is placed outside a BSB world.
// This will mean level and rank requirements are nil in the case of allow-in-other-worlds: true.
// I'm not sure if there is a better way around this without adding new API checking for primary
// or last island accessed with relevant permissions.
// ignored.
if (inWorld && noLevelOrIsland(user, b.getWorld())) { if (inWorld && noLevelOrIsland(user, b.getWorld())) {
e.setLine(0, ChatColor.RED + addon.getSettings().getWelcomeLine()); e.setLine(0, ChatColor.RED + addon.getSettings().getWelcomeLine());
return; return;
} }
if(!hasCorrectIslandRank(b, user)) { if (inWorld && !hasCorrectIslandRank(b, user)) {
e.setLine(0, ChatColor.RED + addon.getSettings().getWelcomeLine()); e.setLine(0, ChatColor.RED + addon.getSettings().getWelcomeLine());
user.sendMessage("warps.error.not-correct-rank"); user.sendMessage("warps.error.not-correct-rank");
return; return;