Class BlockLootTableProvider
java.lang.Object
com.github.minecraftschurlimods.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.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA variant ofWithConditions.Builderthat has amapoperation and does no validation on whether there are actually conditions added to the builder.Nested classes/interfaces inherited from interface net.minecraft.data.DataProvider
net.minecraft.data.DataProvider.Factory<T extends net.minecraft.data.DataProvider> -
Field Summary
Fields inherited from interface net.minecraft.data.DataProvider
FIXED_ORDER_FIELDS, INDENT_WIDTH, KEY_COMPARATOR, LOGGER -
Constructor Summary
ConstructorsConstructorDescriptionBlockLootTableProvider(net.minecraft.data.PackOutput output, CompletableFuture<net.minecraft.core.HolderLookup.Provider> registries) -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(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.voidadd(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.getName()run(net.minecraft.data.CachedOutput output) static BlockLootTableProvider.WithConditionsBuilder<net.minecraft.world.level.storage.loot.LootTable.Builder> wrapLootTable(net.minecraft.world.level.storage.loot.LootTable.Builder table)
-
Constructor Details
-
BlockLootTableProvider
public BlockLootTableProvider(net.minecraft.data.PackOutput output, CompletableFuture<net.minecraft.core.HolderLookup.Provider> registries) - Parameters:
output- ThePackOutputto use.registries- TheHolderLookup.Providerto use.
-
-
Method Details
-
getName
- Specified by:
getNamein interfacenet.minecraft.data.DataProvider
-
run
- Specified by:
runin interfacenet.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.
-