Skip to content

Commit fbeffb1

Browse files
authored
Fix ServerOpenContainer serialisation
`ContainerManager` presumes these fields are being set
1 parent c0dc061 commit fbeffb1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

loader/src/main/java/com/fox2code/foxloader/loader/packet/ServerOpenContainer.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,14 @@ public ServerOpenContainer(String containerID, int windowID, int x, int y, int z
6262
@Override
6363
public void readData(DataInputStream dataInputStream) throws IOException {
6464
this.containerID = Packet.readString(dataInputStream, 128);
65+
this.windowID = dataInputStream.readInt();
6566
if (dataInputStream.readBoolean()) {
6667
this.x = dataInputStream.readInt();
6768
this.y = dataInputStream.readInt();
6869
this.z = dataInputStream.readInt();
70+
this.block = true;
6971
} else {
72+
this.block = false;
7073
this.x = 0;
7174
this.y = 0;
7275
this.z = 0;
@@ -76,6 +79,7 @@ public void readData(DataInputStream dataInputStream) throws IOException {
7679
@Override
7780
public void writeData(DataOutputStream dataOutputStream) throws IOException {
7881
Packet.writeString(this.containerID, dataOutputStream);
82+
dataOutputStream.writeInt(this.windowID);
7983
if (this.block) {
8084
dataOutputStream.writeBoolean(true);
8185
dataOutputStream.writeInt(this.x);

0 commit comments

Comments
 (0)