Turned command id into a string

This commit is contained in:
Goodbird committed 2024-01-22 23:05:12 +03:00
1 parent d9569d0ef7
commit e882cdacb2
2 files changed
+6 -12

No files matched your search

@@ -19,24 +19,18 @@ public class CommandCommand extends CommandKamkeelBase {
@Override
public String getDescription() {
return "command CommandID [arg1 arg2 ... argn]";
return "command CommandName [arg1 arg2 ... argn]";
}
@Override
public void processCommand(ICommandSender sender, String[] args) throws CommandException {
if (args.length < 1) {
sendError(sender, "You must specify the command id");
sendError(sender, "You must specify the command name");
return;
}
int commandId;
try {
commandId = Integer.parseInt(args[0]);
} catch (NumberFormatException ex) {
sendError(sender, "CommandID must be an integer: " + args[0]);
return;
}
String commandId = args[0];
String[] commandArgs = new String[args.length - 1];
System.arraycopy(args, 1, commandArgs, 0, args.length - 1);
@@ -87,11 +87,11 @@ public class CustomNPCsEvent extends Event implements ICustomNPCsEvent {
public IWorld world;
public IPos pos;
public String senderName;
public int id;
public String id;
public String[] args;
public String replyMessage = "";
public ScriptedCommandEvent(IWorld world, IPos pos, String senderName, int id, String[] args){
public ScriptedCommandEvent(IWorld world, IPos pos, String senderName, String id, String[] args){
this.world = world;
this.pos = pos;
this.senderName = senderName;
@@ -124,7 +124,7 @@ public class CustomNPCsEvent extends Event implements ICustomNPCsEvent {
}
@Override
public int getId() {
public String getId() {
return id;
}