From 6ab9a763c197c45f10b9301c74b62ce95d4032d5 Mon Sep 17 00:00:00 2001 From: gamma-delta <29877714+gamma-delta@users.noreply.github.com> Date: Sat, 26 Mar 2022 18:34:08 -0500 Subject: [PATCH] i am very good at counting --- src/generated/resources/.cache/cache | 6 +++--- .../loot_modifiers/amethyst_cluster_charged.json | 5 +++-- .../loot_modifiers/amethyst_cluster_dust.json | 6 +++++- .../amethyst_cluster_shard_reducer.json | 15 ++++++++++++++- .../datagen/lootmods/HexLootModifiers.java | 16 +++++++++++++--- 5 files changed, 38 insertions(+), 10 deletions(-) diff --git a/src/generated/resources/.cache/cache b/src/generated/resources/.cache/cache index 2bf136ce..1c4651dd 100644 --- a/src/generated/resources/.cache/cache +++ b/src/generated/resources/.cache/cache @@ -226,9 +226,9 @@ eb17a23e7a9543f33922c056cdf0d63def176bf2 data/hexcasting/advancements/recipes/he cfd93238a1774a30a9da7c6b84e66c2e1e22f243 data/hexcasting/advancements/recipes/hexcasting/wand.json d31956749bebbcb3f0d3c37f89b569642ac8c2fb data/hexcasting/advancements/root.json 739cbdf7f204132f2acfab4df8d21c6197aa1456 data/hexcasting/advancements/y_u_no_cast_angy.json -b1a039d0e90be7882e7558b26a4ffaa30d22b968 data/hexcasting/loot_modifiers/amethyst_cluster_charged.json -e3405d91602cacf6da7d12dd35e628c6ccc749cc data/hexcasting/loot_modifiers/amethyst_cluster_dust.json -b0eac0b211d4621ab2cdda44d5d03f66582d88f7 data/hexcasting/loot_modifiers/amethyst_cluster_shard_reducer.json +70a8f77d38affa642afbfceebe129358737b09ac data/hexcasting/loot_modifiers/amethyst_cluster_charged.json +f746acc6b3e798d3b95f4ceb463c648b1f3ae8c3 data/hexcasting/loot_modifiers/amethyst_cluster_dust.json +985be42281c0396c22b4976b8466448dccd716ec data/hexcasting/loot_modifiers/amethyst_cluster_shard_reducer.json e04be385fa9daa422e41a38ddd70fdd065107968 data/hexcasting/loot_modifiers/scroll_bastion.json 6569766d1579114149eb0a1154d05ec3c964b2a3 data/hexcasting/loot_modifiers/scroll_cartographer.json afecba3144e00505977a4ab4de7940f949ab7818 data/hexcasting/loot_modifiers/scroll_dungeon.json diff --git a/src/generated/resources/data/hexcasting/loot_modifiers/amethyst_cluster_charged.json b/src/generated/resources/data/hexcasting/loot_modifiers/amethyst_cluster_charged.json index 8912fec7..358ceeb5 100644 --- a/src/generated/resources/data/hexcasting/loot_modifiers/amethyst_cluster_charged.json +++ b/src/generated/resources/data/hexcasting/loot_modifiers/amethyst_cluster_charged.json @@ -21,9 +21,10 @@ "condition": "minecraft:table_bonus", "enchantment": "minecraft:fortune", "chances": [ + 0.25, + 0.35, 0.5, - 0.8, - 0.9, + 0.75, 1.0 ] } diff --git a/src/generated/resources/data/hexcasting/loot_modifiers/amethyst_cluster_dust.json b/src/generated/resources/data/hexcasting/loot_modifiers/amethyst_cluster_dust.json index c519ff1f..8a821062 100644 --- a/src/generated/resources/data/hexcasting/loot_modifiers/amethyst_cluster_dust.json +++ b/src/generated/resources/data/hexcasting/loot_modifiers/amethyst_cluster_dust.json @@ -22,7 +22,11 @@ "functions": [ { "function": "minecraft:set_count", - "count": 4.0, + "count": { + "type": "minecraft:uniform", + "min": 1.0, + "max": 4.0 + }, "add": false }, { diff --git a/src/generated/resources/data/hexcasting/loot_modifiers/amethyst_cluster_shard_reducer.json b/src/generated/resources/data/hexcasting/loot_modifiers/amethyst_cluster_shard_reducer.json index 8195ed90..00717d41 100644 --- a/src/generated/resources/data/hexcasting/loot_modifiers/amethyst_cluster_shard_reducer.json +++ b/src/generated/resources/data/hexcasting/loot_modifiers/amethyst_cluster_shard_reducer.json @@ -3,6 +3,19 @@ { "condition": "forge:loot_table_id", "loot_table_id": "minecraft:blocks/amethyst_cluster" + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:match_tool", + "predicate": { + "enchantments": [ + { + "enchantment": "minecraft:silk_touch" + } + ] + } + } } ], "item": "minecraft:amethyst_shard", @@ -10,7 +23,7 @@ { "function": "minecraft:set_count", "count": -2.0, - "add": false + "add": true } ], "type": "paucal:add_item" diff --git a/src/main/java/at/petrak/hexcasting/datagen/lootmods/HexLootModifiers.java b/src/main/java/at/petrak/hexcasting/datagen/lootmods/HexLootModifiers.java index 185cb323..36d4bdef 100644 --- a/src/main/java/at/petrak/hexcasting/datagen/lootmods/HexLootModifiers.java +++ b/src/main/java/at/petrak/hexcasting/datagen/lootmods/HexLootModifiers.java @@ -18,6 +18,7 @@ import net.minecraft.world.level.storage.loot.predicates.BonusLevelTableConditio import net.minecraft.world.level.storage.loot.predicates.LootItemCondition; import net.minecraft.world.level.storage.loot.predicates.MatchTool; import net.minecraft.world.level.storage.loot.providers.number.ConstantValue; +import net.minecraft.world.level.storage.loot.providers.number.UniformGenerator; import net.minecraftforge.common.data.GlobalLootModifierProvider; import net.minecraftforge.common.loot.GlobalLootModifierSerializer; import net.minecraftforge.common.loot.LootTableIdCondition; @@ -40,12 +41,20 @@ public class HexLootModifiers extends GlobalLootModifierProvider { ResourceLocation amethystCluster = new ResourceLocation("minecraft:blocks/amethyst_cluster"); // 4? that's a lot! add("amethyst_cluster_shard_reducer", PaucalLootMods.ADD_ITEM.get(), new PaucalAddItemModifier( - Items.AMETHYST_SHARD, -2, amethystCluster + Items.AMETHYST_SHARD, new LootItemFunction[]{ + SetItemCountFunction.setCount(ConstantValue.exactly(-2), true).build(), + }, new LootItemCondition[]{ + LootTableIdCondition.builder(amethystCluster).build(), + MatchTool.toolMatches( + ItemPredicate.Builder.item().hasEnchantment( + new EnchantmentPredicate(Enchantments.SILK_TOUCH, MinMaxBounds.Ints.ANY))) + .invert().build(), + } )); add("amethyst_cluster_dust", PaucalLootMods.ADD_ITEM.get(), new PaucalAddItemModifier( HexItems.AMETHYST_DUST.get(), new LootItemFunction[]{ - SetItemCountFunction.setCount(ConstantValue.exactly(4)).build(), + SetItemCountFunction.setCount(UniformGenerator.between(1, 4)).build(), ApplyBonusCount.addOreBonusCount(Enchantments.BLOCK_FORTUNE).build() }, new LootItemCondition[]{ LootTableIdCondition.builder(amethystCluster).build(), @@ -62,7 +71,8 @@ public class HexLootModifiers extends GlobalLootModifierProvider { ItemPredicate.Builder.item().hasEnchantment( new EnchantmentPredicate(Enchantments.SILK_TOUCH, MinMaxBounds.Ints.ANY))) .invert().build(), - BonusLevelTableCondition.bonusLevelFlatChance(Enchantments.BLOCK_FORTUNE, 0.5f, 0.8f, 0.9f, 1.0f).build() + BonusLevelTableCondition.bonusLevelFlatChance(Enchantments.BLOCK_FORTUNE, + 0.25f, 0.35f, 0.5f, 0.75f, 1.0f).build() }));