Fabric API

Fabric API

106M Downloads

Resource conditions can't be used for block loot table datagen

MattiDragon opened this issue ยท 0 comments

commented

The FabricLootTableProvider has a withConditions method that can be used with SimpleFabricLootTableProviders to create a BiConsumer that applies the condition, but for FabricBlockLootTableProvider that is unreasonable as the base class implements accept to run the generateBlockLootTables method in which is used to generate the loot tables. Thus the only way to apply a condition to block loot tables is by overriding accept and calling super with a modified BiConsumer, but that applies to all loot tables and doesn't play nicely with strict validation (if split into multiple providers).

Looking at the test mod for datagen the block loot table provider doesn't use any conditions (because it resonably can't) while the barter loot provider does.