From b9d7484b5ee46d245a295239cfdb9bbe6181e43c Mon Sep 17 00:00:00 2001 From: SammySemicolon <69329424+SammySemicolon@users.noreply.github.com> Date: Sun, 28 Jan 2024 20:41:01 +0100 Subject: [PATCH] I need to sleep on boyfriend's chest --- .../resources/assets/malum/lang/en_us.json | 1 + ...luster.json => cthonic_gold_fragment.json} | 2 +- .../data/forge/tags/blocks/ores.json | 2 - .../forge/tags/blocks/storage_blocks.json | 1 + .../resources/data/forge/tags/items/ores.json | 2 - .../data/forge/tags/items/storage_blocks.json | 1 + ...asting.json => block_of_cthonic_gold.json} | 4 +- ...elting.json => cthonic_gold_fragment.json} | 4 +- .../recipes/misc/cthonic_gold_from_block.json | 35 ++++ .../misc/cthonic_gold_from_fragment.json | 35 ++++ .../blocks/cthonic_gold_cluster.json | 2 +- .../loot_tables/blocks/cthonic_gold_ore.json | 15 +- .../malum/recipes/block_of_cthonic_gold.json | 18 ++ .../malum/recipes/cthonic_gold_fragment.json | 13 ++ .../recipes/cthonic_gold_from_blasting.json | 10 - .../recipes/cthonic_gold_from_block.json | 13 ++ .../recipes/cthonic_gold_from_fragment.json | 33 ++++ .../recipes/cthonic_gold_from_smelting.json | 10 - .../configured_feature/cthonic_gold_ore.json | 10 +- .../placed_feature/cthonic_gold_ore.json | 8 +- .../placed_feature/rare_runewood_tree.json | 2 +- .../placed_feature/runewood_tree.json | 2 +- .../tags/blocks/beacon_base_blocks.json | 1 + .../common/item/spirit/RitualShardItem.java | 2 +- .../worldgen/CthonicGoldOreFeature.java | 174 ++++++++++++++---- .../common/worldgen/LayeredOreFeature.java | 78 ++++++++ .../data/block/MalumBlockLootTables.java | 172 +++++------------ .../malum/data/block/MalumBlockStates.java | 3 +- .../data/recipe/MalumVanillaRecipes.java | 8 +- .../registry/common/block/BlockRegistry.java | 4 +- .../common/block/MalumBlockProperties.java | 18 ++ .../registry/common/item/ItemRegistry.java | 2 +- .../worldgen/ConfiguredFeatureRegistry.java | 6 +- .../common/worldgen/FeatureRegistry.java | 2 +- .../worldgen/PlacedFeatureRegistry.java | 24 ++- .../malum/textures/item/cthonic_gold.png | Bin 513 -> 540 bytes .../textures/item/cthonic_gold_fragment.png | Bin 0 -> 348 bytes 37 files changed, 486 insertions(+), 231 deletions(-) rename src/generated/resources/assets/malum/models/item/{cthonic_gold_cluster.json => cthonic_gold_fragment.json} (53%) rename src/generated/resources/data/malum/advancements/recipes/misc/{cthonic_gold_from_blasting.json => block_of_cthonic_gold.json} (85%) rename src/generated/resources/data/malum/advancements/recipes/misc/{cthonic_gold_from_smelting.json => cthonic_gold_fragment.json} (85%) create mode 100644 src/generated/resources/data/malum/advancements/recipes/misc/cthonic_gold_from_block.json create mode 100644 src/generated/resources/data/malum/advancements/recipes/misc/cthonic_gold_from_fragment.json create mode 100644 src/generated/resources/data/malum/recipes/block_of_cthonic_gold.json create mode 100644 src/generated/resources/data/malum/recipes/cthonic_gold_fragment.json delete mode 100644 src/generated/resources/data/malum/recipes/cthonic_gold_from_blasting.json create mode 100644 src/generated/resources/data/malum/recipes/cthonic_gold_from_block.json create mode 100644 src/generated/resources/data/malum/recipes/cthonic_gold_from_fragment.json delete mode 100644 src/generated/resources/data/malum/recipes/cthonic_gold_from_smelting.json create mode 100644 src/main/java/com/sammy/malum/common/worldgen/LayeredOreFeature.java create mode 100644 src/main/resources/assets/malum/textures/item/cthonic_gold_fragment.png diff --git a/src/generated/resources/assets/malum/lang/en_us.json b/src/generated/resources/assets/malum/lang/en_us.json index 2df0d2cb7..c4c2b1449 100644 --- a/src/generated/resources/assets/malum/lang/en_us.json +++ b/src/generated/resources/assets/malum/lang/en_us.json @@ -326,6 +326,7 @@ "item.malum.crushed_brilliance": "Crushed Brilliance", "item.malum.crushed_soulstone": "Crushed Soulstone", "item.malum.cthonic_gold": "Cthonic Gold", + "item.malum.cthonic_gold_fragment": "Cthonic Gold Fragment", "item.malum.cursed_grit": "Cursed Grit", "item.malum.cursed_sap": "Cursed Sap", "item.malum.cursed_sapball": "Cursed Sapball", diff --git a/src/generated/resources/assets/malum/models/item/cthonic_gold_cluster.json b/src/generated/resources/assets/malum/models/item/cthonic_gold_fragment.json similarity index 53% rename from src/generated/resources/assets/malum/models/item/cthonic_gold_cluster.json rename to src/generated/resources/assets/malum/models/item/cthonic_gold_fragment.json index e11c4f6ce..c29f82855 100644 --- a/src/generated/resources/assets/malum/models/item/cthonic_gold_cluster.json +++ b/src/generated/resources/assets/malum/models/item/cthonic_gold_fragment.json @@ -1,6 +1,6 @@ { "parent": "minecraft:item/generated", "textures": { - "layer0": "malum:block/ores/cthonic_gold_cluster" + "layer0": "malum:item/cthonic_gold_fragment" } } \ No newline at end of file diff --git a/src/generated/resources/data/forge/tags/blocks/ores.json b/src/generated/resources/data/forge/tags/blocks/ores.json index 1a8f515c3..b9ee03e64 100644 --- a/src/generated/resources/data/forge/tags/blocks/ores.json +++ b/src/generated/resources/data/forge/tags/blocks/ores.json @@ -2,13 +2,11 @@ "values": [ "malum:blazing_quartz_ore", "malum:soulstone_ore", - "malum:block_of_cthonic_gold", "malum:brilliant_stone", "malum:natural_quartz_ore", "malum:cthonic_gold_ore", "malum:brilliant_deepslate", "malum:deepslate_quartz_ore", - "malum:cthonic_gold_cluster", "malum:deepslate_soulstone_ore" ] } \ No newline at end of file diff --git a/src/generated/resources/data/forge/tags/blocks/storage_blocks.json b/src/generated/resources/data/forge/tags/blocks/storage_blocks.json index cf499f568..48640675d 100644 --- a/src/generated/resources/data/forge/tags/blocks/storage_blocks.json +++ b/src/generated/resources/data/forge/tags/blocks/storage_blocks.json @@ -4,6 +4,7 @@ "malum:block_of_astral_weave", "malum:block_of_mnemonic_fragment", "malum:block_of_cursed_grit", + "malum:block_of_cthonic_gold", "malum:block_of_alchemical_calx", "malum:mass_of_blighted_gunk", "malum:block_of_blazing_quartz", diff --git a/src/generated/resources/data/forge/tags/items/ores.json b/src/generated/resources/data/forge/tags/items/ores.json index 1a8f515c3..b9ee03e64 100644 --- a/src/generated/resources/data/forge/tags/items/ores.json +++ b/src/generated/resources/data/forge/tags/items/ores.json @@ -2,13 +2,11 @@ "values": [ "malum:blazing_quartz_ore", "malum:soulstone_ore", - "malum:block_of_cthonic_gold", "malum:brilliant_stone", "malum:natural_quartz_ore", "malum:cthonic_gold_ore", "malum:brilliant_deepslate", "malum:deepslate_quartz_ore", - "malum:cthonic_gold_cluster", "malum:deepslate_soulstone_ore" ] } \ No newline at end of file diff --git a/src/generated/resources/data/forge/tags/items/storage_blocks.json b/src/generated/resources/data/forge/tags/items/storage_blocks.json index cf499f568..48640675d 100644 --- a/src/generated/resources/data/forge/tags/items/storage_blocks.json +++ b/src/generated/resources/data/forge/tags/items/storage_blocks.json @@ -4,6 +4,7 @@ "malum:block_of_astral_weave", "malum:block_of_mnemonic_fragment", "malum:block_of_cursed_grit", + "malum:block_of_cthonic_gold", "malum:block_of_alchemical_calx", "malum:mass_of_blighted_gunk", "malum:block_of_blazing_quartz", diff --git a/src/generated/resources/data/malum/advancements/recipes/misc/cthonic_gold_from_blasting.json b/src/generated/resources/data/malum/advancements/recipes/misc/block_of_cthonic_gold.json similarity index 85% rename from src/generated/resources/data/malum/advancements/recipes/misc/cthonic_gold_from_blasting.json rename to src/generated/resources/data/malum/advancements/recipes/misc/block_of_cthonic_gold.json index 65802d863..0cb77fcbd 100644 --- a/src/generated/resources/data/malum/advancements/recipes/misc/cthonic_gold_from_blasting.json +++ b/src/generated/resources/data/malum/advancements/recipes/misc/block_of_cthonic_gold.json @@ -15,7 +15,7 @@ }, "has_the_recipe": { "conditions": { - "recipe": "malum:cthonic_gold_from_blasting" + "recipe": "malum:block_of_cthonic_gold" }, "trigger": "minecraft:recipe_unlocked" } @@ -28,7 +28,7 @@ ], "rewards": { "recipes": [ - "malum:cthonic_gold_from_blasting" + "malum:block_of_cthonic_gold" ] }, "sends_telemetry_event": false diff --git a/src/generated/resources/data/malum/advancements/recipes/misc/cthonic_gold_from_smelting.json b/src/generated/resources/data/malum/advancements/recipes/misc/cthonic_gold_fragment.json similarity index 85% rename from src/generated/resources/data/malum/advancements/recipes/misc/cthonic_gold_from_smelting.json rename to src/generated/resources/data/malum/advancements/recipes/misc/cthonic_gold_fragment.json index 465581d3d..b8efec1b2 100644 --- a/src/generated/resources/data/malum/advancements/recipes/misc/cthonic_gold_from_smelting.json +++ b/src/generated/resources/data/malum/advancements/recipes/misc/cthonic_gold_fragment.json @@ -15,7 +15,7 @@ }, "has_the_recipe": { "conditions": { - "recipe": "malum:cthonic_gold_from_smelting" + "recipe": "malum:cthonic_gold_fragment" }, "trigger": "minecraft:recipe_unlocked" } @@ -28,7 +28,7 @@ ], "rewards": { "recipes": [ - "malum:cthonic_gold_from_smelting" + "malum:cthonic_gold_fragment" ] }, "sends_telemetry_event": false diff --git a/src/generated/resources/data/malum/advancements/recipes/misc/cthonic_gold_from_block.json b/src/generated/resources/data/malum/advancements/recipes/misc/cthonic_gold_from_block.json new file mode 100644 index 000000000..ea31c4641 --- /dev/null +++ b/src/generated/resources/data/malum/advancements/recipes/misc/cthonic_gold_from_block.json @@ -0,0 +1,35 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_cthonic_gold": { + "conditions": { + "items": [ + { + "items": [ + "malum:cthonic_gold" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "malum:cthonic_gold_from_block" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_cthonic_gold", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "malum:cthonic_gold_from_block" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/src/generated/resources/data/malum/advancements/recipes/misc/cthonic_gold_from_fragment.json b/src/generated/resources/data/malum/advancements/recipes/misc/cthonic_gold_from_fragment.json new file mode 100644 index 000000000..4fd6de317 --- /dev/null +++ b/src/generated/resources/data/malum/advancements/recipes/misc/cthonic_gold_from_fragment.json @@ -0,0 +1,35 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_cthonic_gold": { + "conditions": { + "items": [ + { + "items": [ + "malum:cthonic_gold" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "malum:cthonic_gold_from_fragment" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_cthonic_gold", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "malum:cthonic_gold_from_fragment" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/src/generated/resources/data/malum/loot_tables/blocks/cthonic_gold_cluster.json b/src/generated/resources/data/malum/loot_tables/blocks/cthonic_gold_cluster.json index 181675d0f..0a35444c0 100644 --- a/src/generated/resources/data/malum/loot_tables/blocks/cthonic_gold_cluster.json +++ b/src/generated/resources/data/malum/loot_tables/blocks/cthonic_gold_cluster.json @@ -11,7 +11,7 @@ "entries": [ { "type": "minecraft:item", - "name": "malum:cthonic_gold_cluster" + "name": "malum:cthonic_gold_fragment" } ], "rolls": 1.0 diff --git a/src/generated/resources/data/malum/loot_tables/blocks/cthonic_gold_ore.json b/src/generated/resources/data/malum/loot_tables/blocks/cthonic_gold_ore.json index 1f905865e..710c5a440 100644 --- a/src/generated/resources/data/malum/loot_tables/blocks/cthonic_gold_ore.json +++ b/src/generated/resources/data/malum/loot_tables/blocks/cthonic_gold_ore.json @@ -28,12 +28,21 @@ }, { "type": "minecraft:item", - "conditions": [ + "functions": [ + { + "add": false, + "count": { + "type": "minecraft:uniform", + "max": 4.0, + "min": 3.0 + }, + "function": "minecraft:set_count" + }, { - "condition": "minecraft:survives_explosion" + "function": "minecraft:explosion_decay" } ], - "name": "malum:cthonic_gold" + "name": "malum:cthonic_gold_fragment" } ] } diff --git a/src/generated/resources/data/malum/recipes/block_of_cthonic_gold.json b/src/generated/resources/data/malum/recipes/block_of_cthonic_gold.json new file mode 100644 index 000000000..aace3d1cf --- /dev/null +++ b/src/generated/resources/data/malum/recipes/block_of_cthonic_gold.json @@ -0,0 +1,18 @@ +{ + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "#": { + "item": "malum:cthonic_gold" + } + }, + "pattern": [ + "###", + "###", + "###" + ], + "result": { + "item": "malum:block_of_cthonic_gold" + }, + "show_notification": true +} \ No newline at end of file diff --git a/src/generated/resources/data/malum/recipes/cthonic_gold_fragment.json b/src/generated/resources/data/malum/recipes/cthonic_gold_fragment.json new file mode 100644 index 000000000..bb77dcc07 --- /dev/null +++ b/src/generated/resources/data/malum/recipes/cthonic_gold_fragment.json @@ -0,0 +1,13 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "item": "malum:cthonic_gold" + } + ], + "result": { + "count": 8, + "item": "malum:cthonic_gold_fragment" + } +} \ No newline at end of file diff --git a/src/generated/resources/data/malum/recipes/cthonic_gold_from_blasting.json b/src/generated/resources/data/malum/recipes/cthonic_gold_from_blasting.json deleted file mode 100644 index 94dda2838..000000000 --- a/src/generated/resources/data/malum/recipes/cthonic_gold_from_blasting.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "type": "minecraft:blasting", - "category": "misc", - "cookingtime": 100, - "experience": 2.0, - "ingredient": { - "item": "malum:block_of_cthonic_gold" - }, - "result": "malum:cthonic_gold" -} \ No newline at end of file diff --git a/src/generated/resources/data/malum/recipes/cthonic_gold_from_block.json b/src/generated/resources/data/malum/recipes/cthonic_gold_from_block.json new file mode 100644 index 000000000..c07d49dab --- /dev/null +++ b/src/generated/resources/data/malum/recipes/cthonic_gold_from_block.json @@ -0,0 +1,13 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "item": "malum:block_of_cthonic_gold" + } + ], + "result": { + "count": 9, + "item": "malum:cthonic_gold" + } +} \ No newline at end of file diff --git a/src/generated/resources/data/malum/recipes/cthonic_gold_from_fragment.json b/src/generated/resources/data/malum/recipes/cthonic_gold_from_fragment.json new file mode 100644 index 000000000..27d69d196 --- /dev/null +++ b/src/generated/resources/data/malum/recipes/cthonic_gold_from_fragment.json @@ -0,0 +1,33 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "item": "malum:cthonic_gold_fragment" + }, + { + "item": "malum:cthonic_gold_fragment" + }, + { + "item": "malum:cthonic_gold_fragment" + }, + { + "item": "malum:cthonic_gold_fragment" + }, + { + "item": "malum:cthonic_gold_fragment" + }, + { + "item": "malum:cthonic_gold_fragment" + }, + { + "item": "malum:cthonic_gold_fragment" + }, + { + "item": "malum:cthonic_gold_fragment" + } + ], + "result": { + "item": "malum:cthonic_gold" + } +} \ No newline at end of file diff --git a/src/generated/resources/data/malum/recipes/cthonic_gold_from_smelting.json b/src/generated/resources/data/malum/recipes/cthonic_gold_from_smelting.json deleted file mode 100644 index 9bb691f70..000000000 --- a/src/generated/resources/data/malum/recipes/cthonic_gold_from_smelting.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "type": "minecraft:smelting", - "category": "misc", - "cookingtime": 200, - "experience": 2.0, - "ingredient": { - "item": "malum:block_of_cthonic_gold" - }, - "result": "malum:cthonic_gold" -} \ No newline at end of file diff --git a/src/generated/resources/data/malum/worldgen/configured_feature/cthonic_gold_ore.json b/src/generated/resources/data/malum/worldgen/configured_feature/cthonic_gold_ore.json index 9b14b8bc2..4c9d8a31c 100644 --- a/src/generated/resources/data/malum/worldgen/configured_feature/cthonic_gold_ore.json +++ b/src/generated/resources/data/malum/worldgen/configured_feature/cthonic_gold_ore.json @@ -2,11 +2,11 @@ "type": "malum:cthonic_gold_ore", "config": { "discard_chance_on_air_exposure": 0.0, - "size": 16, + "size": 8, "targets": [ { "state": { - "Name": "minecraft:deepslate_gold_ore" + "Name": "malum:cthonic_gold_ore" }, "target": { "predicate_type": "minecraft:tag_match", @@ -15,11 +15,11 @@ }, { "state": { - "Name": "malum:cthonic_gold_ore" + "Name": "minecraft:deepslate_gold_ore" }, "target": { - "block": "minecraft:deepslate_gold_ore", - "predicate_type": "minecraft:block_match" + "predicate_type": "minecraft:tag_match", + "tag": "minecraft:deepslate_ore_replaceables" } } ] diff --git a/src/generated/resources/data/malum/worldgen/placed_feature/cthonic_gold_ore.json b/src/generated/resources/data/malum/worldgen/placed_feature/cthonic_gold_ore.json index 0de630068..9d21371f3 100644 --- a/src/generated/resources/data/malum/worldgen/placed_feature/cthonic_gold_ore.json +++ b/src/generated/resources/data/malum/worldgen/placed_feature/cthonic_gold_ore.json @@ -6,7 +6,7 @@ "height": { "type": "minecraft:trapezoid", "max_inclusive": { - "absolute": 40 + "absolute": -10 }, "min_inclusive": { "absolute": -64 @@ -15,13 +15,17 @@ }, { "type": "minecraft:count", - "count": 2 + "count": 1 }, { "type": "minecraft:in_square" }, { "type": "minecraft:biome" + }, + { + "type": "minecraft:rarity_filter", + "chance": 4 } ] } \ No newline at end of file diff --git a/src/generated/resources/data/malum/worldgen/placed_feature/rare_runewood_tree.json b/src/generated/resources/data/malum/worldgen/placed_feature/rare_runewood_tree.json index 879613a04..2acf5db26 100644 --- a/src/generated/resources/data/malum/worldgen/placed_feature/rare_runewood_tree.json +++ b/src/generated/resources/data/malum/worldgen/placed_feature/rare_runewood_tree.json @@ -7,7 +7,7 @@ }, { "type": "minecraft:rarity_filter", - "chance": 5 + "chance": 10 }, { "type": "minecraft:in_square" diff --git a/src/generated/resources/data/malum/worldgen/placed_feature/runewood_tree.json b/src/generated/resources/data/malum/worldgen/placed_feature/runewood_tree.json index 2acf5db26..879613a04 100644 --- a/src/generated/resources/data/malum/worldgen/placed_feature/runewood_tree.json +++ b/src/generated/resources/data/malum/worldgen/placed_feature/runewood_tree.json @@ -7,7 +7,7 @@ }, { "type": "minecraft:rarity_filter", - "chance": 10 + "chance": 5 }, { "type": "minecraft:in_square" diff --git a/src/generated/resources/data/minecraft/tags/blocks/beacon_base_blocks.json b/src/generated/resources/data/minecraft/tags/blocks/beacon_base_blocks.json index af6a71dc6..b6b3b443e 100644 --- a/src/generated/resources/data/minecraft/tags/blocks/beacon_base_blocks.json +++ b/src/generated/resources/data/minecraft/tags/blocks/beacon_base_blocks.json @@ -1,6 +1,7 @@ { "values": [ "malum:block_of_mnemonic_fragment", + "malum:block_of_cthonic_gold", "malum:block_of_blazing_quartz", "malum:block_of_soulstone", "malum:block_of_null_slate", diff --git a/src/main/java/com/sammy/malum/common/item/spirit/RitualShardItem.java b/src/main/java/com/sammy/malum/common/item/spirit/RitualShardItem.java index 74ac02409..df2a72f85 100644 --- a/src/main/java/com/sammy/malum/common/item/spirit/RitualShardItem.java +++ b/src/main/java/com/sammy/malum/common/item/spirit/RitualShardItem.java @@ -61,10 +61,10 @@ public void spawnLateParticles(ScreenParticleHolder target, Level level, float p ScreenParticleEffects.spawnSpiritShardScreenParticles(target, type.getPrimaryColor(), type.getSecondaryColor()); if (ritualTier.isGreaterThan(MalumRitualTier.DIM)) { float distance = 2f + ritualTier.potency; - float scalar = 0.4f + 0.15f * ritualTier.potency; var rand = Minecraft.getInstance().level.getRandom(); for (int i = 0; i < 2; i++) { float time = (((i == 1 ? 3.14f : 0) + ((level.getGameTime() + partialTick) * 0.05f)) % 6.28f); + float scalar = 0.4f + 0.15f * ritualTier.potency; if (time > 1.57f && time < 4.71f) { scalar *= Easing.QUAD_IN.ease(Math.abs(3.14f - time) / 1.57f, 0, 1, 1); } diff --git a/src/main/java/com/sammy/malum/common/worldgen/CthonicGoldOreFeature.java b/src/main/java/com/sammy/malum/common/worldgen/CthonicGoldOreFeature.java index 1f9401f72..9425e11ce 100644 --- a/src/main/java/com/sammy/malum/common/worldgen/CthonicGoldOreFeature.java +++ b/src/main/java/com/sammy/malum/common/worldgen/CthonicGoldOreFeature.java @@ -3,66 +3,162 @@ import com.mojang.serialization.*; import com.sammy.malum.registry.common.block.*; import net.minecraft.core.*; -import net.minecraft.tags.*; import net.minecraft.util.*; import net.minecraft.world.level.*; import net.minecraft.world.level.block.*; -import net.minecraft.world.level.levelgen.*; +import net.minecraft.world.level.block.state.*; +import net.minecraft.world.level.block.state.properties.*; +import net.minecraft.world.level.chunk.*; import net.minecraft.world.level.levelgen.feature.*; import net.minecraft.world.level.levelgen.feature.configurations.*; -import net.minecraft.world.level.levelgen.structure.templatesystem.*; import java.util.*; -public class CthonicGoldOreFeature extends OreFeature { - - public List oreConfigurations = new ArrayList<>(); - +public class CthonicGoldOreFeature extends LayeredOreFeature{ public CthonicGoldOreFeature(Codec pCodec) { super(pCodec); } @Override - public boolean place(FeaturePlaceContext pContext) { - RandomSource randomsource = pContext.random(); - BlockPos blockpos = pContext.origin(); - WorldGenLevel worldgenlevel = pContext.level(); + protected boolean doPlace(WorldGenLevel pLevel, RandomSource pRandom, OreConfiguration pConfig, double pMinX, double pMaxX, double pMinZ, double pMaxZ, double pMinY, double pMaxY, int pX, int pY, int pZ, int pWidth, int pHeight) { + int i = 0; + boolean isCthonicGold = pConfig.targetStates.get(0).state.getBlock().equals(BlockRegistry.CTHONIC_GOLD_ORE.get()); + List clusterPlacements = new ArrayList<>(); + List cthonicGoldPlacements = isCthonicGold ? new ArrayList<>() : null; + BitSet bitset = new BitSet(pWidth * pHeight * pWidth); + BlockPos.MutableBlockPos mutable = new BlockPos.MutableBlockPos(); + int j = pConfig.size; + double[] adouble = new double[j * 4]; + + for (int k = 0; k < j; ++k) { + float f = (float) k / (float) j; + double d0 = Mth.lerp(f, pMinX, pMaxX); + double d1 = Mth.lerp(f, pMinY, pMaxY); + double d2 = Mth.lerp(f, pMinZ, pMaxZ); + double d3 = pRandom.nextDouble() * (double) j / 16.0D; + double d4 = ((double) (Mth.sin((float) Math.PI * f) + 1.0F) * d3 + 1.0D) / 2.0D; + adouble[k * 4] = d0; + adouble[k * 4 + 1] = d1; + adouble[k * 4 + 2] = d2; + adouble[k * 4 + 3] = d4; + } - boolean result = false; - OreConfiguration primaryOreConfig = pContext.config(); - if (oreConfigurations.isEmpty()) { - final List targetStates = primaryOreConfig.targetStates; - int size = primaryOreConfig.size; - for (OreConfiguration.TargetBlockState target : targetStates) { - oreConfigurations.add(new OreConfiguration(List.of(target), size)); - size /= 2; + for (int l3 = 0; l3 < j - 1; ++l3) { + if (!(adouble[l3 * 4 + 3] <= 0.0D)) { + for (int i4 = l3 + 1; i4 < j; ++i4) { + if (!(adouble[i4 * 4 + 3] <= 0.0D)) { + double d8 = adouble[l3 * 4] - adouble[i4 * 4]; + double d10 = adouble[l3 * 4 + 1] - adouble[i4 * 4 + 1]; + double d12 = adouble[l3 * 4 + 2] - adouble[i4 * 4 + 2]; + double d14 = adouble[l3 * 4 + 3] - adouble[i4 * 4 + 3]; + if (d14 * d14 > d8 * d8 + d10 * d10 + d12 * d12) { + if (d14 > 0.0D) { + adouble[i4 * 4 + 3] = -1.0D; + } else { + adouble[l3 * 4 + 3] = -1.0D; + } + } + } + } } } - float f = randomsource.nextFloat() * (float) Math.PI; - double d4 = (blockpos.getY() + randomsource.nextInt(3) - 2); - double d5 = (blockpos.getY() + randomsource.nextInt(3) - 2); - for (OreConfiguration oreConfiguration : oreConfigurations) { - float f1 = (float) oreConfiguration.size / 8.0F; - int i = Mth.ceil(((float) oreConfiguration.size / 16.0F * 2.0F + 1.0F) / 2.0F); - double d0 = (double) blockpos.getX() + Math.sin(f) * (double) f1; - double d1 = (double) blockpos.getX() - Math.sin(f) * (double) f1; - double d2 = (double) blockpos.getZ() + Math.cos(f) * (double) f1; - double d3 = (double) blockpos.getZ() - Math.cos(f) * (double) f1; - int k = blockpos.getX() - Mth.ceil(f1) - i; - int l = blockpos.getY() - 2 - i; - int i1 = blockpos.getZ() - Mth.ceil(f1) - i; - int width = 2 * (Mth.ceil(f1) + i); - int height = 2 * (2 + i); + try (BulkSectionAccess bulksectionaccess = new BulkSectionAccess(pLevel)) { + for (int j4 = 0; j4 < j; ++j4) { + double d9 = adouble[j4 * 4 + 3]; + if (!(d9 < 0.0D)) { + double d11 = adouble[j4 * 4]; + double d13 = adouble[j4 * 4 + 1]; + double d15 = adouble[j4 * 4 + 2]; + int k4 = Math.max(Mth.floor(d11 - d9), pX); + int l = Math.max(Mth.floor(d13 - d9), pY); + int i1 = Math.max(Mth.floor(d15 - d9), pZ); + int j1 = Math.max(Mth.floor(d11 + d9), k4); + int k1 = Math.max(Mth.floor(d13 + d9), l); + int l1 = Math.max(Mth.floor(d15 + d9), i1); + + for (int i2 = k4; i2 <= j1; ++i2) { + double d5 = ((double) i2 + 0.5D - d11) / d9; + if (d5 * d5 < 1.0D) { + for (int j2 = l; j2 <= k1; ++j2) { + double d6 = ((double) j2 + 0.5D - d13) / d9; + if (d5 * d5 + d6 * d6 < 1.0D) { + for (int k2 = i1; k2 <= l1; ++k2) { + double d7 = ((double) k2 + 0.5D - d15) / d9; + if (d5 * d5 + d6 * d6 + d7 * d7 < 1.0D && !pLevel.isOutsideBuildHeight(j2)) { + int l2 = i2 - pX + (j2 - pY) * pWidth + (k2 - pZ) * pWidth * pHeight; + if (!bitset.get(l2)) { + bitset.set(l2); + mutable.set(i2, j2, k2); + if (pLevel.ensureCanWrite(mutable)) { + final LevelChunkSection section = bulksectionaccess.getSection(mutable); + if (section != null) { + int x = SectionPos.sectionRelative(i2); + int y = SectionPos.sectionRelative(j2); + int z = SectionPos.sectionRelative(k2); + BlockState blockstate = section.getBlockState(x, y, z); - for (int l1 = k; l1 <= k + width; ++l1) { - for (int i2 = i1; i2 <= i1 + width; ++i2) { - if (l <= worldgenlevel.getHeight(Heightmap.Types.OCEAN_FLOOR_WG, l1, i2)) { - result = doPlace(worldgenlevel, randomsource, oreConfiguration, d0, d1, d2, d3, d4, d5, k, l, i1, width, height); + for (OreConfiguration.TargetBlockState oreconfiguration$targetblockstate : pConfig.targetStates) { + if (canPlaceOre(blockstate, bulksectionaccess::getBlockState, pRandom, pConfig, oreconfiguration$targetblockstate, mutable)) { + if (isCthonicGold) { + cthonicGoldPlacements.add( + () -> section.setBlockState(x, y, z, oreconfiguration$targetblockstate.state, false)); + } + else { + section.setBlockState(x, y, z, oreconfiguration$targetblockstate.state, false); + } + for (Direction direction : Direction.values()) { + mutable.set(i2, j2, k2).move(direction); + if (pLevel.ensureCanWrite(mutable)) { + final LevelChunkSection offsetSection = bulksectionaccess.getSection(mutable); + if (offsetSection != null) { + final int clusterX = SectionPos.sectionRelative(mutable.getX()); + final int clusterY = SectionPos.sectionRelative(mutable.getY()); + final int clusterZ = SectionPos.sectionRelative(mutable.getZ()); + if (offsetSection.getBlockState(clusterX, clusterY, clusterZ).isAir()) { + clusterPlacements.add( + () -> offsetSection.setBlockState(clusterX, clusterY, clusterZ, BlockRegistry.CTHONIC_GOLD_CLUSTER.get().defaultBlockState().setValue(BlockStateProperties.FACING, direction), false) + ); + } + } + } + } + i++; + if (isCthonicGold && i >= 3) { + cthonicGoldPlacements.forEach(Runnable::run); + placeClusters(clusterPlacements, pRandom); + return true; + } + break; + } + } + } + } + } + } + } + } + } + } } } } + if (isCthonicGold ? i >= 3 : i > 0) { + placeClusters(clusterPlacements, pRandom); + } + } + return isCthonicGold ? i >= 3 : i > 0; + } + + public void placeClusters(List clusterPlacements, RandomSource random) { + if (!clusterPlacements.isEmpty()) { + Collections.shuffle(clusterPlacements); + int clusterAmount = (clusterPlacements.size() + random.nextInt(4)) / 3; + if (clusterAmount != 0) { + for (int k = 0; k < Math.min(clusterAmount, clusterPlacements.size()); k++) { + clusterPlacements.get(k).run(); + } + } } - return result; } } diff --git a/src/main/java/com/sammy/malum/common/worldgen/LayeredOreFeature.java b/src/main/java/com/sammy/malum/common/worldgen/LayeredOreFeature.java new file mode 100644 index 000000000..194f655d3 --- /dev/null +++ b/src/main/java/com/sammy/malum/common/worldgen/LayeredOreFeature.java @@ -0,0 +1,78 @@ +package com.sammy.malum.common.worldgen; + +import com.mojang.serialization.*; +import net.minecraft.core.*; +import net.minecraft.util.*; +import net.minecraft.world.level.*; +import net.minecraft.world.level.levelgen.*; +import net.minecraft.world.level.levelgen.feature.*; +import net.minecraft.world.level.levelgen.feature.configurations.*; + +import java.util.*; + +public class LayeredOreFeature extends OreFeature { + + public List oreConfigurations = new ArrayList<>(); + + public LayeredOreFeature(Codec pCodec) { + super(pCodec); + } + + @Override + public boolean place(FeaturePlaceContext pContext) { + RandomSource randomsource = pContext.random(); + BlockPos blockpos = pContext.origin(); + WorldGenLevel worldgenlevel = pContext.level(); + + boolean result = false; + if (oreConfigurations.isEmpty()) { + OreConfiguration primaryOreConfig = pContext.config(); + final List targetStates = primaryOreConfig.targetStates; + int size = primaryOreConfig.size; + for (OreConfiguration.TargetBlockState target : targetStates) { + oreConfigurations.add(new OreConfiguration(List.of(target), size)); + size *= 2; + } + } + + float f = randomsource.nextFloat() * (float) Math.PI; + final double sin = Math.sin(f); + final double cos = Math.cos(f); + double d4 = (blockpos.getY() + randomsource.nextInt(3) - 2); + double d5 = (blockpos.getY() + randomsource.nextInt(3) - 2); + for (int i = 0; i < oreConfigurations.size(); i++) { + OreConfiguration oreConfiguration = oreConfigurations.get(i); + boolean success = false; + float f1 = (float) oreConfiguration.size / 8.0F; + int j = Mth.ceil(((float) oreConfiguration.size / 16.0F * 2.0F + 1.0F) / 2.0F); + double d0 = (double) blockpos.getX() + sin * (double) f1; + double d1 = (double) blockpos.getX() - sin * (double) f1; + double d2 = (double) blockpos.getZ() + cos * (double) f1; + double d3 = (double) blockpos.getZ() - cos * (double) f1; + int k = blockpos.getX() - Mth.ceil(f1) - j; + int l = blockpos.getY() - 2 - j; + int i1 = blockpos.getZ() - Mth.ceil(f1) - j; + int width = 2 * (Mth.ceil(f1) + j); + int height = 2 * (2 + j); + + for (int l1 = k; l1 <= k + width; ++l1) { + if (success) { + break; + } + for (int i2 = i1; i2 <= i1 + width; ++i2) { + if (success) { + break; + } + if (l <= worldgenlevel.getHeight(Heightmap.Types.OCEAN_FLOOR_WG, l1, i2)) { + result = doPlace(worldgenlevel, randomsource, oreConfiguration, d0, d1, d2, d3, d4, d5, k, l, i1, width, height); + if (!result && i == 0) { + return false; + } + success = true; + } + } + } + } + return result; + } +} diff --git a/src/main/java/com/sammy/malum/data/block/MalumBlockLootTables.java b/src/main/java/com/sammy/malum/data/block/MalumBlockLootTables.java index 422792069..7e78fcea3 100644 --- a/src/main/java/com/sammy/malum/data/block/MalumBlockLootTables.java +++ b/src/main/java/com/sammy/malum/data/block/MalumBlockLootTables.java @@ -105,8 +105,7 @@ protected void generate() { add(take(blocks, BlockRegistry.BLAZING_QUARTZ_ORE).get(), createOreDrop(BlockRegistry.BLAZING_QUARTZ_ORE.get(), ItemRegistry.BLAZING_QUARTZ.get())); add(take(blocks, BlockRegistry.NATURAL_QUARTZ_ORE).get(), createOreDrop(BlockRegistry.NATURAL_QUARTZ_ORE.get(), ItemRegistry.NATURAL_QUARTZ.get())); add(take(blocks, BlockRegistry.DEEPSLATE_QUARTZ_ORE).get(), createOreDrop(BlockRegistry.DEEPSLATE_QUARTZ_ORE.get(), ItemRegistry.NATURAL_QUARTZ.get())); - - add(take(blocks, BlockRegistry.CTHONIC_GOLD_ORE).get(), createSingleItemTableWithSilkTouch(BlockRegistry.CTHONIC_GOLD_ORE.get(), ItemRegistry.CTHONIC_GOLD.get())); + add(take(blocks, BlockRegistry.CTHONIC_GOLD_ORE).get(), createCthonicGoldOreDrop(BlockRegistry.CTHONIC_GOLD_ORE.get())); takeAll(blocks, b -> b.get() instanceof SaplingBlock).forEach(b -> add(b.get(), createSingleItemTable(b.get().asItem()))); takeAll(blocks, b -> b.get() instanceof DoublePlantBlock).forEach(b -> add(b.get(), createSingleItemTableWithSilkTouchOrShears(b.get(), b.get().asItem()))); @@ -121,140 +120,51 @@ protected void generate() { takeAll(blocks, b -> true).forEach(b -> add(b.get(), createSingleItemTable(b.get().asItem()))); } - } - - - protected static > T applyExplosionDecay(ItemLike p_124132_, FunctionUserBuilder p_124133_) { - return !EXPLOSION_RESISTANT.contains(p_124132_.asItem()) ? p_124133_.apply(ApplyExplosionDecay.explosionDecay()) : p_124133_.unwrap(); - } - - protected static > T applyExplosionCondition(ItemLike p_124135_, ConditionUserBuilder p_124136_) { - return !EXPLOSION_RESISTANT.contains(p_124135_.asItem()) ? p_124136_.when(ExplosionCondition.survivesExplosion()) : p_124136_.unwrap(); - } - - protected static LootTable.Builder createBlightedDrop(Block block, int gunkAmount) { - return createSilkTouchDispatchTable(block, applyExplosionCondition(ItemRegistry.BLIGHTED_GUNK.get(), LootItem.lootTableItem(ItemRegistry.BLIGHTED_GUNK.get()).apply(SetItemCountFunction.setCount(ConstantValue.exactly(gunkAmount))))); - } - - protected static LootTable.Builder createBlightedPlantDrop(Block block, int gunkAmount) { - return createSilkTouchOrShearsDispatchTable(block, applyExplosionCondition(ItemRegistry.BLIGHTED_GUNK.get(), LootItem.lootTableItem(ItemRegistry.BLIGHTED_GUNK.get()).apply(SetItemCountFunction.setCount(ConstantValue.exactly(gunkAmount))))); - } - - protected static LootTable.Builder createEtherDrop(Block block) { - return LootTable.lootTable().withPool(applyExplosionCondition(block, LootPool.lootPool().setRolls(ConstantValue.exactly(1.0F)).add(LootItem.lootTableItem(block).apply(CopyNameFunction.copyName(CopyNameFunction.NameSource.BLOCK_ENTITY)).apply(CopyNbtFunction.copyData(ContextNbtProvider.BLOCK_ENTITY).copy("firstColor", "display.firstColor").copy("secondColor", "display.secondColor"))))); - } - - protected static LootTable.Builder createJarDrop(Block block) { - return LootTable.lootTable().withPool(applyExplosionCondition(block, LootPool.lootPool().setRolls(ConstantValue.exactly(1.0F)).add(LootItem.lootTableItem(block).apply(CopyNameFunction.copyName(CopyNameFunction.NameSource.BLOCK_ENTITY)).apply(CopyNbtFunction.copyData(ContextNbtProvider.BLOCK_ENTITY).copy("spirit", "spirit").copy("count", "count"))))); - } - - protected static LootTable.Builder createSingleItemTable(ItemLike p_124127_) { - return LootTable.lootTable().withPool(applyExplosionCondition(p_124127_, LootPool.lootPool().setRolls(ConstantValue.exactly(1.0F)).add(LootItem.lootTableItem(p_124127_)))); - } - - protected static LootTable.Builder createSelfDropDispatchTable(Block p_124172_, LootItemCondition.Builder p_124173_, LootPoolEntryContainer.Builder p_124174_) { - return LootTable.lootTable().withPool(LootPool.lootPool().setRolls(ConstantValue.exactly(1.0F)).add(LootItem.lootTableItem(p_124172_).when(p_124173_).otherwise(p_124174_))); - } - - protected static LootTable.Builder createSilkTouchDispatchTable(Block p_124169_, LootPoolEntryContainer.Builder p_124170_) { - return createSelfDropDispatchTable(p_124169_, HAS_SILK_TOUCH, p_124170_); - } - - protected static LootTable.Builder createShearsDispatchTable(Block p_124268_, LootPoolEntryContainer.Builder p_124269_) { - return createSelfDropDispatchTable(p_124268_, HAS_SHEARS, p_124269_); - } - - protected static LootTable.Builder createSilkTouchOrShearsDispatchTable(Block p_124284_, LootPoolEntryContainer.Builder p_124285_) { - return createSelfDropDispatchTable(p_124284_, HAS_SHEARS_OR_SILK_TOUCH, p_124285_); - } - - protected static LootTable.Builder createSingleItemTableWithSilkTouch(Block p_124258_, ItemLike p_124259_) { - return createSilkTouchDispatchTable(p_124258_, applyExplosionCondition(p_124258_, LootItem.lootTableItem(p_124259_))); - } - - protected static LootTable.Builder createSingleItemTableWithSilkTouchOrShears(Block p_124258_, ItemLike p_124259_) { - return createSilkTouchOrShearsDispatchTable(p_124258_, applyExplosionCondition(p_124258_, LootItem.lootTableItem(p_124259_))); - } - - protected static LootTable.Builder createSingleItemTable(ItemLike p_176040_, NumberProvider p_176041_) { - return LootTable.lootTable().withPool(LootPool.lootPool().setRolls(ConstantValue.exactly(1.0F)).add(applyExplosionDecay(p_176040_, LootItem.lootTableItem(p_176040_).apply(SetItemCountFunction.setCount(p_176041_))))); - } - - protected static LootTable.Builder createSingleItemTableWithSilkTouch(Block p_176043_, ItemLike p_176044_, NumberProvider p_176045_) { - return createSilkTouchDispatchTable(p_176043_, applyExplosionDecay(p_176043_, LootItem.lootTableItem(p_176044_).apply(SetItemCountFunction.setCount(p_176045_)))); - } - - protected static LootTable.Builder createSilkTouchOnlyTable(ItemLike p_124251_) { - return LootTable.lootTable().withPool(LootPool.lootPool().when(HAS_SILK_TOUCH).setRolls(ConstantValue.exactly(1.0F)).add(LootItem.lootTableItem(p_124251_))); - } - - protected static LootTable.Builder createPotFlowerItemTable(ItemLike p_124271_) { - return LootTable.lootTable().withPool(applyExplosionCondition(Blocks.FLOWER_POT, LootPool.lootPool().setRolls(ConstantValue.exactly(1.0F)).add(LootItem.lootTableItem(Blocks.FLOWER_POT)))).withPool(applyExplosionCondition(p_124271_, LootPool.lootPool().setRolls(ConstantValue.exactly(1.0F)).add(LootItem.lootTableItem(p_124271_)))); - } - - protected static LootTable.Builder createSlabItemTable(Block p_124291_) { - return LootTable.lootTable().withPool(LootPool.lootPool().setRolls(ConstantValue.exactly(1.0F)).add(applyExplosionDecay(p_124291_, LootItem.lootTableItem(p_124291_).apply(SetItemCountFunction.setCount(ConstantValue.exactly(2.0F)).when(LootItemBlockStatePropertyCondition.hasBlockStateProperties(p_124291_).setProperties(StatePropertiesPredicate.Builder.properties().hasProperty(SlabBlock.TYPE, SlabType.DOUBLE))))))); - } - - protected static & StringRepresentable> LootTable.Builder createSinglePropConditionTable(Block p_124162_, Property p_124163_, T p_124164_) { - return LootTable.lootTable().withPool(applyExplosionCondition(p_124162_, LootPool.lootPool().setRolls(ConstantValue.exactly(1.0F)).add(LootItem.lootTableItem(p_124162_).when(LootItemBlockStatePropertyCondition.hasBlockStateProperties(p_124162_).setProperties(StatePropertiesPredicate.Builder.properties().hasProperty(p_124163_, p_124164_)))))); - } - - protected static LootTable.Builder createOreDrop(Block p_124140_, Item p_124141_) { - return createSilkTouchDispatchTable(p_124140_, applyExplosionDecay(p_124140_, LootItem.lootTableItem(p_124141_).apply(ApplyBonusCount.addOreBonusCount(Enchantments.BLOCK_FORTUNE)))); - } - - protected static LootTable.Builder createShearsOnlyDrop(ItemLike p_124287_) { - return LootTable.lootTable().withPool(LootPool.lootPool().setRolls(ConstantValue.exactly(1.0F)).when(HAS_SHEARS).add(LootItem.lootTableItem(p_124287_))); - } - - protected static LootTable.Builder createLeavesDrops(Block p_124158_, Block p_124159_, float... p_124160_) { - return createSilkTouchOrShearsDispatchTable(p_124158_, applyExplosionCondition(p_124158_, LootItem.lootTableItem(p_124159_)).when(BonusLevelTableCondition.bonusLevelFlatChance(Enchantments.BLOCK_FORTUNE, p_124160_))).withPool(LootPool.lootPool().setRolls(ConstantValue.exactly(1.0F)).when(HAS_NO_SHEARS_OR_SILK_TOUCH).add(applyExplosionDecay(p_124158_, LootItem.lootTableItem(Items.STICK).apply(SetItemCountFunction.setCount(UniformGenerator.between(1.0F, 2.0F)))).when(BonusLevelTableCondition.bonusLevelFlatChance(Enchantments.BLOCK_FORTUNE, 0.02F, 0.022222223F, 0.025F, 0.033333335F, 0.1F)))); - } - - public static LootTable.Builder noDrop() { - return LootTable.lootTable(); - } - - public static LootTable.Builder createDoorTable(Block p_124138_) { - return createSinglePropConditionTable(p_124138_, DoorBlock.HALF, DoubleBlockHalf.LOWER); - } - protected Iterable getKnownBlocks() { - return ForgeRegistries.BLOCKS; - } - - public void dropPottedContents(Block p_124253_) { - this.add(p_124253_, (p_176061_) -> { - return createPotFlowerItemTable(((FlowerPotBlock) p_176061_).getContent()); - }); - } - - public void otherWhenSilkTouch(Block p_124155_, Block p_124156_) { - this.add(p_124155_, createSilkTouchOnlyTable(p_124156_)); - } - - public void dropOther(Block p_124148_, ItemLike p_124149_) { - this.add(p_124148_, createSingleItemTable(p_124149_)); - } + protected LootTable.Builder createCthonicGoldOreDrop(Block block) { + return createSilkTouchDispatchTable(block, + applyExplosionDecay(block, LootItem.lootTableItem(ItemRegistry.CTHONIC_GOLD_FRAGMENT.get()) + .apply(SetItemCountFunction.setCount(UniformGenerator.between(3.0F, 4.0F))))); + } - public void dropWhenSilkTouch(Block p_124273_) { - this.otherWhenSilkTouch(p_124273_, p_124273_); - } + protected LootTable.Builder createBlightedDrop(Block block, int gunkAmount) { + return createSilkTouchDispatchTable(block, + applyExplosionCondition(ItemRegistry.BLIGHTED_GUNK.get(), LootItem.lootTableItem(ItemRegistry.BLIGHTED_GUNK.get()) + .apply(SetItemCountFunction.setCount(ConstantValue.exactly(gunkAmount))))); + } - public void dropSelf(Block p_124289_) { - this.dropOther(p_124289_, p_124289_); - } + protected LootTable.Builder createBlightedPlantDrop(Block block, int gunkAmount) { + return createSilkTouchOrShearsDispatchTable(block, + applyExplosionCondition(ItemRegistry.BLIGHTED_GUNK.get(), LootItem.lootTableItem(ItemRegistry.BLIGHTED_GUNK.get()) + .apply(SetItemCountFunction.setCount(ConstantValue.exactly(gunkAmount))))); + } - protected void add(Block p_124176_, Function p_124177_) { - this.add(p_124176_, p_124177_.apply(p_124176_)); - } + protected LootTable.Builder createEtherDrop(Block block) { + return LootTable.lootTable().withPool( + applyExplosionCondition(block, + LootPool.lootPool() + .setRolls(ConstantValue.exactly(1.0F)) + .add(LootItem.lootTableItem(block) + .apply(CopyNameFunction.copyName(CopyNameFunction.NameSource.BLOCK_ENTITY)) + .apply(CopyNbtFunction.copyData(ContextNbtProvider.BLOCK_ENTITY) + .copy("firstColor", "display.firstColor") + .copy("secondColor", "display.secondColor"))))); + } - protected void add(Block block, LootTable.Builder builder) { - this.add(block.getLootTable(), builder); - } + protected LootTable.Builder createJarDrop(Block block) { + return LootTable.lootTable().withPool( + applyExplosionCondition(block, + LootPool.lootPool() + .setRolls(ConstantValue.exactly(1.0F)) + .add(LootItem.lootTableItem(block) + .apply(CopyNameFunction.copyName(CopyNameFunction.NameSource.BLOCK_ENTITY)) + .apply(CopyNbtFunction.copyData(ContextNbtProvider.BLOCK_ENTITY) + .copy("spirit", "spirit") + .copy("count", "count"))))); + } - protected void add(ResourceLocation path, LootTable.Builder lootTable) { - tables.add(Pair.of(() -> (lootBuilder) -> lootBuilder.accept(path, lootTable), LootContextParamSets.BLOCK)); + protected LootTable.Builder createSingleItemTableWithSilkTouchOrShears(Block p_124258_, ItemLike p_124259_) { + return createSilkTouchOrShearsDispatchTable(p_124258_, applyExplosionCondition(p_124258_, LootItem.lootTableItem(p_124259_))); + } } } \ No newline at end of file diff --git a/src/main/java/com/sammy/malum/data/block/MalumBlockStates.java b/src/main/java/com/sammy/malum/data/block/MalumBlockStates.java index 9c8debf01..4973a38fb 100644 --- a/src/main/java/com/sammy/malum/data/block/MalumBlockStates.java +++ b/src/main/java/com/sammy/malum/data/block/MalumBlockStates.java @@ -156,8 +156,7 @@ protected void registerStatesAndModels() { setTexturePath("ores/"); BlockStateSmithTypes.FULL_BLOCK.act(data, CTHONIC_GOLD_ORE, NATURAL_QUARTZ_ORE, DEEPSLATE_QUARTZ_ORE, SOULSTONE_ORE, DEEPSLATE_SOULSTONE_ORE); BlockStateSmithTypes.CUSTOM_MODEL.act(data, this::simpleBlock, this::layeredBlockModel, BLAZING_QUARTZ_ORE, BRILLIANT_STONE, BRILLIANT_DEEPSLATE); - BlockStateSmithTypes.CUSTOM_MODEL.act(data, ItemModelSmithTypes.GENERATED_ITEM, this::directionalBlock, fromFunction(models()::cross), NATURAL_QUARTZ_CLUSTER); - BlockStateSmithTypes.CUSTOM_MODEL.act(data, ItemModelSmithTypes.BLOCK_TEXTURE_ITEM, this::directionalBlock, fromFunction(models()::cross), CTHONIC_GOLD_CLUSTER); + BlockStateSmithTypes.CUSTOM_MODEL.act(data, ItemModelSmithTypes.GENERATED_ITEM, this::directionalBlock, fromFunction(models()::cross), NATURAL_QUARTZ_CLUSTER, CTHONIC_GOLD_CLUSTER); setTexturePath("storage_blocks/"); BlockStateSmithTypes.FULL_BLOCK.act(data, diff --git a/src/main/java/com/sammy/malum/data/recipe/MalumVanillaRecipes.java b/src/main/java/com/sammy/malum/data/recipe/MalumVanillaRecipes.java index 8cae61b7a..b13fd3084 100644 --- a/src/main/java/com/sammy/malum/data/recipe/MalumVanillaRecipes.java +++ b/src/main/java/com/sammy/malum/data/recipe/MalumVanillaRecipes.java @@ -125,8 +125,6 @@ protected static void buildRecipes(Consumer consumer) { blastingWithCount(Ingredient.of(ItemRegistry.SOULSTONE_ORE.get()), RecipeCategory.MISC, ItemRegistry.PROCESSED_SOULSTONE.get(), 2, 0.25f, 100).unlockedBy("has_soulstone", has(ItemRegistry.RAW_SOULSTONE.get())).save(consumer, malumPath("soulstone_from_blasting")); smeltingWithCount(Ingredient.of(ItemRegistry.DEEPSLATE_SOULSTONE_ORE.get()), RecipeCategory.MISC, ItemRegistry.PROCESSED_SOULSTONE.get(), 2, 0.25f, 200).unlockedBy("has_soulstone", has(ItemRegistry.RAW_SOULSTONE.get())).save(consumer, malumPath("soulstone_from_deepslate_smelting")); blastingWithCount(Ingredient.of(ItemRegistry.DEEPSLATE_SOULSTONE_ORE.get()), RecipeCategory.MISC, ItemRegistry.PROCESSED_SOULSTONE.get(), 2, 0.25f, 100).unlockedBy("has_soulstone", has(ItemRegistry.RAW_SOULSTONE.get())).save(consumer, malumPath("soulstone_from_deepslate_blasting")); - smelting(Ingredient.of(ItemRegistry.BLOCK_OF_CTHONIC_GOLD.get()), RecipeCategory.MISC, ItemRegistry.CTHONIC_GOLD.get(), 2.0f, 200).unlockedBy("has_cthonic_gold", has(ItemRegistry.CTHONIC_GOLD.get())).save(consumer, malumPath("cthonic_gold_from_smelting")); - blasting(Ingredient.of(ItemRegistry.BLOCK_OF_CTHONIC_GOLD.get()), RecipeCategory.MISC, ItemRegistry.CTHONIC_GOLD.get(), 2.0f, 100).unlockedBy("has_cthonic_gold", has(ItemRegistry.CTHONIC_GOLD.get())).save(consumer, malumPath("cthonic_gold_from_blasting")); smeltingWithCount(Ingredient.of(ItemRegistry.CLUSTER_OF_BRILLIANCE.get()), RecipeCategory.MISC, ItemRegistry.CHUNK_OF_BRILLIANCE.get(), 2, 1, 200).unlockedBy("has_brilliance", has(ItemRegistry.CLUSTER_OF_BRILLIANCE.get())).save(consumer, malumPath("brilliance_from_raw_smelting")); blastingWithCount(Ingredient.of(ItemRegistry.CLUSTER_OF_BRILLIANCE.get()), RecipeCategory.MISC, ItemRegistry.CHUNK_OF_BRILLIANCE.get(), 2, 1, 100).unlockedBy("has_brilliance", has(ItemRegistry.CLUSTER_OF_BRILLIANCE.get())).save(consumer, malumPath("brilliance_from_raw_blasting")); @@ -151,6 +149,12 @@ protected static void buildRecipes(Consumer consumer) { shaped(RecipeCategory.MISC, ItemRegistry.BLOCK_OF_SOULSTONE.get()).define('#', ItemRegistry.PROCESSED_SOULSTONE.get()).pattern("###").pattern("###").pattern("###").unlockedBy("has_soulstone", has(ItemRegistry.RAW_SOULSTONE.get())).save(consumer, malumPath("block_of_soulstone")); shapeless(RecipeCategory.MISC, ItemRegistry.PROCESSED_SOULSTONE.get(), 9).requires(ItemRegistry.BLOCK_OF_SOULSTONE.get()).unlockedBy("has_soulstone", has(ItemRegistry.RAW_SOULSTONE.get())).save(consumer, malumPath("soulstone_from_block")); + shaped(RecipeCategory.MISC, ItemRegistry.BLOCK_OF_CTHONIC_GOLD.get()).define('#', ItemRegistry.CTHONIC_GOLD.get()).pattern("###").pattern("###").pattern("###").unlockedBy("has_cthonic_gold", has(ItemRegistry.CTHONIC_GOLD.get())).save(consumer, malumPath("block_of_cthonic_gold")); + shapeless(RecipeCategory.MISC, ItemRegistry.CTHONIC_GOLD.get(), 9).requires(ItemRegistry.BLOCK_OF_CTHONIC_GOLD.get()).unlockedBy("has_cthonic_gold", has(ItemRegistry.CTHONIC_GOLD.get())).save(consumer, malumPath("cthonic_gold_from_block")); + + shapeless(RecipeCategory.MISC, ItemRegistry.CTHONIC_GOLD.get()).requires(ItemRegistry.CTHONIC_GOLD_FRAGMENT.get(), 8).unlockedBy("has_cthonic_gold", has(ItemRegistry.CTHONIC_GOLD.get())).save(consumer, malumPath("cthonic_gold_from_fragment")); + shapeless(RecipeCategory.MISC, ItemRegistry.CTHONIC_GOLD_FRAGMENT.get(), 8).requires(ItemRegistry.CTHONIC_GOLD.get()).unlockedBy("has_cthonic_gold", has(ItemRegistry.CTHONIC_GOLD.get())).save(consumer, malumPath("cthonic_gold_fragment")); + //COMPACT BLOCKS shaped(RecipeCategory.MISC, ItemRegistry.BLOCK_OF_ROTTING_ESSENCE.get()).define('#', ItemRegistry.ROTTING_ESSENCE.get()).pattern("###").pattern("###").pattern("###").unlockedBy("has_rotting_essence", has(ItemRegistry.ROTTING_ESSENCE.get())).save(consumer, malumPath("block_of_rotting_essence")); shapeless(RecipeCategory.MISC, ItemRegistry.ROTTING_ESSENCE.get(), 9).requires(ItemRegistry.BLOCK_OF_ROTTING_ESSENCE.get()).unlockedBy("has_rotting_essence", has(ItemRegistry.ROTTING_ESSENCE.get())).save(consumer, malumPath("rotting_essence_from_block")); diff --git a/src/main/java/com/sammy/malum/registry/common/block/BlockRegistry.java b/src/main/java/com/sammy/malum/registry/common/block/BlockRegistry.java index b005ae046..5518067e3 100644 --- a/src/main/java/com/sammy/malum/registry/common/block/BlockRegistry.java +++ b/src/main/java/com/sammy/malum/registry/common/block/BlockRegistry.java @@ -332,8 +332,8 @@ public class BlockRegistry { public static final RegistryObject NATURAL_QUARTZ_CLUSTER = BLOCKS.register("natural_quartz_cluster", () -> new AmethystClusterBlock(6, 3, MalumBlockProperties.NATURAL_QUARTZ_CLUSTER().setCutoutRenderType())); public static final RegistryObject CTHONIC_GOLD_ORE = BLOCKS.register("cthonic_gold_ore", () -> new DropExperienceBlock(MalumBlockProperties.CTHONIC_GOLD_ORE(), UniformInt.of(10, 100))); - public static final RegistryObject CTHONIC_GOLD_CLUSTER = BLOCKS.register("cthonic_gold_cluster", () -> new AmethystClusterBlock(4, 3, MalumBlockProperties.CTHONIC_GOLD_ORE().setCutoutRenderType())); - public static final RegistryObject BLOCK_OF_CTHONIC_GOLD = BLOCKS.register("block_of_cthonic_gold", () -> new Block(MalumBlockProperties.CTHONIC_GOLD_ORE())); + public static final RegistryObject CTHONIC_GOLD_CLUSTER = BLOCKS.register("cthonic_gold_cluster", () -> new AmethystClusterBlock(4, 3, MalumBlockProperties.CTHONIC_GOLD_CLUSTER().setCutoutRenderType())); + public static final RegistryObject BLOCK_OF_CTHONIC_GOLD = BLOCKS.register("block_of_cthonic_gold", () -> new Block(MalumBlockProperties.CTHONIC_GOLD_BLOCK())); public static final RegistryObject BRILLIANT_STONE = BLOCKS.register("brilliant_stone", () -> new DropExperienceBlock(MalumBlockProperties.BRILLIANCE_ORE(false).setCutoutRenderType(), UniformInt.of(14, 18))); public static final RegistryObject BRILLIANT_DEEPSLATE = BLOCKS.register("brilliant_deepslate", () -> new DropExperienceBlock(MalumBlockProperties.BRILLIANCE_ORE(true).setCutoutRenderType(), UniformInt.of(16, 26))); diff --git a/src/main/java/com/sammy/malum/registry/common/block/MalumBlockProperties.java b/src/main/java/com/sammy/malum/registry/common/block/MalumBlockProperties.java index a047876c0..a6c1eb1d5 100644 --- a/src/main/java/com/sammy/malum/registry/common/block/MalumBlockProperties.java +++ b/src/main/java/com/sammy/malum/registry/common/block/MalumBlockProperties.java @@ -161,6 +161,24 @@ public static LodestoneBlockProperties CTHONIC_GOLD_ORE() { .sound(SoundRegistry.CTHONIC_GOLD); } + public static LodestoneBlockProperties CTHONIC_GOLD_CLUSTER() { + return new LodestoneBlockProperties() + .needsPickaxe() + .requiresCorrectToolForDrops() + .strength(4f, 9999f) + .sound(SoundRegistry.CTHONIC_GOLD); + } + + public static LodestoneBlockProperties CTHONIC_GOLD_BLOCK() { + return new LodestoneBlockProperties() + .addTag(Tags.Blocks.STORAGE_BLOCKS) + .addTag(BlockTags.BEACON_BASE_BLOCKS) + .needsPickaxe() + .requiresCorrectToolForDrops() + .strength(10f, 9999f) + .sound(SoundRegistry.CTHONIC_GOLD); + } + public static LodestoneBlockProperties NATURAL_QUARTZ_CLUSTER() { return new LodestoneBlockProperties() .needsPickaxe() diff --git a/src/main/java/com/sammy/malum/registry/common/item/ItemRegistry.java b/src/main/java/com/sammy/malum/registry/common/item/ItemRegistry.java index 83704697e..25943ac76 100644 --- a/src/main/java/com/sammy/malum/registry/common/item/ItemRegistry.java +++ b/src/main/java/com/sammy/malum/registry/common/item/ItemRegistry.java @@ -378,7 +378,6 @@ public static RegistryObject register(String name, Item.Prop public static final RegistryObject NATURAL_QUARTZ = register("natural_quartz", DEFAULT_PROPERTIES(), (p) -> new ItemNameBlockItem(BlockRegistry.NATURAL_QUARTZ_CLUSTER.get(), p)); public static final RegistryObject CTHONIC_GOLD_ORE = register("cthonic_gold_ore", DEFAULT_PROPERTIES(), (p) -> new BlockItem(BlockRegistry.CTHONIC_GOLD_ORE.get(), p)); - public static final RegistryObject CTHONIC_GOLD_CLUSTER = register("cthonic_gold_cluster", DEFAULT_PROPERTIES(), (p) -> new BlockItem(BlockRegistry.CTHONIC_GOLD_CLUSTER.get(), p)); //endregion //region crafting blocks @@ -400,6 +399,7 @@ public static RegistryObject register(String name, Item.Prop public static final RegistryObject GRIM_TALC = register("grim_talc", DEFAULT_PROPERTIES(), Item::new); public static final RegistryObject ASTRAL_WEAVE = register("astral_weave", DEFAULT_PROPERTIES(), Item::new); public static final RegistryObject WARP_FLUX = register("warp_flux", DEFAULT_PROPERTIES(), Item::new); + public static final RegistryObject CTHONIC_GOLD_FRAGMENT = register("cthonic_gold_fragment", DEFAULT_PROPERTIES(), (p) -> new ItemNameBlockItem(BlockRegistry.CTHONIC_GOLD_CLUSTER.get(), p)); public static final RegistryObject CTHONIC_GOLD = register("cthonic_gold", DEFAULT_PROPERTIES().rarity(UNCOMMON), Item::new); public static final RegistryObject HEX_ASH = register("hex_ash", DEFAULT_PROPERTIES(), Item::new); public static final RegistryObject ALCHEMICAL_CALX = register("alchemical_calx", DEFAULT_PROPERTIES(), Item::new); diff --git a/src/main/java/com/sammy/malum/registry/common/worldgen/ConfiguredFeatureRegistry.java b/src/main/java/com/sammy/malum/registry/common/worldgen/ConfiguredFeatureRegistry.java index 93cd8d5bf..c2a42f651 100644 --- a/src/main/java/com/sammy/malum/registry/common/worldgen/ConfiguredFeatureRegistry.java +++ b/src/main/java/com/sammy/malum/registry/common/worldgen/ConfiguredFeatureRegistry.java @@ -54,8 +54,8 @@ public class ConfiguredFeatureRegistry { OreConfiguration.target(DEEPSLATE_ORE_REPLACEABLES, BlockRegistry.DEEPSLATE_QUARTZ_ORE.get().defaultBlockState())); public static final List CTHONIC_GOLD_TARGET_LIST = List.of( - OreConfiguration.target(DEEPSLATE_ORE_REPLACEABLES, Blocks.DEEPSLATE_GOLD_ORE.defaultBlockState()), - OreConfiguration.target(new BlockMatchTest(Blocks.DEEPSLATE_GOLD_ORE), BlockRegistry.CTHONIC_GOLD_ORE.get().defaultBlockState())); + OreConfiguration.target(DEEPSLATE_ORE_REPLACEABLES, BlockRegistry.CTHONIC_GOLD_ORE.get().defaultBlockState()), + OreConfiguration.target(DEEPSLATE_ORE_REPLACEABLES, Blocks.DEEPSLATE_GOLD_ORE.defaultBlockState())); public static final List BLAZING_QUARTZ_TARGET_LIST = List.of( OreConfiguration.target(new TagMatchTest(BlockTags.BASE_STONE_NETHER), BlockRegistry.BLAZING_QUARTZ_ORE.get().defaultBlockState())); @@ -65,7 +65,7 @@ public static void bootstrap(BootstapContext> context) { context.register(ConfiguredFeatureRegistry.CONFIGURED_SOULSTONE_ORE, addOreConfig(SOULSTONE_TARGET_LIST, 8)); context.register(ConfiguredFeatureRegistry.CONFIGURED_BRILLIANT_ORE, addOreConfig(BRILLIANT_TARGET_LIST, 4)); context.register(ConfiguredFeatureRegistry.CONFIGURED_NATURAL_QUARTZ_ORE, addOreConfig(NATURAL_QUARTZ_TARGET_LIST, 5)); - context.register(ConfiguredFeatureRegistry.CONFIGURED_CTHONIC_GOLD_ORE_FEATURE, addOreConfig(FeatureRegistry.CTHONIC_GOLD_ORE.get(), CTHONIC_GOLD_TARGET_LIST, 16)); + context.register(ConfiguredFeatureRegistry.CONFIGURED_CTHONIC_GOLD_ORE_FEATURE, addOreConfig(FeatureRegistry.CTHONIC_GOLD_ORE.get(), CTHONIC_GOLD_TARGET_LIST, 8)); context.register(ConfiguredFeatureRegistry.CONFIGURED_BLAZING_QUARTZ_ORE, addOreConfig(BLAZING_QUARTZ_TARGET_LIST, 14)); context.register(ConfiguredFeatureRegistry.CONFIGURED_RUNEWOOD_TREE, addTreeConfig(FeatureRegistry.RUNEWOOD_TREE.get())); diff --git a/src/main/java/com/sammy/malum/registry/common/worldgen/FeatureRegistry.java b/src/main/java/com/sammy/malum/registry/common/worldgen/FeatureRegistry.java index 8a385f185..ff3b53987 100644 --- a/src/main/java/com/sammy/malum/registry/common/worldgen/FeatureRegistry.java +++ b/src/main/java/com/sammy/malum/registry/common/worldgen/FeatureRegistry.java @@ -16,5 +16,5 @@ public class FeatureRegistry { public static final RegistryObject WEEPING_WELL = FEATURE_TYPES.register("weeping_well", WeepingWellFeature::new); public static final RegistryObject RUNEWOOD_TREE = FEATURE_TYPES.register("runewood_tree", RunewoodTreeFeature::new); public static final RegistryObject SOULWOOD_TREE = FEATURE_TYPES.register("soulwood_tree", SoulwoodTreeFeature::new); - public static final RegistryObject CTHONIC_GOLD_ORE = FEATURE_TYPES.register("cthonic_gold_ore", () -> new CthonicGoldOreFeature(OreConfiguration.CODEC)); + public static final RegistryObject CTHONIC_GOLD_ORE = FEATURE_TYPES.register("cthonic_gold_ore", () -> new CthonicGoldOreFeature(OreConfiguration.CODEC)); } \ No newline at end of file diff --git a/src/main/java/com/sammy/malum/registry/common/worldgen/PlacedFeatureRegistry.java b/src/main/java/com/sammy/malum/registry/common/worldgen/PlacedFeatureRegistry.java index 948c6cde6..fc9ab8425 100644 --- a/src/main/java/com/sammy/malum/registry/common/worldgen/PlacedFeatureRegistry.java +++ b/src/main/java/com/sammy/malum/registry/common/worldgen/PlacedFeatureRegistry.java @@ -11,8 +11,9 @@ import net.minecraft.world.level.levelgen.VerticalAnchor; import net.minecraft.world.level.levelgen.feature.ConfiguredFeature; import net.minecraft.world.level.levelgen.placement.*; +import team.lodestar.lodestone.systems.worldgen.*; -import java.util.List; +import java.util.*; public class PlacedFeatureRegistry { @@ -27,7 +28,6 @@ public class PlacedFeatureRegistry { public static final ResourceKey QUARTZ_GEODE_FEATURE = registerKey("quartz_geode"); public static final ResourceKey DEEPSLATE_QUARTZ_GEODE_FEATURE = registerKey("deepslate_quartz_geode"); - public static final ResourceKey CTHONIC_GOLD_GEODE_FEATURE = registerKey("rare_earth_geode"); public static ResourceKey registerKey(String name) { return ResourceKey.create(Registries.PLACED_FEATURE, MalumMod.malumPath(name)); @@ -38,14 +38,14 @@ public static void bootstrap(BootstapContext context) { context.register(ORE_SOULSTONE, addOreFeature(features.getOrThrow(ConfiguredFeatureRegistry.CONFIGURED_SOULSTONE_ORE), -64, 100, 3)); context.register(ORE_BRILLIANT, addOreFeature(features.getOrThrow(ConfiguredFeatureRegistry.CONFIGURED_BRILLIANT_ORE), -64, 40, 3)); context.register(ORE_NATURAL_QUARTZ, addOreFeature(features.getOrThrow(ConfiguredFeatureRegistry.CONFIGURED_NATURAL_QUARTZ_ORE), -64, 10, 2)); - context.register(ORE_CTHONIC_GOLD, addOreFeature(features.getOrThrow(ConfiguredFeatureRegistry.CONFIGURED_CTHONIC_GOLD_ORE_FEATURE), -64, 40, 2)); context.register(ORE_BLAZING_QUARTZ, addOreFeature(features.getOrThrow(ConfiguredFeatureRegistry.CONFIGURED_BLAZING_QUARTZ_ORE), -16, 112, 16)); + context.register(ORE_CTHONIC_GOLD, addOreFeature(features.getOrThrow(ConfiguredFeatureRegistry.CONFIGURED_CTHONIC_GOLD_ORE_FEATURE), -48, -0, 1, RarityFilter.onAverageOnceEvery(4))); context.register(RUNEWOOD_TREE, new PlacedFeature(features.getOrThrow(ConfiguredFeatureRegistry.CONFIGURED_RUNEWOOD_TREE), ImmutableList.builder().add( PlacementUtils.HEIGHTMAP, - RarityFilter.onAverageOnceEvery(10), + RarityFilter.onAverageOnceEvery(5), InSquarePlacement.spread(), CountPlacement.of(3) ).build() @@ -56,7 +56,7 @@ public static void bootstrap(BootstapContext context) { new PlacedFeature(features.getOrThrow(ConfiguredFeatureRegistry.CONFIGURED_RUNEWOOD_TREE), ImmutableList.builder().add( PlacementUtils.HEIGHTMAP, - RarityFilter.onAverageOnceEvery(5), + RarityFilter.onAverageOnceEvery(10), InSquarePlacement.spread(), CountPlacement.of(3) ).build() @@ -90,12 +90,22 @@ public static void bootstrap(BootstapContext context) { } + private static PlacedFeature addOreFeature(Holder> configureFeature, int minHeight, int maxHeight, int count, PlacementModifier... extraModifiers) { + final List modifiers = ImmutableList.builder().add( + HeightRangePlacement.triangle(VerticalAnchor.absolute(minHeight), VerticalAnchor.absolute(maxHeight)), + CountPlacement.of(count), + InSquarePlacement.spread(), + BiomeFilter.biome()) + .add(extraModifiers) + .build(); + return new PlacedFeature(configureFeature, modifiers); + } + private static PlacedFeature addOreFeature(Holder> configureFeature, int minHeight, int maxHeight, int count) { return new PlacedFeature(configureFeature, List.of( HeightRangePlacement.triangle(VerticalAnchor.absolute(minHeight), VerticalAnchor.absolute(maxHeight)), CountPlacement.of(count), InSquarePlacement.spread(), - BiomeFilter.biome()) - ); + BiomeFilter.biome())); } } diff --git a/src/main/resources/assets/malum/textures/item/cthonic_gold.png b/src/main/resources/assets/malum/textures/item/cthonic_gold.png index 62fee01db5023d4a189c65459abe81983e1e559e..012cbffd68081268e32a2dbfd46839cd797e942f 100644 GIT binary patch delta 514 zcmV+d0{#7g1e^qrB!A&aL_t(IPh(`D5HMoXzbPf~KTQ18gJ%padro3i2U3F}0n+T6 z@PL6??Jol>Z$871vr`ya8`y9ff?`08i}`;u1t|uPwz~|hqURZY95rFsy+DCs6N50r z>C=}PE?&fR35o$hS_=RFs~a*13kx&UO6_G3a}xmj1Z2o@QGX4FZQJ%?7y>r{WcyWK zDFzJ<4X`E=5fL!`e)}qhRI67E1(yvN7;m0uSa({Tr1}!Uoz`$Xg!w?j;1sp#6 z_a0@qd;dCEFWe-MA-VDl;1CxT6=k?_;|9Y7U5Kq9u%k*DEcfu?TQL9Lof}|7Py!L; zjptK7gS`M!X#W2h11MVcr7nOqU3_N1F!>?GQ&HIY-7rC1F#D=zh(ey1_2NoSu@t83^L^6cTNT+6-asj z0gwwo09`Xy17Mnz6*b`*3MK{%c|_!5$xO(S#IOOvtk)4l@plgZ0000)WkxB_W!{zfwA9+JU&Ib~$-FQ8kL4Qlf)31B{zP@9C=m2W{ z)aroCSYbfC?~ls_u6UJKfp9pCGFimD0z{+0%5cCi z4;?VH_`*ZGpMMy`s8k6>QCOtKT-hgooS5@z>P5pP45Wd<$w z29Q+TiN@wNp3m;~9&YZ=S*w!>(v=RLxF84+MG=z)v8oiCeObI03@ZG7do42L+Yrgd z!%T!NP@+ebQ0jD`&~eNnzvRYrFlNdWKnI9geUD6WMPMyC6p~OcfMJ7P3DM_gqXnXB z2Z<`S9k{uJRT(U%pmn_1^e7X=|B{T%?AUprpbjX0icJBUC@UjRzfjsYZSr3~*W@zA dZ~kTd2_B@_5eU(?WdHyG07*qoM6N<$f&d~F>?QyJ diff --git a/src/main/resources/assets/malum/textures/item/cthonic_gold_fragment.png b/src/main/resources/assets/malum/textures/item/cthonic_gold_fragment.png new file mode 100644 index 0000000000000000000000000000000000000000..be17a36fd5242715bbf32232a1446a080281993c GIT binary patch literal 348 zcmV-i0i*tjP){4rj)?{t_cqqnAQF=G(~YTkYoTzv+rad1_q7< z28JIC7#_8^Fr*weVA#ETJ%)uC0w8DCE&C33`QKa24AV}=FuZy5hT+Va8^jw>-SCT{ zX{!fAo%ar~0U!|aaSB7>n*R*zu024p6osR&Z~ouZRF|PvYA?gZX9f(QFxb67fk9vD z0@x6u4Dj-DVh|A#f!hi)X#QIUhD2cohD{8@4Ey&UWw?9)I^1HcF3{A}1pC|a^$oCQ zVPRpgfp6cwWw>