From 23f109d97f2499a82b328d3abd5bdfa9d9f9f127 Mon Sep 17 00:00:00 2001 From: Karthi Suresh <75553966+JuiceyBeans@users.noreply.github.com> Date: Tue, 3 Sep 2024 14:36:01 +0400 Subject: [PATCH 1/2] Add config toggle for fortune on ores --- src/generated/resources/assets/gtceu/lang/en_ud.json | 1 + src/generated/resources/assets/gtceu/lang/en_us.json | 1 + .../java/com/gregtechceu/gtceu/config/ConfigHolder.java | 3 +++ src/main/java/com/gregtechceu/gtceu/core/MixinHelpers.java | 7 +++++-- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/generated/resources/assets/gtceu/lang/en_ud.json b/src/generated/resources/assets/gtceu/lang/en_ud.json index 842605949e..085a944a79 100644 --- a/src/generated/resources/assets/gtceu/lang/en_ud.json +++ b/src/generated/resources/assets/gtceu/lang/en_ud.json @@ -2301,6 +2301,7 @@ "config.gtceu.option.nerfWoodCrafting": "buıʇɟɐɹƆpooMɟɹǝu", "config.gtceu.option.orderedAssemblyLineFluids": "spınןℲǝuıꞀʎןqɯǝssⱯpǝɹǝpɹo", "config.gtceu.option.orderedAssemblyLineItems": "sɯǝʇIǝuıꞀʎןqɯǝssⱯpǝɹǝpɹo", + "config.gtceu.option.oreFortuneDrops": "sdoɹᗡǝunʇɹoℲǝɹo", "config.gtceu.option.oreGenerationChunkCacheSize": "ǝzıSǝɥɔɐƆʞunɥƆuoıʇɐɹǝuǝ⅁ǝɹo", "config.gtceu.option.oreIndicatorChunkCacheSize": "ǝzıSǝɥɔɐƆʞunɥƆɹoʇɐɔıpuIǝɹo", "config.gtceu.option.oreVeinGridSize": "ǝzıSpıɹ⅁uıǝΛǝɹo", diff --git a/src/generated/resources/assets/gtceu/lang/en_us.json b/src/generated/resources/assets/gtceu/lang/en_us.json index c0229b1aa0..710e6cc329 100644 --- a/src/generated/resources/assets/gtceu/lang/en_us.json +++ b/src/generated/resources/assets/gtceu/lang/en_us.json @@ -2301,6 +2301,7 @@ "config.gtceu.option.nerfWoodCrafting": "nerfWoodCrafting", "config.gtceu.option.orderedAssemblyLineFluids": "orderedAssemblyLineFluids", "config.gtceu.option.orderedAssemblyLineItems": "orderedAssemblyLineItems", + "config.gtceu.option.oreFortuneDrops": "oreFortuneDrops", "config.gtceu.option.oreGenerationChunkCacheSize": "oreGenerationChunkCacheSize", "config.gtceu.option.oreIndicatorChunkCacheSize": "oreIndicatorChunkCacheSize", "config.gtceu.option.oreVeinGridSize": "oreVeinGridSize", diff --git a/src/main/java/com/gregtechceu/gtceu/config/ConfigHolder.java b/src/main/java/com/gregtechceu/gtceu/config/ConfigHolder.java index 5f469a6942..017a0c0b83 100644 --- a/src/main/java/com/gregtechceu/gtceu/config/ConfigHolder.java +++ b/src/main/java/com/gregtechceu/gtceu/config/ConfigHolder.java @@ -553,6 +553,9 @@ public static class NanoSaber { public static class GameplayConfigs { + @Configurable + @Configurable.Comment({ "Enable fortune for ore drops", "Default: false" }) + public boolean oreFortuneDrops = false; @Configurable @Configurable.Comment({ "Enable hazardous materials", "Default: true" }) public boolean hazardsEnabled = true; diff --git a/src/main/java/com/gregtechceu/gtceu/core/MixinHelpers.java b/src/main/java/com/gregtechceu/gtceu/core/MixinHelpers.java index 2072bda138..a5ce42233e 100644 --- a/src/main/java/com/gregtechceu/gtceu/core/MixinHelpers.java +++ b/src/main/java/com/gregtechceu/gtceu/core/MixinHelpers.java @@ -213,8 +213,11 @@ public static void generateGTDynamicLoot(Map lootTa LootItem.lootTableItem(dropItem.getItem()) .apply(SetItemCountFunction .setCount(ConstantValue.exactly(oreMultiplier))))); - // .apply(ApplyBonusCount.addOreBonusCount(Enchantments.BLOCK_FORTUNE)))); //disable fortune for - // balance reasons. (for now, until we can think of a better solution.) + if (ConfigHolder.INSTANCE.gameplay.oreFortuneDrops) { + builder.apply(ApplyBonusCount.addOreBonusCount(Enchantments.BLOCK_FORTUNE)); // disable fortune + // by + // default for balance reasons. (for now, until we can think of a better solution.) + } Supplier outputDustMat = type.material(); LootPool.Builder pool = LootPool.lootPool(); From 4b673251d6b98e8dc5a42475681fb1ef4f5e43e6 Mon Sep 17 00:00:00 2001 From: Karthi Suresh <75553966+JuiceyBeans@users.noreply.github.com> Date: Tue, 3 Sep 2024 14:48:17 +0400 Subject: [PATCH 2/2] Spotless my #1 opp --- src/main/java/com/gregtechceu/gtceu/core/MixinHelpers.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/gregtechceu/gtceu/core/MixinHelpers.java b/src/main/java/com/gregtechceu/gtceu/core/MixinHelpers.java index a5ce42233e..40422ecb48 100644 --- a/src/main/java/com/gregtechceu/gtceu/core/MixinHelpers.java +++ b/src/main/java/com/gregtechceu/gtceu/core/MixinHelpers.java @@ -213,10 +213,10 @@ public static void generateGTDynamicLoot(Map lootTa LootItem.lootTableItem(dropItem.getItem()) .apply(SetItemCountFunction .setCount(ConstantValue.exactly(oreMultiplier))))); + // disable fortune by default for balance reasons. + // (for now, until we can think of a better solution.) if (ConfigHolder.INSTANCE.gameplay.oreFortuneDrops) { - builder.apply(ApplyBonusCount.addOreBonusCount(Enchantments.BLOCK_FORTUNE)); // disable fortune - // by - // default for balance reasons. (for now, until we can think of a better solution.) + builder.apply(ApplyBonusCount.addOreBonusCount(Enchantments.BLOCK_FORTUNE)); } Supplier outputDustMat = type.material();