Skip to content

Commit 19ec022

Browse files
committed
Add methods for reading/writing longs and doubles to PacketSerializer
1 parent da7897c commit 19ec022

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/main/java/net/hypixel/modapi/serializer/PacketSerializer.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,24 @@ public PacketSerializer writeVarInt(int value) {
5858
return this;
5959
}
6060

61+
public long readLong() {
62+
return this.buf.readLong();
63+
}
64+
65+
public PacketSerializer writeLong(long value) {
66+
this.buf.writeLong(value);
67+
return this;
68+
}
69+
70+
public double readDouble() {
71+
return this.buf.readDouble();
72+
}
73+
74+
public PacketSerializer writeDouble(double value) {
75+
this.buf.writeDouble(value);
76+
return this;
77+
}
78+
6179
public String readString() {
6280
return this.readString(MAX_STRING_LENGTH);
6381
}

0 commit comments

Comments
 (0)