Adjust how tp is prevented. #70

This commit is contained in:
tastybento 2024-06-22 22:48:01 -07:00
parent ab108875f7
commit cd5936d746

View File

@ -49,11 +49,12 @@ public class EnderPearlListener implements Listener {
User u = User.getInstance(e.getPlayer());
// If the to-location is outside the box, cancel it
if (e.getTo() != null) {
Island i = addon.getIslands().getIsland(e.getFrom().getWorld(), u);
if (i == null || !i.onIsland(e.getTo())) {
u.sendMessage("boxed.general.errors.no-teleport-outside");
e.setCancelled(true);
}
addon.getIslands().getIslandAt(e.getTo()).ifPresent(i -> {
if (!i.onIsland(e.getTo())) {
u.sendMessage("boxed.general.errors.no-teleport-outside");
e.setCancelled(true);
}
});
}
}