Cancel claim event correctly

This commit is contained in:
Hannes Greule 2020-02-23 23:21:36 +01:00
parent 255cbbe98f
commit 0f7861554e

View File

@ -1514,10 +1514,10 @@ public class Plot {
public boolean claim(final PlotPlayer player, boolean teleport, String schematic, public boolean claim(final PlotPlayer player, boolean teleport, String schematic,
boolean updateDB) { boolean updateDB) {
boolean result = EventUtil.manager.callClaim(player, this, false); boolean result = EventUtil.manager.callClaim(player, this, false);
if (updateDB) { if (!result) {
if (!result || (!create(player.getUUID(), true))) { return false; // event is cancelled
return false; } else if (updateDB && !create(player.getUUID(), true)) {
} return false;
} else { } else {
area.addPlot(this); area.addPlot(this);
} }