From e8a698816a52bb6114a79c48dd66c4b7ee834bfe Mon Sep 17 00:00:00 2001 From: boy0001 Date: Sun, 22 Feb 2015 18:26:17 +1100 Subject: [PATCH] music/plugin cmds --- .../plot/commands/MusicSubcommand.java | 10 ++++++---- .../com/intellectualcrafters/plot/commands/plugin.java | 5 +++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/MusicSubcommand.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/MusicSubcommand.java index 45a02eb21..ced6c571d 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/MusicSubcommand.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/MusicSubcommand.java @@ -29,6 +29,7 @@ import org.bukkit.inventory.meta.ItemMeta; import com.intellectualcrafters.plot.config.C; import com.intellectualcrafters.plot.listeners.PlotPlusListener; +import com.intellectualcrafters.plot.object.BukkitPlayer; import com.intellectualcrafters.plot.object.Location; import com.intellectualcrafters.plot.object.Plot; import com.intellectualcrafters.plot.object.PlotPlayer; @@ -41,12 +42,12 @@ public class MusicSubcommand extends SubCommand { @Override public boolean execute(final PlotPlayer player, final String... args) { - Location loc = plr.getLocation(); + Location loc = player.getLocation(); final Plot plot = MainUtil.getPlot(loc); if (plot == null) { - return !sendMessage(plr, C.NOT_IN_PLOT); + return !sendMessage(player, C.NOT_IN_PLOT); } - if (!plot.hasRights(player)) { + if (!plot.isAdded(player.getUUID())) { sendMessage(player, C.NO_PLOT_PERMS); return true; } @@ -59,7 +60,8 @@ public class MusicSubcommand extends SubCommand { stack.setItemMeta(itemMeta); inventory.addItem(stack); } - player.openInventory(inventory); + // FIXME unchecked casting + ((BukkitPlayer) player).player.openInventory(inventory); return true; } } diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/plugin.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/plugin.java index fad1bb18e..8f1b73f78 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/plugin.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/plugin.java @@ -32,6 +32,7 @@ import org.bukkit.plugin.java.JavaPlugin; import com.intellectualcrafters.plot.PlotSquared; import com.intellectualcrafters.plot.object.PlotPlayer; import com.intellectualcrafters.plot.util.MainUtil; +import com.intellectualcrafters.plot.util.TaskManager; public class plugin extends SubCommand { public static String downloads, version; @@ -90,12 +91,12 @@ public class plugin extends SubCommand { @Override public boolean execute(final PlotPlayer plr, final String... args) { - Bukkit.getScheduler().runTaskAsynchronously(PlotSquared.getMain(), new Runnable() { + TaskManager.runTaskAsync(new Runnable() { @Override public void run() { final ArrayList strings = new ArrayList() { { - add(String.format("&c>> &6PlotSquared (Version: %s)", PlotSquared.getMain().getDescription().getVersion())); + add(String.format("&c>> &6PlotSquared (Version: %s)", PlotSquared.IMP.getVersion())); add(String.format("&c>> &6Made by Citymonstret and Empire92")); add(String.format("&c>> &6Download at &lhttp://www.spigotmc.org/resources/1177")); add(String.format("&c>> &cNewest Version (Spigot): %s", version));