diff --git a/src/generated/resources/data/hybrid-aquatic/loot_tables/blocks/hydrothermal_vent.json b/src/generated/resources/data/hybrid-aquatic/loot_tables/blocks/hydrothermal_vent.json index 9383f5a5a..2cdc1dc3c 100644 --- a/src/generated/resources/data/hybrid-aquatic/loot_tables/blocks/hydrothermal_vent.json +++ b/src/generated/resources/data/hybrid-aquatic/loot_tables/blocks/hydrothermal_vent.json @@ -7,18 +7,6 @@ { "type": "minecraft:alternatives", "children": [ - { - "type": "minecraft:loot_table", - "conditions": [ - { - "condition": "minecraft:match_tool", - "predicate": { - "tag": "minecraft:pickaxes" - } - } - ], - "name": "hybrid-aquatic:gameplay/hydrothermal_vent_treasure" - }, { "type": "minecraft:item", "conditions": [ @@ -37,6 +25,10 @@ } ], "name": "hybrid-aquatic:hydrothermal_vent" + }, + { + "type": "minecraft:loot_table", + "name": "hybrid-aquatic:gameplay/hydrothermal_vent_treasure" } ] } diff --git a/src/generated/resources/data/hybrid-aquatic/loot_tables/blocks/tube_sponge.json b/src/generated/resources/data/hybrid-aquatic/loot_tables/blocks/tube_sponge.json index 3a246dd1e..0511a9aed 100644 --- a/src/generated/resources/data/hybrid-aquatic/loot_tables/blocks/tube_sponge.json +++ b/src/generated/resources/data/hybrid-aquatic/loot_tables/blocks/tube_sponge.json @@ -7,41 +7,6 @@ { "type": "minecraft:alternatives", "children": [ - { - "type": "minecraft:loot_table", - "conditions": [ - { - "condition": "minecraft:inverted", - "term": { - "condition": "minecraft:any_of", - "terms": [ - { - "condition": "minecraft:match_tool", - "predicate": { - "items": [ - "minecraft:shears" - ] - } - }, - { - "condition": "minecraft:match_tool", - "predicate": { - "enchantments": [ - { - "enchantment": "minecraft:silk_touch", - "levels": { - "min": 1 - } - } - ] - } - } - ] - } - } - ], - "name": "hybrid-aquatic:gameplay/tube_sponge_drops" - }, { "type": "minecraft:item", "conditions": [ @@ -60,6 +25,10 @@ } ], "name": "hybrid-aquatic:tube_sponge" + }, + { + "type": "minecraft:loot_table", + "name": "hybrid-aquatic:gameplay/tube_sponge_drops" } ] } diff --git a/src/main/kotlin/dev/hybridlabs/aquatic/data/server/loot/BlockLootTableProvider.kt b/src/main/kotlin/dev/hybridlabs/aquatic/data/server/loot/BlockLootTableProvider.kt index 430ae9587..7c74ae69b 100644 --- a/src/main/kotlin/dev/hybridlabs/aquatic/data/server/loot/BlockLootTableProvider.kt +++ b/src/main/kotlin/dev/hybridlabs/aquatic/data/server/loot/BlockLootTableProvider.kt @@ -26,12 +26,11 @@ class BlockLootTableProvider(output: FabricDataOutput) : FabricBlockLootTablePro override fun generate() { // anemone addDrop(HybridAquaticBlocks.ANEMONE) { block -> - LootTable.builder() - .pool( - LootPool.builder() - .with(ItemEntry.builder(block)) - .conditionally(WITH_SILK_TOUCH_OR_SHEARS) - ) + LootTable.builder().pool( + LootPool.builder() + .with(ItemEntry.builder(block)) + .conditionally(WITH_SILK_TOUCH_OR_SHEARS) + ) } // living sponge @@ -39,14 +38,11 @@ class BlockLootTableProvider(output: FabricDataOutput) : FabricBlockLootTablePro LootTable.builder().pool( LootPool.builder().with( AlternativeEntry.builder( + ItemEntry.builder(block).conditionally(WITH_SILK_TOUCH), LootTableEntry.builder(HybridAquaticLootTables.TUBE_SPONGE_LOOT_ID) - .conditionally( - WITHOUT_SILK_TOUCH_NOR_SHEARS) - , - ItemEntry.builder(block) - .conditionally(WITH_SILK_TOUCH), ) - )) + ) + ) } // hydrothermal vent @@ -54,39 +50,29 @@ class BlockLootTableProvider(output: FabricDataOutput) : FabricBlockLootTablePro LootTable.builder().pool( LootPool.builder().with( AlternativeEntry.builder( + ItemEntry.builder(block).conditionally(WITH_SILK_TOUCH), LootTableEntry.builder(HybridAquaticLootTables.HYDROTHERMAL_VENT_LOOT_ID) - .conditionally( - MatchToolLootCondition.builder( - ItemPredicate.Builder.create() - .tag(ItemTags.PICKAXES) - ) - ), - ItemEntry.builder(block) - .conditionally(WITH_SILK_TOUCH), ) - )) + ) + ) } // message in a bottle addDrop(HybridAquaticBlocks.MESSAGE_IN_A_BOTTLE) { block -> - LootTable.builder() - .pool( - LootPool.builder() - .with( + LootTable.builder().pool( + LootPool.builder().with( AlternativeEntry.builder( - ItemEntry.builder(block).conditionally(WITH_SILK_TOUCH) - .apply( - CopyNbtLootFunction.builder(ContextLootNbtProvider.BLOCK_ENTITY) - .withOperation(VARIANT_KEY, "$BLOCK_ENTITY_TAG_KEY.$VARIANT_KEY") - .withOperation(MESSAGE_KEY, "$BLOCK_ENTITY_TAG_KEY.$MESSAGE_KEY") - ), - ItemEntry.builder(Items.WRITTEN_BOOK) - .apply( - CopyNbtLootFunction.builder(ContextLootNbtProvider.BLOCK_ENTITY) - .withOperation("$MESSAGE_KEY.tag.$PAGES_KEY", PAGES_KEY) - .withOperation("$MESSAGE_KEY.tag.$TITLE_KEY", TITLE_KEY) - .withOperation("$MESSAGE_KEY.tag.$AUTHOR_KEY", AUTHOR_KEY) - ) + ItemEntry.builder(block).conditionally(WITH_SILK_TOUCH).apply( + CopyNbtLootFunction.builder(ContextLootNbtProvider.BLOCK_ENTITY) + .withOperation(VARIANT_KEY, "$BLOCK_ENTITY_TAG_KEY.$VARIANT_KEY") + .withOperation(MESSAGE_KEY, "$BLOCK_ENTITY_TAG_KEY.$MESSAGE_KEY") + ), + ItemEntry.builder(Items.WRITTEN_BOOK).apply( + CopyNbtLootFunction.builder(ContextLootNbtProvider.BLOCK_ENTITY) + .withOperation("$MESSAGE_KEY.tag.$PAGES_KEY", PAGES_KEY) + .withOperation("$MESSAGE_KEY.tag.$TITLE_KEY", TITLE_KEY) + .withOperation("$MESSAGE_KEY.tag.$AUTHOR_KEY", AUTHOR_KEY) + ) ) ) ) @@ -97,16 +83,13 @@ class BlockLootTableProvider(output: FabricDataOutput) : FabricBlockLootTablePro LootTable.builder().pool( LootPool.builder().with( AlternativeEntry.builder( - LootTableEntry.builder(HybridAquaticLootTables.CRATE_TREASURE_ID) - .conditionally( - MatchToolLootCondition.builder( - ItemPredicate.Builder.create() - .tag(ItemTags.AXES) - ) - ), + LootTableEntry.builder(HybridAquaticLootTables.CRATE_TREASURE_ID).conditionally( + MatchToolLootCondition.builder(ItemPredicate.Builder.create().tag(ItemTags.AXES)) + ), ItemEntry.builder(block), ) - )) + ) + ) } // generate remaining drops