diff --git a/Core/src/main/java/com/intellectualcrafters/plot/flag/Flags.java b/Core/src/main/java/com/intellectualcrafters/plot/flag/Flags.java index 2be58cd58..32f66f2a7 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/flag/Flags.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/flag/Flags.java @@ -115,6 +115,7 @@ public final class Flags { }; public static final BooleanFlag SLEEP = new BooleanFlag("sleep"); public static final TeleportDenyFlag DENY_TELEPORT = new TeleportDenyFlag("deny-teleport"); + public static final BooleanFlag DENY_EXIT = new BooleanFlag("deny-exit"); private static final HashMap> flags; diff --git a/Core/src/main/java/com/plotsquared/listener/PlotListener.java b/Core/src/main/java/com/plotsquared/listener/PlotListener.java index 8b9fc1ced..de339a323 100644 --- a/Core/src/main/java/com/plotsquared/listener/PlotListener.java +++ b/Core/src/main/java/com/plotsquared/listener/PlotListener.java @@ -182,6 +182,9 @@ public class PlotListener { if (pw == null) { return true; } + if (Flags.DENY_EXIT.isTrue(plot)) { + return false; + } if (plot.getFlag(Flags.GAMEMODE).isPresent() || plot.getFlag(Flags.GUEST_GAMEMODE).isPresent()) { if (player.getGameMode() != pw.GAMEMODE) { if (!Permissions.hasPermission(player, "plots.gamemode.bypass")) {