From f07ac646f304cc9698896a50c392a765ac0ab554 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Mon, 15 Aug 2016 09:30:39 +1000 Subject: [PATCH] Possible fix for greeting spam --- .../com/plotsquared/bukkit/listeners/PlayerEvents.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java b/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java index a5832236e..ab1bf0c5e 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java @@ -1187,14 +1187,13 @@ public class PlayerEvents extends PlotListener implements Listener { } lb = new BukkitLazyBlock(blockId, block); ItemStack hand = player.getItemInHand(); - if (eventType != null) { + if (eventType != null && (eventType != PlayerBlockEventType.INTERACT_BLOCK || !player.isSneaking())) { break; } Material type = (hand == null) ? null : hand.getType(); int id = (type == null) ? 0 : type.getId(); if (id == 0) { eventType = PlayerBlockEventType.INTERACT_BLOCK; - lb = new BukkitLazyBlock(0, block); break; } if (id < 198) { @@ -1689,7 +1688,7 @@ public class PlayerEvents extends PlotListener implements Listener { if (area == null) { return; } - Plot now = area.getPlotAbs(loc); + Plot now = area.getPlot(loc); Plot lastPlot = pp.getMeta("lastplot"); if (now == null) { if (lastPlot != null && !plotExit(pp, lastPlot) && this.tmpTeleport) { @@ -1762,7 +1761,7 @@ public class PlayerEvents extends PlotListener implements Listener { if (area == null) { return; } - Plot now = area.getPlotAbs(loc); + Plot now = area.getPlot(loc); Plot lastPlot = pp.getMeta("lastplot"); if (now == null) { if (lastPlot != null && !plotExit(pp, lastPlot) && this.tmpTeleport) {