mirror of
https://github.com/BentoBoxWorld/Boxed.git
synced 2024-12-03 13:23:32 +01:00
Adjust how tp is prevented. #70
This commit is contained in:
parent
ab108875f7
commit
cd5936d746
@ -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())) {
|
||||
addon.getIslands().getIslandAt(e.getTo()).ifPresent(i -> {
|
||||
if (!i.onIsland(e.getTo())) {
|
||||
u.sendMessage("boxed.general.errors.no-teleport-outside");
|
||||
e.setCancelled(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user