mirror of
https://github.com/dmulloy2/ProtocolLib.git
synced 2024-11-23 19:16:14 +01:00
parent
153dd61994
commit
95a884974a
@ -43,6 +43,7 @@ import com.comphenix.protocol.reflect.*;
|
||||
import com.comphenix.protocol.reflect.cloning.*;
|
||||
import com.comphenix.protocol.reflect.cloning.AggregateCloner.BuilderParameters;
|
||||
import com.comphenix.protocol.reflect.fuzzy.FuzzyMethodContract;
|
||||
import com.comphenix.protocol.reflect.instances.MinecraftGenerator;
|
||||
import com.comphenix.protocol.utility.MinecraftMethods;
|
||||
import com.comphenix.protocol.utility.MinecraftReflection;
|
||||
import com.comphenix.protocol.utility.MinecraftVersion;
|
||||
@ -149,11 +150,17 @@ public class PacketContainer extends AbstractStructure implements Serializable {
|
||||
|
||||
this.type = type;
|
||||
|
||||
if (type == PacketType.Play.Server.CHAT) {
|
||||
getUUIDs().writeSafely(0, new UUID(0L, 0L));
|
||||
setDefaults();
|
||||
}
|
||||
|
||||
private void setDefaults() {
|
||||
if (MinecraftVersion.NETHER_UPDATE.atOrAbove() && type == PacketType.Play.Server.CHAT) {
|
||||
if (!getUUIDs().optionRead(0).isPresent()) {
|
||||
getUUIDs().writeSafely(0, MinecraftGenerator.SYS_UUID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Construct a new packet container from a given handle.
|
||||
* @param packet - the NMS packet.
|
||||
|
@ -14,9 +14,9 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
public class MinecraftGenerator {
|
||||
// system unique id representation
|
||||
private static final UUID SYS_UUID;
|
||||
public static final UUID SYS_UUID;
|
||||
// minecraft default types
|
||||
private static final Object AIR_ITEM_STACK;
|
||||
public static final Object AIR_ITEM_STACK;
|
||||
private static Object DEFAULT_ENTITY_TYPES; // modern servers only (older servers will use an entity type id)
|
||||
// minecraft method accessors
|
||||
private static final MethodAccessor NON_NULL_LIST_CREATE;
|
||||
|
Loading…
Reference in New Issue
Block a user