mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 21:26:45 +01:00
music/plugin cmds
This commit is contained in:
parent
2e5fee41ef
commit
e8a698816a
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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<String> strings = new ArrayList<String>() {
|
||||
{
|
||||
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));
|
||||
|
Loading…
Reference in New Issue
Block a user