Read description
Added command undisguise Changed perm for undisguise to libsdisguises.undisguise Moved where the commands are set incase of errors.
This commit is contained in:
		@@ -64,7 +64,7 @@ public class DisguiseCommand implements CommandExecutor {
 | 
			
		||||
            } else
 | 
			
		||||
                sender.sendMessage(ChatColor.RED + "You do not have permission to use this command.");
 | 
			
		||||
        } else if (args[0].equalsIgnoreCase("undiguise") || args[0].equalsIgnoreCase("undis") || args[0].equalsIgnoreCase("un")) {
 | 
			
		||||
            if (sender.hasPermission("libsdisguises.disguise.undisguise")) {
 | 
			
		||||
            if (sender.hasPermission("libsdisguises.undisguise")) {
 | 
			
		||||
                if (DisguiseAPI.isDisguised(p.getName())) {
 | 
			
		||||
                    DisguiseAPI.undisguiseToAll(p);
 | 
			
		||||
                    sender.sendMessage(ChatColor.RED + "You are no longer disguised");
 | 
			
		||||
 
 | 
			
		||||
@@ -26,7 +26,6 @@ import com.comphenix.protocol.reflect.StructureModifier;
 | 
			
		||||
public class LibsDisguises extends JavaPlugin {
 | 
			
		||||
 | 
			
		||||
    public void onEnable() {
 | 
			
		||||
        getCommand("disguise").setExecutor(new DisguiseCommand());
 | 
			
		||||
        ProtocolLibrary.getProtocolManager().addPacketListener(
 | 
			
		||||
                new PacketAdapter(this, ConnectionSide.SERVER_SIDE, ListenerPriority.NORMAL, Packets.Server.NAMED_ENTITY_SPAWN,
 | 
			
		||||
                        Packets.Server.ENTITY_METADATA, Packets.Server.NAMED_SOUND_EFFECT, Packets.Server.ARM_ANIMATION) {
 | 
			
		||||
@@ -149,5 +148,7 @@ public class LibsDisguises extends JavaPlugin {
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                });
 | 
			
		||||
        getCommand("disguise").setExecutor(new DisguiseCommand());
 | 
			
		||||
        getCommand("undisguise").setExecutor(new UndisguiseCommand());
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										23
									
								
								src/me/libraryaddict/disguise/UndisguiseCommand.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								src/me/libraryaddict/disguise/UndisguiseCommand.java
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,23 @@
 | 
			
		||||
package me.libraryaddict.disguise;
 | 
			
		||||
 | 
			
		||||
import org.bukkit.ChatColor;
 | 
			
		||||
import org.bukkit.command.Command;
 | 
			
		||||
import org.bukkit.command.CommandExecutor;
 | 
			
		||||
import org.bukkit.command.CommandSender;
 | 
			
		||||
import org.bukkit.entity.Player;
 | 
			
		||||
 | 
			
		||||
public class UndisguiseCommand implements CommandExecutor {
 | 
			
		||||
 | 
			
		||||
    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
 | 
			
		||||
        Player p = (Player) sender;
 | 
			
		||||
        if (sender.hasPermission("libsdisguises.undisguise")) {
 | 
			
		||||
            if (DisguiseAPI.isDisguised(p.getName())) {
 | 
			
		||||
                DisguiseAPI.undisguiseToAll(p);
 | 
			
		||||
                sender.sendMessage(ChatColor.RED + "You are no longer disguised");
 | 
			
		||||
            } else
 | 
			
		||||
                sender.sendMessage(ChatColor.RED + "You are not disguised!");
 | 
			
		||||
        } else
 | 
			
		||||
            sender.sendMessage(ChatColor.RED + "You do not have permission to use this command.");
 | 
			
		||||
        return true;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user