Class RegistrySnapshot

java.lang.Object
net.neoforged.neoforge.registries.RegistrySnapshot

public class RegistrySnapshot extends Object
  • Field Details

  • Constructor Details

    • RegistrySnapshot

      private RegistrySnapshot()
      Creates a blank snapshot to populate.
    • RegistrySnapshot

      public RegistrySnapshot(Registry<T> registry, boolean full)
      Creates a registry snapshot based on the given registry.
      Type Parameters:
      T - the registry type
      Parameters:
      registry - the registry to snapshot.
      full - if true, all entries will be stored in this snapshot. These entries are never saved to disk nor sent to the client.
    • RegistrySnapshot

      public RegistrySnapshot(FriendlyByteBuf buf)
      Creates a registry snapshot from the received buffer.
      Parameters:
      buf - the buffer containing the data of the received snapshot.
  • Method Details

    • write

      public void write(FriendlyByteBuf buf)
      Write the registry snapshot to the given buffer and cache the binary data.
      Parameters:
      buf - the buffer to write to.
    • getIds

      public it.unimi.dsi.fastutil.ints.Int2ObjectSortedMap<ResourceLocation> getIds()
    • getAliases

      public Map<ResourceLocation,ResourceLocation> getAliases()
    • getFullBackup

      @Nullable public <T> Registry<T> getFullBackup()