mirror of
				https://github.com/IntellectualSites/PlotSquared.git
				synced 2025-11-03 18:53:43 +01:00 
			
		
		
		
	music/plugin cmds
This commit is contained in:
		@@ -29,6 +29,7 @@ import org.bukkit.inventory.meta.ItemMeta;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
import com.intellectualcrafters.plot.config.C;
 | 
					import com.intellectualcrafters.plot.config.C;
 | 
				
			||||||
import com.intellectualcrafters.plot.listeners.PlotPlusListener;
 | 
					import com.intellectualcrafters.plot.listeners.PlotPlusListener;
 | 
				
			||||||
 | 
					import com.intellectualcrafters.plot.object.BukkitPlayer;
 | 
				
			||||||
import com.intellectualcrafters.plot.object.Location;
 | 
					import com.intellectualcrafters.plot.object.Location;
 | 
				
			||||||
import com.intellectualcrafters.plot.object.Plot;
 | 
					import com.intellectualcrafters.plot.object.Plot;
 | 
				
			||||||
import com.intellectualcrafters.plot.object.PlotPlayer;
 | 
					import com.intellectualcrafters.plot.object.PlotPlayer;
 | 
				
			||||||
@@ -41,12 +42,12 @@ public class MusicSubcommand extends SubCommand {
 | 
				
			|||||||
    
 | 
					    
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public boolean execute(final PlotPlayer player, final String... args) {
 | 
					    public boolean execute(final PlotPlayer player, final String... args) {
 | 
				
			||||||
        Location loc = plr.getLocation();
 | 
					        Location loc = player.getLocation();
 | 
				
			||||||
        final Plot plot = MainUtil.getPlot(loc);
 | 
					        final Plot plot = MainUtil.getPlot(loc);
 | 
				
			||||||
        if (plot == null) {
 | 
					        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);
 | 
					            sendMessage(player, C.NO_PLOT_PERMS);
 | 
				
			||||||
            return true;
 | 
					            return true;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
@@ -59,7 +60,8 @@ public class MusicSubcommand extends SubCommand {
 | 
				
			|||||||
            stack.setItemMeta(itemMeta);
 | 
					            stack.setItemMeta(itemMeta);
 | 
				
			||||||
            inventory.addItem(stack);
 | 
					            inventory.addItem(stack);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        player.openInventory(inventory);
 | 
					        // FIXME unchecked casting
 | 
				
			||||||
 | 
					        ((BukkitPlayer) player).player.openInventory(inventory);
 | 
				
			||||||
        return true;
 | 
					        return true;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -32,6 +32,7 @@ import org.bukkit.plugin.java.JavaPlugin;
 | 
				
			|||||||
import com.intellectualcrafters.plot.PlotSquared;
 | 
					import com.intellectualcrafters.plot.PlotSquared;
 | 
				
			||||||
import com.intellectualcrafters.plot.object.PlotPlayer;
 | 
					import com.intellectualcrafters.plot.object.PlotPlayer;
 | 
				
			||||||
import com.intellectualcrafters.plot.util.MainUtil;
 | 
					import com.intellectualcrafters.plot.util.MainUtil;
 | 
				
			||||||
 | 
					import com.intellectualcrafters.plot.util.TaskManager;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public class plugin extends SubCommand {
 | 
					public class plugin extends SubCommand {
 | 
				
			||||||
    public static String downloads, version;
 | 
					    public static String downloads, version;
 | 
				
			||||||
@@ -90,12 +91,12 @@ public class plugin extends SubCommand {
 | 
				
			|||||||
    
 | 
					    
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public boolean execute(final PlotPlayer plr, final String... args) {
 | 
					    public boolean execute(final PlotPlayer plr, final String... args) {
 | 
				
			||||||
        Bukkit.getScheduler().runTaskAsynchronously(PlotSquared.getMain(), new Runnable() {
 | 
					        TaskManager.runTaskAsync(new Runnable() {
 | 
				
			||||||
            @Override
 | 
					            @Override
 | 
				
			||||||
            public void run() {
 | 
					            public void run() {
 | 
				
			||||||
                final ArrayList<String> strings = new ArrayList<String>() {
 | 
					                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>> &6Made by Citymonstret and Empire92"));
 | 
				
			||||||
                        add(String.format("&c>> &6Download at &lhttp://www.spigotmc.org/resources/1177"));
 | 
					                        add(String.format("&c>> &6Download at &lhttp://www.spigotmc.org/resources/1177"));
 | 
				
			||||||
                        add(String.format("&c>> &cNewest Version (Spigot): %s", version));
 | 
					                        add(String.format("&c>> &cNewest Version (Spigot): %s", version));
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user