Fixup long command support patch
Shiroha CI / build (push) Canceled after 0s
Shiroha CI / Event File (push) Canceled after 0s

This commit is contained in:
2026-08-14 22:00:44 +08:00
parent 6806b9d002
commit 0418b4cdc7
2 changed files with 9 additions and 3 deletions
@@ -7,7 +7,7 @@ Some long commands can be run through the dialog command, but paper has prohibit
Revert to vanilla to fix it. Revert to vanilla to fix it.
diff --git a/net/minecraft/network/protocol/game/ServerboundChatCommandPacket.java b/net/minecraft/network/protocol/game/ServerboundChatCommandPacket.java diff --git a/net/minecraft/network/protocol/game/ServerboundChatCommandPacket.java b/net/minecraft/network/protocol/game/ServerboundChatCommandPacket.java
index 491af2413a4e793a121fec368259ff8211ed031e..5e235767cdd21ee9b3706eb8635e383dad139dc3 100644 index 491af2413a4e793a121fec368259ff8211ed031e..88784f4c9bcd4b21c1caa33bc3df007c94cb3937 100644
--- a/net/minecraft/network/protocol/game/ServerboundChatCommandPacket.java --- a/net/minecraft/network/protocol/game/ServerboundChatCommandPacket.java
+++ b/net/minecraft/network/protocol/game/ServerboundChatCommandPacket.java +++ b/net/minecraft/network/protocol/game/ServerboundChatCommandPacket.java
@@ -12,7 +12,7 @@ public record ServerboundChatCommandPacket(String command) implements Packet<Ser @@ -12,7 +12,7 @@ public record ServerboundChatCommandPacket(String command) implements Packet<Ser
@@ -15,7 +15,7 @@ index 491af2413a4e793a121fec368259ff8211ed031e..5e235767cdd21ee9b3706eb8635e383d
private ServerboundChatCommandPacket(final FriendlyByteBuf input) { private ServerboundChatCommandPacket(final FriendlyByteBuf input) {
- this(input.readUtf(MAX_CHAT_PACKET_INPUT_SIZE)); // Paper - limit chat command inputs - this(input.readUtf(MAX_CHAT_PACKET_INPUT_SIZE)); // Paper - limit chat command inputs
+ this(io.nanachiyo0721.shiroha.config.modules.fixes.LongCommandSupportConfig.enabled ? input.readUtf() : input.readUtf(MAX_CHAT_PACKET_INPUT_SIZE)); // Paper - limit chat command inputs // Shiroha - Add config to support for long command inputs + this(io.nanachiyo0721.shiroha.config.modules.fixes.LongCommandSupportConfig.enabled ? input.readUtf() : input.readUtf(io.nanachiyo0721.shiroha.config.modules.fixes.LongCommandSupportConfig.maximumCommandLength)); // Paper - limit chat command inputs // Shiroha - Add config to support for long command inputs
} }
private void write(final FriendlyByteBuf output) { private void write(final FriendlyByteBuf output) {
@@ -10,5 +10,11 @@ public class LongCommandSupportConfig {
Some long commands can be run through the dialog command, Some long commands can be run through the dialog command,
but paper has prohibited it. but paper has prohibited it.
Enable this to fix this problem.""") Enable this to fix this problem.""")
public static boolean enabled = true; public static boolean enabled = false;
@ConfigInfo(name = "maximum_command_string_length", comments = """
Determines the final limitation of the command length,
paper limits this to 256 chars but here we need to expand
it as we have to use it for command gui
""")
public static int maximumCommandLength = 2048;
} }