9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-23 00:49:31 +00:00

Fix #61 & Correct case (#62)

This commit is contained in:
DGun Otto
2024-05-22 17:16:36 +08:00
committed by GitHub
parent 7bb67dee00
commit e30198bd9d
2 changed files with 9 additions and 6 deletions

View File

@@ -6,14 +6,14 @@ Subject: [PATCH] Chat Image protocol
This patch is Powered by ChatImage (https://github.com/kitUIN/ChatImage) This patch is Powered by ChatImage (https://github.com/kitUIN/ChatImage)
diff --git a/src/main/java/org/dreeam/leaf/config/modules/network/ProtocolSupport.java b/src/main/java/org/dreeam/leaf/config/modules/network/ProtocolSupport.java diff --git a/src/main/java/org/dreeam/leaf/config/modules/network/ProtocolSupport.java b/src/main/java/org/dreeam/leaf/config/modules/network/ProtocolSupport.java
index be8474a514e7b9bdacd7cc89d8d3e8b3bc3eb709..759b8728f954c2b2725ac2b3f5ffeb495160c7ca 100644 index be8474a514e7b9bdacd7cc89d8d3e8b3bc3eb709..9324ca1f1abd2343b2f1eaec019e84428f01c626 100644
--- a/src/main/java/org/dreeam/leaf/config/modules/network/ProtocolSupport.java --- a/src/main/java/org/dreeam/leaf/config/modules/network/ProtocolSupport.java
+++ b/src/main/java/org/dreeam/leaf/config/modules/network/ProtocolSupport.java +++ b/src/main/java/org/dreeam/leaf/config/modules/network/ProtocolSupport.java
@@ -21,6 +21,9 @@ public class ProtocolSupport implements IConfigModule { @@ -21,6 +21,9 @@ public class ProtocolSupport implements IConfigModule {
@ConfigInfo(baseName = "appleskin-protocol") @ConfigInfo(baseName = "appleskin-protocol")
public static boolean appleskinProtocol = false; public static boolean appleskinProtocol = false;
+ @ConfigInfo(baseName = "chatImage-protocol") + @ConfigInfo(baseName = "chatimage-protocol")
+ public static boolean chatImageProtocol = false; + public static boolean chatImageProtocol = false;
+ +
@ConfigInfo(baseName = "xaero-map-protocol") @ConfigInfo(baseName = "xaero-map-protocol")
@@ -21,10 +21,10 @@ index be8474a514e7b9bdacd7cc89d8d3e8b3bc3eb709..759b8728f954c2b2725ac2b3f5ffeb49
@ConfigInfo(baseName = "xaero-map-server-id") @ConfigInfo(baseName = "xaero-map-server-id")
diff --git a/src/main/java/org/leavesmc/leaves/protocol/ChatImageProtocol.java b/src/main/java/org/leavesmc/leaves/protocol/ChatImageProtocol.java diff --git a/src/main/java/org/leavesmc/leaves/protocol/ChatImageProtocol.java b/src/main/java/org/leavesmc/leaves/protocol/ChatImageProtocol.java
new file mode 100644 new file mode 100644
index 0000000000000000000000000000000000000000..cfbcc4fd836547e6019bc1bc0ac7a3263f0c385a index 0000000000000000000000000000000000000000..1b829e73e2e000219fb4b44f78ec3f6a1c2824c7
--- /dev/null --- /dev/null
+++ b/src/main/java/org/leavesmc/leaves/protocol/ChatImageProtocol.java +++ b/src/main/java/org/leavesmc/leaves/protocol/ChatImageProtocol.java
@@ -0,0 +1,157 @@ @@ -0,0 +1,160 @@
+package org.leavesmc.leaves.protocol; +package org.leavesmc.leaves.protocol;
+ +
+import com.google.common.collect.Lists; +import com.google.common.collect.Lists;
@@ -60,6 +60,7 @@ index 0000000000000000000000000000000000000000..cfbcc4fd836547e6019bc1bc0ac7a326
+ public record FileInfoChannelPacket(String message) implements LeavesCustomPayload<LeavesProtocolManager.LeavesPayload> { + public record FileInfoChannelPacket(String message) implements LeavesCustomPayload<LeavesProtocolManager.LeavesPayload> {
+ private static final ResourceLocation FILE_INFO = ChatImageProtocol.id("file_info"); + private static final ResourceLocation FILE_INFO = ChatImageProtocol.id("file_info");
+ +
+ @New
+ public FileInfoChannelPacket(ResourceLocation id, FriendlyByteBuf buffer) { + public FileInfoChannelPacket(ResourceLocation id, FriendlyByteBuf buffer) {
+ this(buffer.readUtf(MAX_STRING)); + this(buffer.readUtf(MAX_STRING));
+ } + }
@@ -81,6 +82,7 @@ index 0000000000000000000000000000000000000000..cfbcc4fd836547e6019bc1bc0ac7a326
+ */ + */
+ private static final ResourceLocation DOWNLOAD_FILE_CHANNEL = ChatImageProtocol.id("download_file_channel"); + private static final ResourceLocation DOWNLOAD_FILE_CHANNEL = ChatImageProtocol.id("download_file_channel");
+ +
+ @New
+ public DownloadFileChannelPacket(ResourceLocation id, FriendlyByteBuf buffer) { + public DownloadFileChannelPacket(ResourceLocation id, FriendlyByteBuf buffer) {
+ this(buffer.readUtf(MAX_STRING)); + this(buffer.readUtf(MAX_STRING));
+ } + }
@@ -103,6 +105,7 @@ index 0000000000000000000000000000000000000000..cfbcc4fd836547e6019bc1bc0ac7a326
+ */ + */
+ private static final ResourceLocation FILE_CHANNEL = ChatImageProtocol.id("file_channel"); + private static final ResourceLocation FILE_CHANNEL = ChatImageProtocol.id("file_channel");
+ +
+ @New
+ public FileChannelPacket(ResourceLocation id, FriendlyByteBuf buffer) { + public FileChannelPacket(ResourceLocation id, FriendlyByteBuf buffer) {
+ this(buffer.readUtf(MAX_STRING)); + this(buffer.readUtf(MAX_STRING));
+ } + }

View File

@@ -6,7 +6,7 @@ Subject: [PATCH] Asteor Bar protocol
This patch is Powered by AsteorBar (https://github.com/afoxxvi/AsteorBarMod) This patch is Powered by AsteorBar (https://github.com/afoxxvi/AsteorBarMod)
diff --git a/src/main/java/org/dreeam/leaf/config/modules/network/ProtocolSupport.java b/src/main/java/org/dreeam/leaf/config/modules/network/ProtocolSupport.java diff --git a/src/main/java/org/dreeam/leaf/config/modules/network/ProtocolSupport.java b/src/main/java/org/dreeam/leaf/config/modules/network/ProtocolSupport.java
index 759b8728f954c2b2725ac2b3f5ffeb495160c7ca..8378bab717088b832888be69618f13ba6dd44273 100644 index 9324ca1f1abd2343b2f1eaec019e84428f01c626..45c422b993e254fd892bfd6f47a074f1e9688714 100644
--- a/src/main/java/org/dreeam/leaf/config/modules/network/ProtocolSupport.java --- a/src/main/java/org/dreeam/leaf/config/modules/network/ProtocolSupport.java
+++ b/src/main/java/org/dreeam/leaf/config/modules/network/ProtocolSupport.java +++ b/src/main/java/org/dreeam/leaf/config/modules/network/ProtocolSupport.java
@@ -21,6 +21,9 @@ public class ProtocolSupport implements IConfigModule { @@ -21,6 +21,9 @@ public class ProtocolSupport implements IConfigModule {
@@ -16,7 +16,7 @@ index 759b8728f954c2b2725ac2b3f5ffeb495160c7ca..8378bab717088b832888be69618f13ba
+ @ConfigInfo(baseName = "asteorbar-protocol") + @ConfigInfo(baseName = "asteorbar-protocol")
+ public static boolean asteorBarProtocol = false; + public static boolean asteorBarProtocol = false;
+ +
@ConfigInfo(baseName = "chatImage-protocol") @ConfigInfo(baseName = "chatimage-protocol")
public static boolean chatImageProtocol = false; public static boolean chatImageProtocol = false;
diff --git a/src/main/java/org/leavesmc/leaves/protocol/AsteorBarProtocol.java b/src/main/java/org/leavesmc/leaves/protocol/AsteorBarProtocol.java diff --git a/src/main/java/org/leavesmc/leaves/protocol/AsteorBarProtocol.java b/src/main/java/org/leavesmc/leaves/protocol/AsteorBarProtocol.java