mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-05-30 21:56:23 +02:00
fix: don't allow teleport to denied plots
This commit is contained in:
parent
496b10747e
commit
141444de52
@ -600,7 +600,11 @@ public class PlayerEventListener implements Listener {
|
||||
// i.e. untrusted-visit can override deny-teleport
|
||||
// this is acceptable, because otherwise it wouldn't make sense to have both flags set
|
||||
if (result || (plot.getFlag(UntrustedVisitFlag.class) && plot.getHomeSynchronous().equals(BukkitUtil.adaptComplete(to)))) {
|
||||
plotListener.plotEntry(pp, plot);
|
||||
// returns false if the player is not allowed to enter the plot (if they are denied, for example)
|
||||
// don't let the move event cancel the entry after teleport, but rather catch and cancel early (#4647)
|
||||
if (!plotListener.plotEntry(pp, plot)) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
} else {
|
||||
pp.sendMessage(
|
||||
TranslatableCaption.of("deny.no_enter"),
|
||||
|
Loading…
x
Reference in New Issue
Block a user