Fixed PacketPlayInPluginMessaging, as Channel was always returning null, this was because there was a String being declared in the instructer, but wasn't being passed to the entire class

This commit is contained in:
BuildTools 2022-04-27 23:08:29 -04:00
parent 8fa1b504f2
commit 34cba4659b
1 changed files with 3 additions and 3 deletions

View File

@ -19,12 +19,12 @@
package com.loohp.limbo.network.protocol.packets;
import com.loohp.limbo.utils.DataTypeIO;
import java.io.DataInputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import com.loohp.limbo.utils.DataTypeIO;
public class PacketPlayInPluginMessaging extends PacketIn {
private String channel;
@ -36,7 +36,7 @@ public class PacketPlayInPluginMessaging extends PacketIn {
}
public PacketPlayInPluginMessaging(DataInputStream in, int packetLength, int packetId) throws IOException {
String channel = DataTypeIO.readString(in, StandardCharsets.UTF_8);
channel = DataTypeIO.readString(in, StandardCharsets.UTF_8);
int dataLength = packetLength - DataTypeIO.getVarIntLength(packetId) - DataTypeIO.getStringLength(channel, StandardCharsets.UTF_8);
data = new byte[dataLength];
in.readFully(data);