Fixed commands not working.
This commit is contained in:
parent
9126c9d295
commit
6e6e4d3fe0
|
@ -137,19 +137,23 @@ public class SimpleCommandMap implements CommandMap {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
if (target.timings == null) {
|
||||||
target.timings.startTiming(); // Spigot
|
|
||||||
// Note: we don't return the result of target.execute as thats success / failure, we return handled (true) or not handled (false)
|
|
||||||
target.execute(sender, sentCommandLabel, Arrays_copyOfRange(args, 1, args.length));
|
target.execute(sender, sentCommandLabel, Arrays_copyOfRange(args, 1, args.length));
|
||||||
target.timings.stopTiming(); // Spigot
|
} else {
|
||||||
} catch (CommandException ex) {
|
try {
|
||||||
target.timings.stopTiming(); // Spigot
|
target.timings.startTiming(); // Spigot
|
||||||
throw ex;
|
// Note: we don't return the result of target.execute as thats success / failure, we return handled (true) or not handled (false)
|
||||||
} catch (Throwable ex) {
|
target.execute(sender, sentCommandLabel, Arrays_copyOfRange(args, 1, args.length));
|
||||||
target.timings.stopTiming(); // Spigot
|
target.timings.stopTiming(); // Spigot
|
||||||
throw new CommandException("Unhandled exception executing '" + commandLine + "' in " + target, ex);
|
} catch (CommandException ex) {
|
||||||
|
target.timings.stopTiming(); // Spigot
|
||||||
|
throw ex;
|
||||||
|
} catch (Throwable ex) {
|
||||||
|
target.timings.stopTiming(); // Spigot
|
||||||
|
String msg = "Unhandled exception executing '" + commandLine + "' in " + target;
|
||||||
|
throw new CommandException(msg, ex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// return true as command was handled
|
// return true as command was handled
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -224,7 +228,8 @@ public class SimpleCommandMap implements CommandMap {
|
||||||
} catch (CommandException ex) {
|
} catch (CommandException ex) {
|
||||||
throw ex;
|
throw ex;
|
||||||
} catch (Throwable ex) {
|
} catch (Throwable ex) {
|
||||||
throw new CommandException("Unhandled exception executing tab-completer for '" + cmdLine + "' in " + target, ex);
|
String msg = "Unhandled exception executing tab-completer for '" + cmdLine + "' in " + target;
|
||||||
|
throw new CommandException(msg, ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// PaperSpigot end
|
// PaperSpigot end
|
||||||
|
@ -273,4 +278,4 @@ public class SimpleCommandMap implements CommandMap {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue