From e1f17c06ed82d13f813061e72d09b216fea22877 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sat, 2 May 2020 03:03:17 +0200 Subject: [PATCH] stopped the ancient tree from dropping saplings --- .../loot_tables/blocks/ancient_leaves.json | 113 ++---------------- .../naturesaura/data/BlockLootProvider.java | 2 +- .../recipes/tree_ritual/ancient_sapling.json | 3 +- 3 files changed, 10 insertions(+), 108 deletions(-) diff --git a/src/generated/resources/data/naturesaura/loot_tables/blocks/ancient_leaves.json b/src/generated/resources/data/naturesaura/loot_tables/blocks/ancient_leaves.json index c7c0640d..701982c4 100644 --- a/src/generated/resources/data/naturesaura/loot_tables/blocks/ancient_leaves.json +++ b/src/generated/resources/data/naturesaura/loot_tables/blocks/ancient_leaves.json @@ -1,122 +1,23 @@ { "type": "minecraft:block", "pools": [ - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:alternatives", - "children": [ - { - "type": "minecraft:item", - "conditions": [ - { - "condition": "minecraft:alternative", - "terms": [ - { - "condition": "minecraft:match_tool", - "predicate": { - "item": "minecraft:shears" - } - }, - { - "condition": "minecraft:match_tool", - "predicate": { - "enchantments": [ - { - "enchantment": "minecraft:silk_touch", - "levels": { - "min": 1 - } - } - ] - } - } - ] - } - ], - "name": "naturesaura:ancient_leaves" - }, - { - "type": "minecraft:item", - "conditions": [ - { - "condition": "minecraft:survives_explosion" - }, - { - "condition": "minecraft:table_bonus", - "enchantment": "minecraft:fortune", - "chances": [ - 0.05, - 0.0625, - 0.083333336, - 0.1 - ] - } - ], - "name": "naturesaura:ancient_sapling" - } - ] - } - ] - }, { "rolls": 1, "entries": [ { "type": "minecraft:item", - "conditions": [ - { - "condition": "minecraft:table_bonus", - "enchantment": "minecraft:fortune", - "chances": [ - 0.02, - 0.022222223, - 0.025, - 0.033333335, - 0.1 - ] - } - ], - "functions": [ - { - "function": "minecraft:set_count", - "count": { - "min": 1.0, - "max": 2.0, - "type": "minecraft:uniform" - } - }, - { - "function": "minecraft:explosion_decay" - } - ], - "name": "minecraft:stick" + "name": "naturesaura:ancient_leaves" } ], "conditions": [ { - "condition": "minecraft:inverted", - "term": { - "condition": "minecraft:alternative", - "terms": [ + "condition": "minecraft:match_tool", + "predicate": { + "enchantments": [ { - "condition": "minecraft:match_tool", - "predicate": { - "item": "minecraft:shears" - } - }, - { - "condition": "minecraft:match_tool", - "predicate": { - "enchantments": [ - { - "enchantment": "minecraft:silk_touch", - "levels": { - "min": 1 - } - } - ] + "enchantment": "minecraft:silk_touch", + "levels": { + "min": 1 } } ] diff --git a/src/main/java/de/ellpeck/naturesaura/data/BlockLootProvider.java b/src/main/java/de/ellpeck/naturesaura/data/BlockLootProvider.java index 8993c931..18687688 100644 --- a/src/main/java/de/ellpeck/naturesaura/data/BlockLootProvider.java +++ b/src/main/java/de/ellpeck/naturesaura/data/BlockLootProvider.java @@ -52,7 +52,7 @@ public class BlockLootProvider implements IDataProvider { } } - this.lootFunctions.put(ModBlocks.ANCIENT_LEAVES, b -> LootTableHooks.genLeaves(b, ModBlocks.ANCIENT_SAPLING)); + this.lootFunctions.put(ModBlocks.ANCIENT_LEAVES, LootTableHooks::genSilkOnly); this.lootFunctions.put(ModBlocks.DECAYED_LEAVES, LootTableHooks::genSilkOnly); this.lootFunctions.put(ModBlocks.GOLDEN_LEAVES, b -> LootTable.builder().addLootPool(LootPool.builder().rolls(ConstantRange.of(1)).addEntry(LootTableHooks.survivesExplosion(b, ItemLootEntry.builder(ModItems.GOLD_LEAF)).acceptCondition(BlockStateProperty.builder(b).fromProperties(StatePropertiesPredicate.Builder.newBuilder().withIntProp(BlockGoldenLeaves.STAGE, BlockGoldenLeaves.HIGHEST_STAGE)))).acceptCondition(RandomChance.builder(0.75F)))); this.lootFunctions.put(ModBlocks.NETHER_WART_MUSHROOM, b -> LootTableHooks.genSilkOr(b, ItemLootEntry.builder(Items.NETHER_WART).acceptFunction(SetCount.builder(RandomValueRange.of(1, 2))))); diff --git a/src/main/resources/data/naturesaura/recipes/tree_ritual/ancient_sapling.json b/src/main/resources/data/naturesaura/recipes/tree_ritual/ancient_sapling.json index 6b79b036..9f91813d 100644 --- a/src/main/resources/data/naturesaura/recipes/tree_ritual/ancient_sapling.json +++ b/src/main/resources/data/naturesaura/recipes/tree_ritual/ancient_sapling.json @@ -24,7 +24,8 @@ "item": "minecraft:oak_sapling" }, "output": { - "item": "naturesaura:ancient_sapling" + "item": "naturesaura:ancient_sapling", + "count": 2 }, "time": 200 } \ No newline at end of file