Class DataSync<A,B>

java.lang.Object
com.pixelmonmod.pixelmon.api.data.DataSync<A,B>
Type Parameters:
A - The sender type
B - The data type

public class DataSync<A,B> extends Object
Wrapper class used for optimizing data from EntityDataAccessor as cache's are faster (no concurrency checks/locking)
  • Constructor Details

    • DataSync

      public DataSync(Class<? extends net.minecraft.world.entity.Entity> entityClass, net.minecraft.network.syncher.EntityDataSerializer<B> serializer, BiConsumer<A,B> fieldSetter)
    • DataSync

      public DataSync(Class<? extends net.minecraft.world.entity.Entity> entityClass, net.minecraft.network.syncher.EntityDataAccessor<B> dataParameter, BiConsumer<A,B> fieldSetter)
    • DataSync

      public DataSync(Class<? extends net.minecraft.world.entity.Entity> entityClass, net.minecraft.network.syncher.EntityDataSerializer<B> serializer, BiConsumer<A,B> fieldSetter, BiConsumer<Pokemon,B> fieldSetterPokemon)
    • DataSync

      public DataSync(Class<? extends net.minecraft.world.entity.Entity> entityClass, net.minecraft.network.syncher.EntityDataAccessor<B> dataParameter, BiConsumer<A,B> fieldSetter, BiConsumer<Pokemon,B> fieldSetterPokemon)
  • Method Details

    • getParameterId

      public int getParameterId()
    • getEntityDataAccessor

      public net.minecraft.network.syncher.EntityDataAccessor<B> getEntityDataAccessor()
    • onSyncedDataUpdated

      public void onSyncedDataUpdated(net.minecraft.network.syncher.EntityDataAccessor<?> key, net.minecraft.world.entity.Entity sender)
    • set

      public void set(net.minecraft.world.entity.Entity sender, Object data)
    • set

      public void set(Pokemon sender, Object data)