diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotSquared.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotSquared.java index 3b1a61ee7..4d13d0f3f 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotSquared.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotSquared.java @@ -46,6 +46,7 @@ import com.intellectualcrafters.plot.object.PlotCluster; import com.intellectualcrafters.plot.object.PlotGenerator; import com.intellectualcrafters.plot.object.PlotId; import com.intellectualcrafters.plot.object.PlotManager; +import com.intellectualcrafters.plot.object.PlotPlayer; import com.intellectualcrafters.plot.object.PlotWorld; import com.intellectualcrafters.plot.util.ClusterManager; import com.intellectualcrafters.plot.util.ExpireManager; @@ -176,6 +177,23 @@ public class PlotSquared { return new HashMap<>(); } + public static Set getPlots(final PlotPlayer player) { + final UUID uuid = player.getUUID(); + final ArrayList myplots = new ArrayList<>(); + for (final String world : plots.keySet()) { + if (isPlotWorld(world)) { + for (final Plot plot : plots.get(world).values()) { + if (plot.hasOwner()) { + if (plot.getOwner().equals(uuid)) { + myplots.add(plot); + } + } + } + } + } + return new HashSet<>(myplots); + } + public static boolean removePlot(final String world, final PlotId id, final boolean callEvent) { if (callEvent) { if (!IMP.callRemovePlot(world, id)) { diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Helpers.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Helpers.java index df4a5d532..0d303b7c5 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Helpers.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Helpers.java @@ -31,6 +31,7 @@ import com.intellectualcrafters.plot.object.Location; import com.intellectualcrafters.plot.object.Plot; import com.intellectualcrafters.plot.object.PlotPlayer; import com.intellectualcrafters.plot.util.MainUtil; +import com.intellectualcrafters.plot.util.Permissions; import com.intellectualcrafters.plot.util.bukkit.BukkitPlayerFunctions; import com.intellectualcrafters.plot.util.bukkit.UUIDHandler; @@ -84,8 +85,7 @@ public class Helpers extends SubCommand { } plot.addHelper(uuid); DBFunc.setHelper(loc.getWorld(), plot, uuid); - final PlayerPlotHelperEvent event = new PlayerPlotHelperEvent(plr, plot, uuid, true); - Bukkit.getPluginManager().callEvent(event); + // FIXME PlayerPlotHelperEvent } else { MainUtil.sendMessage(plr, C.ALREADY_ADDED); return false; @@ -107,8 +107,7 @@ public class Helpers extends SubCommand { final UUID uuid = UUIDHandler.getUUID(args[1]); plot.removeHelper(uuid); DBFunc.removeHelper(loc.getWorld(), plot, uuid); - final PlayerPlotHelperEvent event = new PlayerPlotHelperEvent(plr, plot, uuid, false); - Bukkit.getPluginManager().callEvent(event); + // FIXME PlayerPlotHelperEvent MainUtil.sendMessage(plr, C.HELPER_REMOVED); } else { MainUtil.sendMessage(plr, C.HELPER_NEED_ARGUMENT); diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Home.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Home.java index d9d922c04..e09b0e419 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Home.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Home.java @@ -20,8 +20,6 @@ //////////////////////////////////////////////////////////////////////////////////////////////////// package com.intellectualcrafters.plot.commands; -import org.bukkit.entity.Player; - import com.intellectualcrafters.plot.PlotSquared; import com.intellectualcrafters.plot.config.C; import com.intellectualcrafters.plot.object.Plot; @@ -64,7 +62,7 @@ public class Home extends SubCommand { if ((temp = isAlias(args[0])) != null) { if (temp.hasOwner()) { if (temp.getOwner().equals(UUIDHandler.getUUID(plr))) { - teleportPlayer(plr, temp); + MainUtil.teleportPlayer(plr, plr.getLocation(), temp); return true; } } @@ -78,7 +76,7 @@ public class Home extends SubCommand { MainUtil.sendMessage(plr, C.NOT_VALID_NUMBER); return false; } - teleportPlayer(plr, plots[id - 1]); + MainUtil.teleportPlayer(plr, plr.getLocation(), plots[id - 1]); return true; } else { MainUtil.sendMessage(plr, C.NO_PLOTS); @@ -86,7 +84,7 @@ public class Home extends SubCommand { } } - public void teleportPlayer(final Player player, final Plot plot) { + public void teleportPlayer(final PlotPlayer player, final Plot plot) { MainUtil.teleportPlayer(player, player.getLocation(), plot); } }