9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-26 18:39:23 +00:00
Files
Leaf/leaf-server/minecraft-patches/features/0263-Fix-crash-during-parsing-unknown-command-message.patch
Dreeam 3c25377465 Drop some unused patches
ClassInstanceMultiMap belongs to Minecraft vanilla entity storage.
And is unused, since replaced by spottedleaf's entity storage (rewrite chunk system).
However these patches might be useful for vanilla entity storage if is used.
2025-07-09 04:20:02 +08: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 d201c3965d5a55de740175c140bc7ee411f1be78..38e3c638c8df954f62e8405883bf7a78b19691c3 100644
--- a/net/minecraft/commands/Commands.java
+++ b/net/minecraft/commands/Commands.java
@@ -654,7 +654,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();
@@ -697,7 +697,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());