mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-20 15:49:43 +00:00
Fix CREATE Command
This commit is contained in:
1 parent
e33d3fc5e4
commit
ae4b95731b
2 files changed
+12
-10
No files matched your search
@@ -29,9 +29,9 @@ public class CmdHelp extends CommandKamkeelBase{
|
||||
@Override
|
||||
public void processCommand(ICommandSender sender, String[] args) throws CommandException {
|
||||
if(args.length == 0){
|
||||
sendMessage(sender, "------Kamkeel Commands------");
|
||||
sendMessage(sender, "\u00A78------ \u00A7cKamkeel Commands \u00A78------");
|
||||
for(Entry<String, CommandKamkeelBase> entry : parent.map.entrySet()){
|
||||
sendMessage(sender, entry.getKey() + ": " + entry.getValue().getCommandUsage(sender));
|
||||
sendMessage(sender, "\u00A77> " + "\u00A7e" + entry.getKey() + "\u00A78: \u00A77" + entry.getValue().getCommandUsage(sender));
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -50,17 +50,17 @@ public class CmdHelp extends CommandKamkeelBase{
|
||||
m = command.subcommands.get(args[1].toLowerCase());
|
||||
}
|
||||
if(m == null){
|
||||
sendMessage(sender, "------" + command.getCommandName() + " SubCommands------");
|
||||
sendMessage(sender, "\u00A78------ \u00A7a" + command.getCommandName().toUpperCase() + " SubCommands \u00A78------");
|
||||
for(Entry<String, Method> entry : command.subcommands.entrySet()){
|
||||
sender.addChatMessage(new ChatComponentTranslation(entry.getKey() + ": " + entry.getValue().getAnnotation(SubCommand.class).desc()));
|
||||
sender.addChatMessage(new ChatComponentTranslation("\u00A77> " + "\u00A7e" + entry.getKey() + "\u00A78: \u00A77" + entry.getValue().getAnnotation(SubCommand.class).desc()));
|
||||
}
|
||||
}
|
||||
else{
|
||||
sendMessage(sender, "------" + command.getCommandName() + "." + args[1].toLowerCase() + " Command------");
|
||||
sendMessage(sender, "\u00A78------ \u00A7b" + command.getCommandName().toUpperCase() + "." + args[1].toUpperCase() + " Command \u00A78------");
|
||||
SubCommand sc = m.getAnnotation(SubCommand.class);
|
||||
sender.addChatMessage(new ChatComponentTranslation(sc.desc()));
|
||||
sender.addChatMessage(new ChatComponentTranslation("\u00A77" + sc.desc()));
|
||||
if(!sc.usage().isEmpty())
|
||||
sender.addChatMessage(new ChatComponentTranslation("Usage: " + sc.usage()));
|
||||
sender.addChatMessage(new ChatComponentTranslation("\u00A77Usage: \u00A76" + sc.usage()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -21,6 +21,7 @@ import noppes.npcs.entity.EntityCustomNpc;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.roles.RoleCompanion;
|
||||
import noppes.npcs.roles.RoleFollower;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
public class CmdNPC extends CommandKamkeelBase {
|
||||
|
||||
@@ -51,9 +52,10 @@ public class CmdNPC extends CommandKamkeelBase {
|
||||
public void processCommand(ICommandSender sender, String[] args) throws CommandException {
|
||||
String npcname = args[0].replace("%", " ");
|
||||
String command = args[1];
|
||||
args = Arrays.copyOfRange(args, 2, args.length);
|
||||
if(command.equalsIgnoreCase("create")){
|
||||
processSubCommand(sender, command, new String[]{args[0], npcname});
|
||||
args = Arrays.copyOfRange(args, 2, args.length);
|
||||
if(command.equalsIgnoreCase("create")){
|
||||
args = ArrayUtils.add(args, 0, npcname);
|
||||
processSubCommand(sender, command, args);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user