From f651607d2f0a60f494fa03f29b1510381cbd6ba4 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Wed, 17 Aug 2016 12:22:37 +1000 Subject: [PATCH] Might work? --- .../main/java/com/intellectualcrafters/plot/flag/Flags.java | 1 + Core/src/main/java/com/plotsquared/listener/PlotListener.java | 3 +++ 2 files changed, 4 insertions(+) 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")) {