Class DatapackBuiltinEntriesProvider

java.lang.Object
net.minecraft.data.registries.RegistriesDatapackGenerator
net.minecraftforge.common.data.DatapackBuiltinEntriesProvider
All Implemented Interfaces:
DataProvider

public class DatapackBuiltinEntriesProvider extends RegistriesDatapackGenerator
An extension of the RegistriesDatapackGenerator which properly handles referencing existing dynamic registry objects within another dynamic registry object.
  • Field Details

  • Constructor Details

    • DatapackBuiltinEntriesProvider

      public DatapackBuiltinEntriesProvider(PackOutput output, CompletableFuture<RegistrySetBuilder.PatchedRegistries> registries, Set<String> modIds)
      Constructs a new datapack provider which generates all registry objects from the provided mods using the holder.
      Parameters:
      output - the target directory of the data generator
      registries - a future of patched registries
      modIds - a set of mod ids to generate the dynamic registry objects of
    • DatapackBuiltinEntriesProvider

      public DatapackBuiltinEntriesProvider(PackOutput output, CompletableFuture<HolderLookup.Provider> registries, RegistrySetBuilder registryBuilder, Set<String> modIds)
      Constructs a new datapack provider which generates all registry objects from the provided mods using the holder. All entries that need to be bootstrapped are provided within the RegistrySetBuilder.
      Parameters:
      output - the target directory of the data generator
      registries - a future of a lookup for registries and their objects
      registryBuilder - a builder containing the dynamic registry objects added by this provider
      modIds - a set of mod ids to generate the dynamic registry objects of
  • Method Details

    • getFullRegistries

      public CompletableFuture<HolderLookup.Provider> getFullRegistries()
      Gets the future of the full registry lookup containing all added elements.
      The returned full registry lookup can also be used for other data providers.
      
       var provider = new DatapackBuiltinEntriesProvider(generator.getPackOutput(), event.getLookupProvider(), new RegistrySetBuilder(), Set.of("example_mod"));
       
      An example use case is the TagsProvider.
      Returns:
      the future of the full registry lookup