From 0f7861554e07a5bb7a98fb558d12548f1e068ed5 Mon Sep 17 00:00:00 2001 From: Hannes Greule Date: Sun, 23 Feb 2020 23:21:36 +0100 Subject: [PATCH] Cancel claim event correctly --- .../intellectualsites/plotsquared/plot/object/Plot.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Plot.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Plot.java index 27b16d5a3..7b850fcff 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Plot.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Plot.java @@ -1514,10 +1514,10 @@ public class Plot { public boolean claim(final PlotPlayer player, boolean teleport, String schematic, boolean updateDB) { boolean result = EventUtil.manager.callClaim(player, this, false); - if (updateDB) { - if (!result || (!create(player.getUUID(), true))) { - return false; - } + if (!result) { + return false; // event is cancelled + } else if (updateDB && !create(player.getUUID(), true)) { + return false; } else { area.addPlot(this); }