fix: fix data type writing in GMLIB_BinaryStream class

This commit is contained in:
zimuya4153
2025-03-30 00:59:57 +08:00
Unverified
parent 477be1d2eb
commit 1693ac7290
+4 -4
View File
@@ -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");
}