Skip to content

Commit

Permalink
Fix SbPingRequest
Browse files Browse the repository at this point in the history
  • Loading branch information
Lumine1909 committed Jun 9, 2024
1 parent 6951bdc commit 09d3f74
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
8 changes: 5 additions & 3 deletions patches/api/0010-Bytebuf-API.patch
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,10 @@ index 0000000000000000000000000000000000000000..e246c0a8725fa3b2be065433652a19a5
+}
diff --git a/src/main/java/org/leavesmc/leaves/bytebuf/packet/PacketType.java b/src/main/java/org/leavesmc/leaves/bytebuf/packet/PacketType.java
new file mode 100644
index 0000000000000000000000000000000000000000..4fd80d703653b8fb2f2bec329b1c5d04ae419d2d
index 0000000000000000000000000000000000000000..89c45a056716d0644fe1b41d49a4bdcede53c795
--- /dev/null
+++ b/src/main/java/org/leavesmc/leaves/bytebuf/packet/PacketType.java
@@ -0,0 +1,180 @@
@@ -0,0 +1,182 @@
+package org.leavesmc.leaves.bytebuf.packet;
+
+public enum PacketType {
Expand Down Expand Up @@ -392,5 +392,7 @@ index 0000000000000000000000000000000000000000..4fd80d703653b8fb2f2bec329b1c5d04
+ ServerboundCustomPayload,
+ ServerboundKeepAlive,
+ ServerboundPong,
+ ServerboundResourcePack
+ ServerboundResourcePack,
+ ServerboundPingRequest,
+ ClientboundPongResponse
+}
12 changes: 8 additions & 4 deletions patches/server/0135-Bytebuf-API.patch
Original file line number Diff line number Diff line change
Expand Up @@ -392,10 +392,10 @@ index 0000000000000000000000000000000000000000..707d784cf17926e869481c39b0da908e
+}
diff --git a/src/main/java/org/leavesmc/leaves/bytebuf/internal/InternalBytebufHandler.java b/src/main/java/org/leavesmc/leaves/bytebuf/internal/InternalBytebufHandler.java
new file mode 100644
index 0000000000000000000000000000000000000000..c9c649b997283fc28e84660e49f128ab8aabaa7e
index 0000000000000000000000000000000000000000..2c446d1657834324f015b1637221164ff61f04e1
--- /dev/null
+++ b/src/main/java/org/leavesmc/leaves/bytebuf/internal/InternalBytebufHandler.java
@@ -0,0 +1,221 @@
@@ -0,0 +1,225 @@
+package org.leavesmc.leaves.bytebuf.internal;
+
+import com.google.common.cache.Cache;
Expand Down Expand Up @@ -505,8 +505,12 @@ index 0000000000000000000000000000000000000000..c9c649b997283fc28e84660e49f128ab
+ } catch (ClassNotFoundException e) {
+ try {
+ packetClass = Class.forName("net.minecraft.network.protocol.common." + packet.name() + "Packet");
+ } catch (ClassNotFoundException ignored) {
+ continue;
+ } catch (ClassNotFoundException e2) {
+ try {
+ packetClass = Class.forName("net.minecraft.network.protocol.ping." + packet.name() + "Packet");
+ } catch (ClassNotFoundException ignored) {
+ continue;
+ }
+ }
+ }
+ try {
Expand Down

0 comments on commit 09d3f74

Please sign in to comment.