Package net.minecraft.network.datasync
Class EntityDataManager
- java.lang.Object
-
- net.minecraft.network.datasync.EntityDataManager
-
public class EntityDataManager extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
EntityDataManager.DataEntry<T>
-
Field Summary
Fields Modifier and Type Field Description private Entity
entity
private static java.util.Map<java.lang.Class<? extends Entity>,java.lang.Integer>
ENTITY_ID_POOL
private boolean
isDirty
private boolean
isEmpty
private java.util.Map<java.lang.Integer,EntityDataManager.DataEntry<?>>
itemsById
private java.util.concurrent.locks.ReadWriteLock
lock
private static org.apache.logging.log4j.Logger
LOGGER
-
Constructor Summary
Constructors Constructor Description EntityDataManager(Entity p_i46840_1_)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private <T> void
assignValue(EntityDataManager.DataEntry<T> p_187224_1_, EntityDataManager.DataEntry<?> p_187224_2_)
void
assignValues(java.util.List<EntityDataManager.DataEntry<?>> p_187218_1_)
void
clearDirty()
private <T> void
createDataItem(DataParameter<T> p_187222_1_, T p_187222_2_)
<T> void
define(DataParameter<T> p_187214_1_, T p_187214_2_)
static <T> DataParameter<T>
defineId(java.lang.Class<? extends Entity> p_187226_0_, IDataSerializer<T> p_187226_1_)
private static <T> EntityDataManager.DataEntry<T>
genericHelper(PacketBuffer p_198167_0_, int p_198167_1_, IDataSerializer<T> p_198167_2_)
<T> T
get(DataParameter<T> p_187225_1_)
java.util.List<EntityDataManager.DataEntry<?>>
getAll()
private <T> EntityDataManager.DataEntry<T>
getItem(DataParameter<T> p_187219_1_)
boolean
isDirty()
boolean
isEmpty()
static void
pack(java.util.List<EntityDataManager.DataEntry<?>> p_187229_0_, PacketBuffer p_187229_1_)
java.util.List<EntityDataManager.DataEntry<?>>
packDirty()
<T> void
set(DataParameter<T> p_187227_1_, T p_187227_2_)
static java.util.List<EntityDataManager.DataEntry<?>>
unpack(PacketBuffer p_187215_0_)
private static <T> void
writeDataItem(PacketBuffer p_187220_0_, EntityDataManager.DataEntry<T> p_187220_1_)
-
-
-
Field Detail
-
LOGGER
private static final org.apache.logging.log4j.Logger LOGGER
-
ENTITY_ID_POOL
private static final java.util.Map<java.lang.Class<? extends Entity>,java.lang.Integer> ENTITY_ID_POOL
-
entity
private final Entity entity
-
itemsById
private final java.util.Map<java.lang.Integer,EntityDataManager.DataEntry<?>> itemsById
-
lock
private final java.util.concurrent.locks.ReadWriteLock lock
-
isEmpty
private boolean isEmpty
-
isDirty
private boolean isDirty
-
-
Constructor Detail
-
EntityDataManager
public EntityDataManager(Entity p_i46840_1_)
-
-
Method Detail
-
defineId
public static <T> DataParameter<T> defineId(java.lang.Class<? extends Entity> p_187226_0_, IDataSerializer<T> p_187226_1_)
-
define
public <T> void define(DataParameter<T> p_187214_1_, T p_187214_2_)
-
createDataItem
private <T> void createDataItem(DataParameter<T> p_187222_1_, T p_187222_2_)
-
getItem
private <T> EntityDataManager.DataEntry<T> getItem(DataParameter<T> p_187219_1_)
-
get
public <T> T get(DataParameter<T> p_187225_1_)
-
set
public <T> void set(DataParameter<T> p_187227_1_, T p_187227_2_)
-
isDirty
public boolean isDirty()
-
pack
public static void pack(java.util.List<EntityDataManager.DataEntry<?>> p_187229_0_, PacketBuffer p_187229_1_) throws java.io.IOException
- Throws:
java.io.IOException
-
packDirty
@Nullable public java.util.List<EntityDataManager.DataEntry<?>> packDirty()
-
getAll
@Nullable public java.util.List<EntityDataManager.DataEntry<?>> getAll()
-
writeDataItem
private static <T> void writeDataItem(PacketBuffer p_187220_0_, EntityDataManager.DataEntry<T> p_187220_1_) throws java.io.IOException
- Throws:
java.io.IOException
-
unpack
@Nullable public static java.util.List<EntityDataManager.DataEntry<?>> unpack(PacketBuffer p_187215_0_) throws java.io.IOException
- Throws:
java.io.IOException
-
genericHelper
private static <T> EntityDataManager.DataEntry<T> genericHelper(PacketBuffer p_198167_0_, int p_198167_1_, IDataSerializer<T> p_198167_2_)
-
assignValues
public void assignValues(java.util.List<EntityDataManager.DataEntry<?>> p_187218_1_)
-
assignValue
private <T> void assignValue(EntityDataManager.DataEntry<T> p_187224_1_, EntityDataManager.DataEntry<?> p_187224_2_)
-
isEmpty
public boolean isEmpty()
-
clearDirty
public void clearDirty()
-
-