Class CustomRecipeAndLootTableProvider

java.lang.Object
com.minecolonies.core.generation.CustomRecipeAndLootTableProvider
All Implemented Interfaces:
net.minecraft.data.DataProvider
Direct Known Subclasses:
DefaultEnchanterCraftingProvider, DefaultNetherWorkerLootProvider, DefaultSifterCraftingProvider

public abstract class CustomRecipeAndLootTableProvider extends Object implements net.minecraft.data.DataProvider
Abstract datagen for crafterrecipes that include loot tables.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface net.minecraft.data.DataProvider

    net.minecraft.data.DataProvider.Factory<T extends net.minecraft.data.DataProvider>
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected net.minecraft.core.HolderLookup.Provider
     

    Fields inherited from interface net.minecraft.data.DataProvider

    FIXED_ORDER_FIELDS, KEY_COMPARATOR, LOGGER
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    CustomRecipeAndLootTableProvider(@NotNull net.minecraft.data.PackOutput packOutput, @NotNull CompletableFuture<net.minecraft.core.HolderLookup.Provider> providerFuture)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected CompletableFuture<?>
    generate(net.minecraft.core.HolderLookup.Provider provider)
    Override this if you need to do some additional async work prior to calling the registration functions.
    recipe(String crafter, String module, String id)
     
    protected abstract void
     
    protected abstract @NotNull List<net.minecraft.data.loot.LootTableProvider.SubProviderEntry>
     
    @NotNull CompletableFuture<?>
    run(@NotNull net.minecraft.data.CachedOutput cache)
     
    protected static net.minecraft.resources.ResourceKey<net.minecraft.world.level.storage.loot.LootTable>
    table(@NotNull net.minecraft.resources.ResourceLocation id)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface net.minecraft.data.DataProvider

    getName
  • Field Details

    • provider

      protected net.minecraft.core.HolderLookup.Provider provider
  • Constructor Details

    • CustomRecipeAndLootTableProvider

      protected CustomRecipeAndLootTableProvider(@NotNull @NotNull net.minecraft.data.PackOutput packOutput, @NotNull @NotNull CompletableFuture<net.minecraft.core.HolderLookup.Provider> providerFuture)
  • Method Details

    • generate

      protected CompletableFuture<?> generate(@NotNull net.minecraft.core.HolderLookup.Provider provider)
      Override this if you need to do some additional async work prior to calling the registration functions.
      Parameters:
      provider - the registry provider
      Returns:
      a future
    • registerRecipes

      protected abstract void registerRecipes(@NotNull @NotNull Consumer<CustomRecipeProvider.CustomRecipeBuilder> consumer)
    • registerTables

      @NotNull protected abstract @NotNull List<net.minecraft.data.loot.LootTableProvider.SubProviderEntry> registerTables()
    • recipe

      protected CustomRecipeProvider.CustomRecipeBuilder recipe(String crafter, String module, String id)
    • table

      protected static net.minecraft.resources.ResourceKey<net.minecraft.world.level.storage.loot.LootTable> table(@NotNull @NotNull net.minecraft.resources.ResourceLocation id)
    • run

      @NotNull public @NotNull CompletableFuture<?> run(@NotNull @NotNull net.minecraft.data.CachedOutput cache)
      Specified by:
      run in interface net.minecraft.data.DataProvider