From 6a9038c30679cd8e528240b6b79d51f4036b8e8a Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Mon, 31 Dec 2018 17:57:17 +0000 Subject: [PATCH] Fix #2205 --- .../bukkit/listeners/PlayerEvents.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/PlayerEvents.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/PlayerEvents.java index f49b807d6..0c2146427 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/PlayerEvents.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/PlayerEvents.java @@ -598,13 +598,11 @@ import java.util.regex.Pattern; // Delayed // Async - TaskManager.runTaskLaterAsync(new Runnable() { - @Override public void run() { - if (!player.hasPlayedBefore() && player.isOnline()) { - player.saveData(); - } - EventUtil.manager.doJoinTask(pp); + TaskManager.runTaskLaterAsync(() -> { + if (!player.hasPlayedBefore() && player.isOnline()) { + player.saveData(); } + EventUtil.manager.doJoinTask(pp); }, 20); } @@ -2214,6 +2212,11 @@ import java.util.regex.Pattern; } MainUtil.sendMessage(pp, C.NO_PERMISSION_EVENT, C.PERMISSION_ADMIN_BUILD_OTHER); event.setCancelled(true); + } else if (Settings.Done.RESTRICT_BUILDING && plot.getFlags().containsKey(Flags.DONE)) { + if (!Permissions.hasPermission(pp, C.PERMISSION_ADMIN_BUILD_OTHER)) { + MainUtil.sendMessage(pp, C.NO_PERMISSION_EVENT, C.PERMISSION_ADMIN_BUILD_OTHER); + event.setCancelled(true); + } } }