Class BlockLootTableProvider

java.lang.Object
at.minecraftschurli.mods.bibliocraft.api.datagen.BlockLootTableProvider
All Implemented Interfaces:
net.minecraft.data.DataProvider

public abstract class BlockLootTableProvider extends Object implements net.minecraft.data.DataProvider
An adaptation of LootTableProvider and BlockLootSubProvider that is optimized to Bibliocraft's needs. Among other features, this class eliminates the sub provider abstraction layer and natively supports data load conditions. If you are an addon developer, you should rarely need to interact with this class outside of the two add() methods.
  • Constructor Details

    • BlockLootTableProvider

      public BlockLootTableProvider(net.minecraft.data.PackOutput output, CompletableFuture<net.minecraft.core.HolderLookup.Provider> registries)
      Parameters:
      output - The PackOutput to use.
      registries - The HolderLookup.Provider to use.
  • Method Details

    • getName

      public String getName()
      Specified by:
      getName in interface net.minecraft.data.DataProvider
    • run

      public CompletableFuture<?> run(net.minecraft.data.CachedOutput output)
      Specified by:
      run in interface net.minecraft.data.DataProvider
    • add

      public void add(net.minecraft.world.level.block.Block block, BlockLootTableProvider.WithConditionsBuilder<net.minecraft.world.level.storage.loot.LootTable.Builder> builder)
      Adds a loot table for a block.
      Parameters:
      block - The block to add the loot table for.
      builder - The builder from which to generate the loot table.
    • add

      public void add(net.minecraft.world.level.block.Block block, Function<net.minecraft.world.level.block.Block, BlockLootTableProvider.WithConditionsBuilder<net.minecraft.world.level.storage.loot.LootTable.Builder>> factory)
      Adds a loot table for a block.
      Parameters:
      block - The block to add the loot table for.
      factory - A function for the builder from which to generate the loot table.
    • wrapLootTable

      public static BlockLootTableProvider.WithConditionsBuilder<net.minecraft.world.level.storage.loot.LootTable.Builder> wrapLootTable(net.minecraft.world.level.storage.loot.LootTable.Builder table)
      Parameters:
      table - The loot table builder to wrap.
      Returns:
      The given loot table, wrapped as a BlockLootTableProvider.WithConditionsBuilder.