From 2b3fb7b4d035d7b48bd4463fbecbd536a0ff1110 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Thu, 3 Mar 2016 12:25:57 +1100 Subject: [PATCH] Fix for explosion --- .../bukkit/listeners/PlayerEvents.java | 56 +++++++++---------- 1 file changed, 28 insertions(+), 28 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 8fd9e0dea..b69bcf9ff 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java @@ -564,40 +564,40 @@ public class PlayerEvents extends com.plotsquared.listener.PlotListener implemen iter.remove(); } } - } else { - Plot plot = area.getOwnedPlot(loc); - if (plot != null) { - if (FlagManager.isPlotFlagTrue(plot, "explosion")) { - List meta = event.getEntity().getMetadata("plot"); - Plot origin; - if (meta.isEmpty()) { - origin = plot; - } else { - origin = (Plot) meta.get(0).value(); - } - if (lastRadius != 0) { - final List nearby = event.getEntity().getNearbyEntities(lastRadius, lastRadius, lastRadius); - for (final Entity near : nearby) { - if (near instanceof TNTPrimed || near.getType() == EntityType.MINECART_TNT) { - if (!near.hasMetadata("plot")) { - near.setMetadata("plot", new FixedMetadataValue((Plugin) PS.get().IMP, plot)); - } + return; + } + Plot plot = area.getOwnedPlot(loc); + if (plot != null) { + if (FlagManager.isPlotFlagTrue(plot, "explosion")) { + List meta = event.getEntity().getMetadata("plot"); + Plot origin; + if (meta.isEmpty()) { + origin = plot; + } else { + origin = (Plot) meta.get(0).value(); + } + if (lastRadius != 0) { + final List nearby = event.getEntity().getNearbyEntities(lastRadius, lastRadius, lastRadius); + for (final Entity near : nearby) { + if (near instanceof TNTPrimed || near.getType() == EntityType.MINECART_TNT) { + if (!near.hasMetadata("plot")) { + near.setMetadata("plot", new FixedMetadataValue((Plugin) PS.get().IMP, plot)); } } - lastRadius = 0; } - final Iterator iter = event.blockList().iterator(); - while (iter.hasNext()) { - final Block b = iter.next(); - loc = BukkitUtil.getLocation(b.getLocation()); - if (!area.contains(loc.getX(), loc.getZ()) || !origin.equals(area.getOwnedPlot(loc))) { - iter.remove(); - } + lastRadius = 0; + } + final Iterator iter = event.blockList().iterator(); + while (iter.hasNext()) { + final Block b = iter.next(); + loc = BukkitUtil.getLocation(b.getLocation()); + if (!area.contains(loc.getX(), loc.getZ()) || !origin.equals(area.getOwnedPlot(loc))) { + iter.remove(); } } - } else { - event.setCancelled(true); + return; } + event.setCancelled(true); } }