mirror of
https://github.com/BentoBoxWorld/Boxed.git
synced 2024-12-12 14:47:13 +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());
|
User u = User.getInstance(e.getPlayer());
|
||||||
// If the to-location is outside the box, cancel it
|
// If the to-location is outside the box, cancel it
|
||||||
if (e.getTo() != null) {
|
if (e.getTo() != null) {
|
||||||
Island i = addon.getIslands().getIsland(e.getFrom().getWorld(), u);
|
addon.getIslands().getIslandAt(e.getTo()).ifPresent(i -> {
|
||||||
if (i == null || !i.onIsland(e.getTo())) {
|
if (!i.onIsland(e.getTo())) {
|
||||||
u.sendMessage("boxed.general.errors.no-teleport-outside");
|
u.sendMessage("boxed.general.errors.no-teleport-outside");
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user