From ac5cdfae648ce3f76ed3d036a7444a1ec5ea6fef Mon Sep 17 00:00:00 2001 From: MattBDev <4009945+MattBDev@users.noreply.github.com> Date: Tue, 30 Apr 2019 14:44:33 -0400 Subject: [PATCH] Fix for ItemFrames --- .../plotsquared/bukkit/listeners/PlayerEvents.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 d31703ad4..04c7b216f 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,13 @@ 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())) { + event.setCancelled(true); + return; + } + } if (!entityDamage(damager, victim, event.getCause())) { if (event.isCancelled()) { if (victim instanceof Ageable) { @@ -2918,7 +2925,7 @@ import org.bukkit.util.Vector; "plots.admin.destroy." + stub); return false; } - } else if (victim.getEntityId() == 30) { + } else if (victim.getType() == EntityType.ARMOR_STAND) { if (plot != null && (plot.getFlag(Flags.MISC_BREAK, false) || plot .isAdded(plotPlayer.getUUID()))) { return true;