Update to Minecraft 1.11

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2016-11-17 12:41:03 +11:00
parent 49bc1c57f9
commit 4e412ab4e3
279 changed files with 3722 additions and 2992 deletions

View File

@@ -24,7 +24,7 @@ public final class VanillaCommandWrapper extends VanillaCommand {
protected final CommandAbstract vanillaCommand;
public VanillaCommandWrapper(CommandAbstract vanillaCommand, String usage) {
super(vanillaCommand.getCommand(), "A Mojang provided command.", usage, vanillaCommand.b()); // PAIL: rename
super(vanillaCommand.getCommand(), "A Mojang provided command.", usage, vanillaCommand.getAliases());
this.vanillaCommand = vanillaCommand;
this.setPermission("minecraft.command." + vanillaCommand.getCommand());
}
@@ -34,7 +34,14 @@ public final class VanillaCommandWrapper extends VanillaCommand {
if (!testPermission(sender)) return true;
ICommandListener icommandlistener = getListener(sender);
dispatchVanillaCommand(sender, icommandlistener, args);
try {
dispatchVanillaCommand(sender, icommandlistener, args);
} catch (CommandException commandexception) {
// Taken from CommandHandler
ChatMessage chatmessage = new ChatMessage(commandexception.getMessage(), commandexception.getArgs());
chatmessage.getChatModifier().setColor(EnumChatFormat.RED);
icommandlistener.sendMessage(chatmessage);
}
return true;
}
@@ -48,7 +55,7 @@ public final class VanillaCommandWrapper extends VanillaCommand {
public static CommandSender lastSender = null; // Nasty :(
public final int dispatchVanillaCommand(CommandSender bSender, ICommandListener icommandlistener, String[] as) {
public final int dispatchVanillaCommand(CommandSender bSender, ICommandListener icommandlistener, String[] as) throws CommandException {
// Copied from net.minecraft.server.CommandHandler
int i = getPlayerListSize(as);
int j = 0;
@@ -154,7 +161,7 @@ public final class VanillaCommandWrapper extends VanillaCommand {
throw new IllegalArgumentException("Cannot make " + sender + " a vanilla command listener");
}
private int getPlayerListSize(String as[]) {
private int getPlayerListSize(String as[]) throws CommandException {
for (int i = 0; i < as.length; i++) {
if (vanillaCommand.isListStart(as, i) && PlayerSelector.isList(as[i])) {
return i;