From 5226a0f4bcf873b60e034b1a471dc47f4e940ca8 Mon Sep 17 00:00:00 2001 From: NotMyFault Date: Sun, 13 Feb 2022 10:47:05 +0100 Subject: [PATCH] Address comments --- .../bukkit/listener/EntitySpawnListener.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/EntitySpawnListener.java b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/EntitySpawnListener.java index f47155124..f9b78e571 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/EntitySpawnListener.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/EntitySpawnListener.java @@ -198,20 +198,20 @@ public class EntitySpawnListener implements Listener { final Location fromLocLocation = BukkitUtil.adapt(fromLocation.getLocation()); final PlotArea fromArea = fromLocLocation.getPlotArea(); Location toLocLocation = BukkitUtil.adapt(toLocation.getLocation()); - PlotArea area = toLocLocation.getPlotArea(); + PlotArea toArea = toLocLocation.getPlotArea(); - if (area == null) { + if (toArea == null) { if (fromLocation.getType() == EntityType.SHULKER && fromArea != null) { event.setCancelled(true); } return; } - Plot plot = area.getOwnedPlot(toLocLocation); + Plot toPlot = toArea.getOwnedPlot(toLocLocation); if (fromLocation.getType() == EntityType.SHULKER && fromArea != null) { final Plot fromPlot = fromArea.getOwnedPlot(fromLocLocation); - if (fromPlot != null || plot != null) { - if ((fromPlot == null || !fromPlot.equals(plot)) && (plot == null || !plot.equals(fromPlot))) { + if (fromPlot != null || toPlot != null) { + if ((fromPlot == null || !fromPlot.equals(toPlot)) && (toPlot == null || !toPlot.equals(fromPlot))) { event.setCancelled(true); return; }