Class BlockEntityDataManager

java.lang.Object
net.xun.lib.common.internal.block.entity.BlockEntityDataManager

@Internal public class BlockEntityDataManager extends Object
Central manager for block entity data operations.

This thread-safe class handles:

  • Field scanning and reflection caching
  • Coordinating INbtAdapter usage
  • NBT read/write operations for PersistentNbt fields
  • 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 data
      tag - Source NBT compound tag
    • scanFields

      public static List<NbtFieldAccessor> scanFields(Class<?> clazz, Class<? extends Annotation> annotation)