From cb10f3975369f97972da3f309b9daadd47dd63e7 Mon Sep 17 00:00:00 2001 From: boy0001 Date: Wed, 5 Nov 2014 15:27:49 +1100 Subject: [PATCH] Fixed help menu/plot delete -> plot exit not being called --- .../main/java/com/intellectualcrafters/plot/PlotHelper.java | 5 ++++- .../com/intellectualcrafters/plot/commands/MainCommand.java | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotHelper.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotHelper.java index e1adcbbad..7717e632d 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotHelper.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotHelper.java @@ -29,6 +29,7 @@ import org.bukkit.entity.Entity; import org.bukkit.entity.Player; import com.intellectualcrafters.plot.database.DBFunc; +import com.intellectualcrafters.plot.listeners.PlotListener; /** * plot functions @@ -655,7 +656,9 @@ public class PlotHelper { final PlotId id = PlayerFunctions.getPlot(entity.getLocation()); if ((id != null) && id.equals(plot.id)) { if (entity instanceof Player) { - PlotMain.teleportPlayer((Player) entity, entity.getLocation(), plot); + Player player = (Player) entity; + PlotMain.teleportPlayer(player, entity.getLocation(), plot); + PlotListener.plotExit(player, plot); } else { entity.remove(); diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/MainCommand.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/MainCommand.java index 839054a75..9969eda23 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/MainCommand.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/MainCommand.java @@ -196,7 +196,7 @@ public class MainCommand implements CommandExecutor, TabCompleter { final int start = page * perPage; for (int x = start; x < max; x++) { - cmd = subCommands.get(x); + cmd = commands.get(x); String s = t(C.HELP_PAGE.s()); s = s.replaceAll("%alias%", cmd.alias); s = s.replaceAll("%usage%", cmd.usage.contains("plot") ? cmd.usage : "/plot " + cmd.usage);