9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2026-01-06 15:51:31 +00:00
Files
Leaf/leaf-server/minecraft-patches/features/0255-Fix-crash-during-parsing-unknown-command-message.patch
Dreeam f5b95a6716 Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@b0da38c2 Repository details in RuntimeException for MavenLibraryResolver#addRepository (#12939)
PaperMC/Paper@1922be90 Update custom tags (#12183)
PaperMC/Paper@79cf1353 Ignore HopperInventorySearchEvent when it has no listeners (#13009)
PaperMC/Paper@ea014f7a feat: add stuckEntityPoiRetryDelay config (#12949)
PaperMC/Paper@a9e76749 Support for showNotification in PlayerRecipeDiscoverEvent (#12992)
PaperMC/Paper@5622c9dd Expose attribute sentiment (#12974)
PaperMC/Paper@42b653b1 Expose more argument types (#12665)
PaperMC/Paper@52d9a221 [ci/skip] Fix typo in Display javadoc (#13010)
PaperMC/Paper@614e9acf Improve APIs around riptide tridents (#12996)
PaperMC/Paper@51706e5a Fixed DyeItem sheep dye hunk
2025-08-25 15:52:00 -04:00

30 lines
2.0 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com>
Date: Sun, 15 Jun 2025 02:20:26 +0800
Subject: [PATCH] Fix crash during parsing unknown command message
Use direct impl for unknown commands message parse to prevent crash
diff --git a/net/minecraft/commands/Commands.java b/net/minecraft/commands/Commands.java
index 32a9d6e9b18ac1cf66c12462221ebb53f86eac3e..5f80c7b06411e0ad9b0f71f03bb4568daea3ea4d 100644
--- a/net/minecraft/commands/Commands.java
+++ b/net/minecraft/commands/Commands.java
@@ -660,7 +660,7 @@ public class Commands {
net.kyori.adventure.text.Component detailComponent = null;
if (rawMessage.contains("<message>")) {
- messageComponent = io.papermc.paper.command.brigadier.MessageComponentSerializer.message().deserialize(commandSyntaxException.getRawMessage());
+ messageComponent = io.papermc.paper.adventure.PaperAdventure.asAdventure(ComponentUtils.fromMessage(commandSyntaxException.getRawMessage())); // Leaf - Fix crash during parsing unknown command message
}
final String input = commandSyntaxException.getInput();
@@ -703,7 +703,7 @@ public class Commands {
private static net.kyori.adventure.text.Component getVanillaUnknownCommandMessage(
net.kyori.adventure.text.TextComponent.Builder builder, CommandSyntaxException var7, String command
) {
- builder.color(net.kyori.adventure.text.format.NamedTextColor.RED).append(io.papermc.paper.command.brigadier.MessageComponentSerializer.message().deserialize(var7.getRawMessage()));
+ builder.color(net.kyori.adventure.text.format.NamedTextColor.RED).append(io.papermc.paper.adventure.PaperAdventure.asAdventure(ComponentUtils.fromMessage(var7.getRawMessage()))); // Leaf - Fix crash during parsing unknown command message
if (var7.getInput() != null && var7.getCursor() >= 0) {
int min = Math.min(var7.getInput().length(), var7.getCursor());