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,
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);
}