From 72291b09f264b7f469440a5a009bc937cf69f3d8 Mon Sep 17 00:00:00 2001 From: MattBDev <4009945+MattBDev@users.noreply.github.com> Date: Tue, 30 Apr 2019 15:11:43 -0400 Subject: [PATCH] Fix the actual issue and remove whatever junk from the previous commit --- .../plotsquared/bukkit/listeners/PlayerEvents.java | 8 ++++++++ 1 file changed, 8 insertions(+) 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 04c7b216f..be4a24c65 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 @@ -2803,6 +2803,7 @@ import org.bukkit.util.Vector; return; } Entity victim = event.getEntity(); +/* if (victim.getType().equals(EntityType.ITEM_FRAME)) { Plot plot = BukkitUtil.getLocation(victim).getPlot(); if (plot != null && !plot.isAdded(damager.getUniqueId())) { @@ -2810,6 +2811,7 @@ import org.bukkit.util.Vector; return; } } +*/ if (!entityDamage(damager, victim, event.getCause())) { if (event.isCancelled()) { if (victim instanceof Ageable) { @@ -2918,6 +2920,12 @@ import org.bukkit.util.Vector; if (victim instanceof Hanging) { // hanging if (plot != null && (plot.getFlag(Flags.HANGING_BREAK, false) || plot .isAdded(plotPlayer.getUUID()))) { + if (Settings.Done.RESTRICT_BUILDING && plot.getFlags().containsKey(Flags.DONE)) { + if (!Permissions.hasPermission(plotPlayer, Captions.PERMISSION_ADMIN_BUILD_OTHER)) { + MainUtil.sendMessage(plotPlayer, Captions.NO_PERMISSION_EVENT, Captions.PERMISSION_ADMIN_BUILD_OTHER); + return false; + } + } return true; } if (!Permissions.hasPermission(plotPlayer, "plots.admin.destroy." + stub)) {