Update to Minecraft 1.15.2

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2020-01-22 08:00:00 +11:00
parent 09a2fa4d96
commit 77b64e0c78
50 changed files with 293 additions and 421 deletions

View File

@@ -84,109 +84,16 @@
StringReader stringreader = new StringReader(s);
if (stringreader.canRead() && stringreader.peek() == '/') {
@@ -119,7 +173,6 @@
byte b0;
try {
- byte b1;
ChatComponentText chatcomponenttext;
try {
@@ -128,58 +181,62 @@
return i;
} catch (CommandException commandexception) {
commandlistenerwrapper.sendFailureMessage(commandexception.a());
- b1 = 0;
- return b1;
+ b0 = 0;
+ return b0;
} catch (CommandSyntaxException commandsyntaxexception) {
commandlistenerwrapper.sendFailureMessage(ChatComponentUtils.a(commandsyntaxexception.getRawMessage()));
@@ -134,7 +188,7 @@
if (commandsyntaxexception.getInput() != null && commandsyntaxexception.getCursor() >= 0) {
int j = Math.min(commandsyntaxexception.getInput().length(), commandsyntaxexception.getCursor());
- IChatBaseComponent ichatbasecomponent = (new ChatComponentText("")).a(EnumChatFormat.GRAY).a((chatmodifier) -> {
IChatBaseComponent ichatbasecomponent = (new ChatComponentText("")).a(EnumChatFormat.GRAY).a((chatmodifier) -> {
- chatmodifier.setChatClickable(new ChatClickable(ChatClickable.EnumClickAction.SUGGEST_COMMAND, s));
- });
+ chatmodifier.setChatClickable(new ChatClickable(ChatClickable.EnumClickAction.SUGGEST_COMMAND, label)); // CraftBukkit
});
+ chatcomponenttext = new ChatComponentText("");
if (j > 10) {
- ichatbasecomponent.a("...");
+ chatcomponenttext.a("...");
}
- ichatbasecomponent.a(commandsyntaxexception.getInput().substring(Math.max(0, j - 10), j));
+ chatcomponenttext.a(commandsyntaxexception.getInput().substring(Math.max(0, j - 10), j));
if (j < commandsyntaxexception.getInput().length()) {
- IChatBaseComponent ichatbasecomponent1 = (new ChatComponentText(commandsyntaxexception.getInput().substring(j))).a(new EnumChatFormat[]{EnumChatFormat.RED, EnumChatFormat.UNDERLINE});
+ ChatComponentText chatcomponenttext1 = new ChatComponentText(commandsyntaxexception.getInput().substring(j));
- ichatbasecomponent.addSibling(ichatbasecomponent1);
+ chatcomponenttext1.getChatModifier().setColor(EnumChatFormat.RED);
+ chatcomponenttext1.getChatModifier().setUnderline(Boolean.valueOf(true));
+ chatcomponenttext.addSibling(chatcomponenttext1);
}
- ichatbasecomponent.addSibling((new ChatMessage("command.context.here", new Object[0])).a(new EnumChatFormat[]{EnumChatFormat.RED, EnumChatFormat.ITALIC}));
- commandlistenerwrapper.sendFailureMessage(ichatbasecomponent);
+ ChatMessage chatmessage = new ChatMessage("command.context.here", new Object[0]);
+
+ chatmessage.getChatModifier().setItalic(Boolean.valueOf(true));
+ chatmessage.getChatModifier().setColor(EnumChatFormat.RED);
+ chatcomponenttext.addSibling(chatmessage);
+ chatcomponenttext.getChatModifier().setColor(EnumChatFormat.GRAY);
+ chatcomponenttext.getChatModifier().setChatClickable(new ChatClickable(ChatClickable.EnumClickAction.SUGGEST_COMMAND, label)); // CraftBukkit
+ commandlistenerwrapper.sendFailureMessage(chatcomponenttext);
}
- b1 = 0;
- return b1;
+ b0 = 0;
} catch (Exception exception) {
- chatcomponenttext = new ChatComponentText;
- }
+ ChatMessage chatmessage1 = new ChatMessage("command.failed", new Object[0]);
- chatcomponenttext.<init>(exception.getMessage() == null ? exception.getClass().getName() : exception.getMessage());
- ChatComponentText chatcomponenttext1 = chatcomponenttext;
+ chatcomponenttext = new ChatComponentText(exception.getMessage() == null ? exception.getClass().getName() : exception.getMessage());
+ if (CommandDispatcher.LOGGER.isDebugEnabled()) {
+ CommandDispatcher.LOGGER.error("Command exception: {}", s, exception);
+ StackTraceElement[] astacktraceelement = exception.getStackTrace();
- if (CommandDispatcher.LOGGER.isDebugEnabled()) {
- CommandDispatcher.LOGGER.error("Command exception: {}", s, exception);
- StackTraceElement[] astacktraceelement = exception.getStackTrace();
+ for (int k = 0; k < Math.min(astacktraceelement.length, 3); ++k) {
+ chatcomponenttext.a("\n\n" + astacktraceelement[k].getMethodName() + "\n " + astacktraceelement[k].getFileName() + ":" + astacktraceelement[k].getLineNumber());
+ }
+ }
- for(int k = 0; k < Math.min(astacktraceelement.length, 3); ++k) {
- chatcomponenttext1.a("\n\n").a(astacktraceelement[k].getMethodName()).a("\n ").a(astacktraceelement[k].getFileName()).a(":").a(String.valueOf(astacktraceelement[k].getLineNumber()));
+ chatmessage1.getChatModifier().setChatHoverable(new ChatHoverable(ChatHoverable.EnumHoverAction.SHOW_TEXT, chatcomponenttext));
+ commandlistenerwrapper.sendFailureMessage(chatmessage1);
+ if (SharedConstants.b) {
+ commandlistenerwrapper.sendFailureMessage(new ChatComponentText(SystemUtils.d(exception)));
+ CommandDispatcher.LOGGER.error("'" + s + "' threw an exception", exception);
}
- }
- commandlistenerwrapper.sendFailureMessage((new ChatMessage("command.failed", new Object[0])).a((chatmodifier) -> {
- chatmodifier.setChatHoverable(new ChatHoverable(ChatHoverable.EnumHoverAction.SHOW_TEXT, chatcomponenttext1));
- }));
- if (SharedConstants.b) {
- commandlistenerwrapper.sendFailureMessage(new ChatComponentText(SystemUtils.d(exception)));
- CommandDispatcher.LOGGER.error("'" + s + "' threw an exception", exception);
- }
+ byte b1 = 0;
- b0 = 0;
+ return b1;
+ }
} finally {
commandlistenerwrapper.getServer().getMethodProfiler().exit();
}
@@ -188,11 +245,36 @@
@@ -184,11 +238,36 @@
}
public void a(EntityPlayer entityplayer) {
@@ -224,7 +131,7 @@
entityplayer.playerConnection.sendPacket(new PacketPlayOutCommands(rootcommandnode));
}
@@ -203,7 +285,7 @@
@@ -199,7 +278,7 @@
CommandNode<CommandListenerWrapper> commandnode2 = (CommandNode) iterator.next();
if (commandnode2.canUse(commandlistenerwrapper)) {
@@ -233,7 +140,7 @@
argumentbuilder.requires((icompletionprovider) -> {
return true;
@@ -226,7 +308,7 @@
@@ -222,7 +301,7 @@
argumentbuilder.redirect((CommandNode) map.get(argumentbuilder.getRedirect()));
}