Skip to content

Commit

Permalink
Fix bytebuf api, fix LeavesMC#334 (LeavesMC#335)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lumine1909 authored Sep 8, 2024
1 parent 9338453 commit 3436062
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
7 changes: 5 additions & 2 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..89c45a056716d0644fe1b41d49a4bdcede53c795
index 0000000000000000000000000000000000000000..4f8ea5c78df6429358dbbc75042521b657d50d3c
--- /dev/null
+++ b/src/main/java/org/leavesmc/leaves/bytebuf/packet/PacketType.java
@@ -0,0 +1,182 @@
@@ -0,0 +1,185 @@
+package org.leavesmc.leaves.bytebuf.packet;
+
+public enum PacketType {
Expand Down Expand Up @@ -381,10 +381,13 @@ index 0000000000000000000000000000000000000000..89c45a056716d0644fe1b41d49a4bdce
+ ClientboundTickingState,
+ ClientboundTickingStep,
+ ClientboundCustomPayload,
+ ClientboundCustomDetails,
+ ClientboundDisconnect,
+ ClientboundKeepAlive,
+ ClientboundPing,
+ ClientboundResourcePackPop,
+ ClientboundResourcePackPush,
+ ClientboundServerLinks,
+ ClientboundStoreCookie,
+ ClientboundTransfer,
+ ClientboundUpdateTags,
Expand Down
6 changes: 3 additions & 3 deletions patches/server/0123-Bytebuf-API.patch
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ 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..2c446d1657834324f015b1637221164ff61f04e1
index 0000000000000000000000000000000000000000..fb7625ce28d2d8c79aad680ff34d704ca8f9b426
--- /dev/null
+++ b/src/main/java/org/leavesmc/leaves/bytebuf/internal/InternalBytebufHandler.java
@@ -0,0 +1,225 @@
Expand Down Expand Up @@ -602,8 +602,8 @@ index 0000000000000000000000000000000000000000..2c446d1657834324f015b1637221164f
+ }
+ try {
+ return PacketType.valueOf(builder.toString());
+ } catch (IllegalArgumentException ignored) {
+ return null;
+ } catch (IllegalArgumentException e) {
+ throw new RuntimeException(e);
+ }
+ });
+ } catch (ExecutionException ignore) {
Expand Down

0 comments on commit 3436062

Please sign in to comment.