Class BlockEntityDataManager
java.lang.Object
net.xun.lib.common.internal.block.entity.BlockEntityDataManager
Central manager for block entity data operations.
This thread-safe class handles:
- Field scanning and reflection caching
- Coordinating
INbtAdapterusage - NBT read/write operations for
PersistentNbtfields
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidloadPersistedFields(net.minecraft.world.level.block.entity.BlockEntity be, net.minecraft.nbt.CompoundTag tag) Loads an object's state from NBT using annotated fields.static voidsavePersistedFields(net.minecraft.world.level.block.entity.BlockEntity be, net.minecraft.nbt.CompoundTag tag) Saves an object's state to NBT using annotated fields.static List<NbtFieldAccessor> scanFields(Class<?> clazz, Class<? extends Annotation> annotation)
-
Constructor Details
-
BlockEntityDataManager
public BlockEntityDataManager()
-
-
Method Details
-
savePersistedFields
public static void savePersistedFields(net.minecraft.world.level.block.entity.BlockEntity be, net.minecraft.nbt.CompoundTag tag) Saves an object's state to NBT using annotated fields.- Parameters:
be- The block entity that has the data to save.tag- Destination NBT compound tag
-
loadPersistedFields
public static void loadPersistedFields(net.minecraft.world.level.block.entity.BlockEntity be, net.minecraft.nbt.CompoundTag tag) Loads an object's state from NBT using annotated fields.- Parameters:
be- Block entity to populate with persisted datatag- Source NBT compound tag
-
scanFields
public static List<NbtFieldAccessor> scanFields(Class<?> clazz, Class<? extends Annotation> annotation)
-