diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/PlotHelper.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/PlotHelper.java index 7e9d459f6..88d2fac5e 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/PlotHelper.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/PlotHelper.java @@ -813,7 +813,7 @@ public class PlotHelper { * @param loc * @return */ - public static PlotId getPlot(final Location loc) { + public static PlotId getPlotId(final Location loc) { final String world = loc.getWorld(); final PlotManager manager = PlotSquared.getPlotManager(world); if (manager == null) { @@ -828,4 +828,12 @@ public class PlotHelper { } return id; } + + public static Plot getPlot(final Location loc) { + PlotId id = getPlotId(loc); + if (id == null) { + return null; + } + return getPlot(loc.getWorld(), id); + } } diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/ChunkManager.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/ChunkManager.java index 958a7ba82..48dd55fad 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/ChunkManager.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/ChunkManager.java @@ -110,12 +110,12 @@ public class ChunkManager extends AChunkManager { final int z2 = z1 + 15; final Location bot = new Location(world, x1, 0, z1); Plot plot; - plot = PlotHelper.getCurrentPlot(bot); + plot = PlotHelper.getPlot(bot); if ((plot != null) && (plot.owner != null)) { return plot; } final Location top = new Location(world, x2, 0, z2); - plot = PlotHelper.getCurrentPlot(top); + plot = PlotHelper.getPlot(top); if ((plot != null) && (plot.owner != null)) { return plot; } @@ -743,7 +743,7 @@ public class ChunkManager extends AChunkManager { public void clearAllEntities(final Plot plot) { final List entities = BukkitUtil.getEntities(plot.world); for (final Entity entity : entities) { - final PlotId id = PlayerFunctions.getPlot(BukkitUtil.getLocation(entity)); + final PlotId id = PlotHelper.getPlotId(BukkitUtil.getLocation(entity)); if (plot.id.equals(id)) { if (entity instanceof Player) { final Player player = (Player) entity; diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/PlayerFunctions.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/PlayerFunctions.java index ecdf998f2..e1807473f 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/PlayerFunctions.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/PlayerFunctions.java @@ -142,7 +142,7 @@ public class PlayerFunctions { if (!PlotSquared.isPlotWorld(player.getWorld().getName())) { return null; } - final PlotId id = PlotHelper.getPlot(BukkitUtil.getLocation(player)); + final PlotId id = PlotHelper.getPlotId(BukkitUtil.getLocation(player)); final String world = player.getWorld().getName(); if (id == null) { return null;