From 1693ac72902ddc0cea03f164523d823d0d3da60a Mon Sep 17 00:00:00 2001 From: zimuya4153 Date: Sun, 30 Mar 2025 00:59:57 +0800 Subject: [PATCH] fix: fix data type writing in GMLIB_BinaryStream class --- lib/GMLIB_API-JS.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/GMLIB_API-JS.js b/lib/GMLIB_API-JS.js index e3cce3d..cd48ed4 100644 --- a/lib/GMLIB_API-JS.js +++ b/lib/GMLIB_API-JS.js @@ -2291,14 +2291,14 @@ class GMLIB_BinaryStream { this.writeUnsignedVarInt(data.id); this.writeUnsignedVarInt(data.type); switch (data.type) { - case 0: this.writeByte(data.value); break; - case 1: this.writeSignedShort(data.value); break; - case 2: this.writeSignedInt(data.value); break; + case 0: this.writeUnsignedChar(data.value); break; + case 1: this.writeUnsignedShort(data.value); break; + case 2: this.writeVarInt(data.value); break; case 3: this.writeFloat(data.value); break; case 4: this.writeString(data.value); break; case 5: this.writeCompoundTag(data.value); break; case 6: this.writeBlockPos(data.value); break; - case 7: this.writeSignedInt64(data.value); break; + case 7: this.writeVarInt64(data.value); break; case 8: this.writeVec3(data.value); break; default: throw new Error("Unknown data type"); }