Don't use PacketBuffer#readString since it's client-only. (#4489)
Fixes #4488
This commit is contained in:
@@ -32,6 +32,15 @@ import appeng.core.sync.network.INetworkInfo;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
|
||||
public abstract class BasePacket {
|
||||
|
||||
/**
|
||||
* Sadly {@link PacketBuffer#readString()} gets inlined by Proguard which means
|
||||
* it's not available on the Server. This field has the default string length
|
||||
* that is used for writeString, which then also should be used for readString
|
||||
* when it has no special length requirements.
|
||||
*/
|
||||
public static final int MAX_STRING_LENGTH = 32767;
|
||||
|
||||
private PacketBuffer p;
|
||||
|
||||
public void serverPacketData(final INetworkInfo manager, final PlayerEntity player) {
|
||||
|
||||
@@ -57,8 +57,8 @@ public class ConfigValuePacket extends BasePacket {
|
||||
private final String Value;
|
||||
|
||||
public ConfigValuePacket(final PacketBuffer stream) {
|
||||
this.Name = stream.readString();
|
||||
this.Value = stream.readString();
|
||||
this.Name = stream.readString(MAX_STRING_LENGTH);
|
||||
this.Value = stream.readString(MAX_STRING_LENGTH);
|
||||
}
|
||||
|
||||
// api
|
||||
|
||||
Reference in New Issue
Block a user