fix: fix data type writing in GMLIB_BinaryStream class
This commit is contained in:
+4
-4
@@ -2291,14 +2291,14 @@ class GMLIB_BinaryStream {
|
|||||||
this.writeUnsignedVarInt(data.id);
|
this.writeUnsignedVarInt(data.id);
|
||||||
this.writeUnsignedVarInt(data.type);
|
this.writeUnsignedVarInt(data.type);
|
||||||
switch (data.type) {
|
switch (data.type) {
|
||||||
case 0: this.writeByte(data.value); break;
|
case 0: this.writeUnsignedChar(data.value); break;
|
||||||
case 1: this.writeSignedShort(data.value); break;
|
case 1: this.writeUnsignedShort(data.value); break;
|
||||||
case 2: this.writeSignedInt(data.value); break;
|
case 2: this.writeVarInt(data.value); break;
|
||||||
case 3: this.writeFloat(data.value); break;
|
case 3: this.writeFloat(data.value); break;
|
||||||
case 4: this.writeString(data.value); break;
|
case 4: this.writeString(data.value); break;
|
||||||
case 5: this.writeCompoundTag(data.value); break;
|
case 5: this.writeCompoundTag(data.value); break;
|
||||||
case 6: this.writeBlockPos(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;
|
case 8: this.writeVec3(data.value); break;
|
||||||
default: throw new Error("Unknown data type");
|
default: throw new Error("Unknown data type");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user