mirror of
https://github.com/dmulloy2/ProtocolLib.git
synced 2024-11-24 03:25:29 +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.*;
|
||||||
import com.comphenix.protocol.reflect.cloning.AggregateCloner.BuilderParameters;
|
import com.comphenix.protocol.reflect.cloning.AggregateCloner.BuilderParameters;
|
||||||
import com.comphenix.protocol.reflect.fuzzy.FuzzyMethodContract;
|
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.MinecraftMethods;
|
||||||
import com.comphenix.protocol.utility.MinecraftReflection;
|
import com.comphenix.protocol.utility.MinecraftReflection;
|
||||||
import com.comphenix.protocol.utility.MinecraftVersion;
|
import com.comphenix.protocol.utility.MinecraftVersion;
|
||||||
@ -149,8 +150,14 @@ public class PacketContainer extends AbstractStructure implements Serializable {
|
|||||||
|
|
||||||
this.type = type;
|
this.type = type;
|
||||||
|
|
||||||
if (type == PacketType.Play.Server.CHAT) {
|
setDefaults();
|
||||||
getUUIDs().writeSafely(0, new UUID(0L, 0L));
|
}
|
||||||
|
|
||||||
|
private void setDefaults() {
|
||||||
|
if (MinecraftVersion.NETHER_UPDATE.atOrAbove() && type == PacketType.Play.Server.CHAT) {
|
||||||
|
if (!getUUIDs().optionRead(0).isPresent()) {
|
||||||
|
getUUIDs().writeSafely(0, MinecraftGenerator.SYS_UUID);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,9 +14,9 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||||||
|
|
||||||
public class MinecraftGenerator {
|
public class MinecraftGenerator {
|
||||||
// system unique id representation
|
// system unique id representation
|
||||||
private static final UUID SYS_UUID;
|
public static final UUID SYS_UUID;
|
||||||
// minecraft default types
|
// 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)
|
private static Object DEFAULT_ENTITY_TYPES; // modern servers only (older servers will use an entity type id)
|
||||||
// minecraft method accessors
|
// minecraft method accessors
|
||||||
private static final MethodAccessor NON_NULL_LIST_CREATE;
|
private static final MethodAccessor NON_NULL_LIST_CREATE;
|
||||||
|
Loading…
Reference in New Issue
Block a user