public class EntityDataManager
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
EntityDataManager.DataEntry<T> |
Modifier and Type | Field and Description |
---|---|
private boolean |
dirty |
private boolean |
empty |
private Entity |
entity |
private java.util.Map<java.lang.Integer,EntityDataManager.DataEntry<?>> |
entries |
private java.util.concurrent.locks.ReadWriteLock |
lock |
private static org.apache.logging.log4j.Logger |
LOGGER |
private static java.util.Map<java.lang.Class<? extends Entity>,java.lang.Integer> |
NEXT_ID_MAP |
Constructor and Description |
---|
EntityDataManager(Entity entityIn) |
private static final org.apache.logging.log4j.Logger LOGGER
private static final java.util.Map<java.lang.Class<? extends Entity>,java.lang.Integer> NEXT_ID_MAP
private final Entity entity
private final java.util.Map<java.lang.Integer,EntityDataManager.DataEntry<?>> entries
private final java.util.concurrent.locks.ReadWriteLock lock
private boolean empty
private boolean dirty
public EntityDataManager(Entity entityIn)
public static <T> DataParameter<T> createKey(java.lang.Class<? extends Entity> clazz, IDataSerializer<T> serializer)
public <T> void register(DataParameter<T> key, T value)
private <T> void setEntry(DataParameter<T> key, T value)
private <T> EntityDataManager.DataEntry<T> getEntry(DataParameter<T> key)
public <T> T get(DataParameter<T> key)
public <T> void set(DataParameter<T> key, T value)
public boolean isDirty()
public static void writeEntries(java.util.List<EntityDataManager.DataEntry<?>> entriesIn, PacketBuffer buf) throws java.io.IOException
java.io.IOException
@Nullable public java.util.List<EntityDataManager.DataEntry<?>> getDirty()
@Nullable public java.util.List<EntityDataManager.DataEntry<?>> getAll()
private static <T> void writeEntry(PacketBuffer buf, EntityDataManager.DataEntry<T> entry) throws java.io.IOException
java.io.IOException
@Nullable public static java.util.List<EntityDataManager.DataEntry<?>> readEntries(PacketBuffer buf) throws java.io.IOException
java.io.IOException
private static <T> EntityDataManager.DataEntry<T> makeDataEntry(PacketBuffer bufferIn, int idIn, IDataSerializer<T> serializerIn)
public void setEntryValues(java.util.List<EntityDataManager.DataEntry<?>> entriesIn)
private <T> void setEntryValue(EntityDataManager.DataEntry<T> target, EntityDataManager.DataEntry<?> source)
public boolean isEmpty()
public void setClean()