Skip to content
This repository has been archived by the owner on Mar 8, 2024. It is now read-only.

Commit

Permalink
[Hotfix] Fix packet crash with Vat renderer (#363)
Browse files Browse the repository at this point in the history
Former-commit-id: 98959d79c282cf7d13abe939816b0c4ad9f33e41
  • Loading branch information
miozune authored Sep 26, 2023
1 parent 05f46d3 commit 3acc9f3
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,9 @@ public byte getPacketID() {

@Override
public void encode(ByteBuf aOut) {

byte r = (byte) ((this.integer >> 16 & 0xFF) + Byte.MIN_VALUE);
byte g = (byte) ((this.integer >> 8 & 0xFF) + Byte.MIN_VALUE);
byte b = (byte) ((this.integer & 0xFF) + Byte.MIN_VALUE);
byte r = (byte) (this.integer >> 16 & 0xFF);
byte g = (byte) (this.integer >> 8 & 0xFF);
byte b = (byte) (this.integer & 0xFF);
byte checksum = (byte) (this.coords.x % 25 + this.coords.y % 25
+ this.coords.z % 25
+ this.coords.wID % 25
Expand All @@ -65,8 +64,8 @@ public void encode(ByteBuf aOut) {
@Override
public GT_Packet_New decode(ByteArrayDataInput dataInput) {
this.coords = new Coords(dataInput.readInt(), dataInput.readShort(), dataInput.readInt(), dataInput.readInt());
this.integer = BW_ColorUtil.getColorFromRGBArray(
new int[] { dataInput.readUnsignedByte(), dataInput.readUnsignedByte(), dataInput.readUnsignedByte() });
this.integer = BW_ColorUtil
.getColorFromRGBArray(new int[] { dataInput.readByte(), dataInput.readByte(), dataInput.readByte() });
this.removal = dataInput.readByte();

byte checksum = (byte) (this.coords.x % 25 + this.coords.y % 25
Expand Down

0 comments on commit 3acc9f3

Please sign in to comment.