From f3bc10cdc5a085368a9648dfbc672584057d546b Mon Sep 17 00:00:00 2001 From: YoungOnion <39562198+YoungOnionMC@users.noreply.github.com> Date: Sun, 26 May 2024 22:11:26 -0600 Subject: [PATCH 1/4] Raw Ore drops updated --- .../recipe/generated/OreRecipeHandler.java | 26 ++++++++++++++----- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/gregtechceu/gtceu/data/recipe/generated/OreRecipeHandler.java b/src/main/java/com/gregtechceu/gtceu/data/recipe/generated/OreRecipeHandler.java index 45723db4bd..2c0b6288cc 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/recipe/generated/OreRecipeHandler.java +++ b/src/main/java/com/gregtechceu/gtceu/data/recipe/generated/OreRecipeHandler.java @@ -152,15 +152,27 @@ public static void processRawOre(TagPrefix orePrefix, Material material, OreProp } builder.save(provider); - MACERATOR_RECIPES.recipeBuilder("macerate_" + orePrefix.name + "_" + material.getName() + "_ore_to_crushed_ore") + GTRecipeBuilder builder2 = MACERATOR_RECIPES.recipeBuilder("macerate_" + orePrefix.name + "_" + material.getName() + "_ore_to_crushed_ore") .inputItems(orePrefix, material) - .outputItems(crushedStack) - .chancedOutput(crushedStack, 5000, 750) - .chancedOutput(crushedStack, 2500, 500) - .chancedOutput(crushedStack, 1250, 250) + .outputItems(crushedStack.getItem(), 2) .EUt(2) - .duration(400) - .save(provider); + .duration(400); + + Material byproductMaterial = GTUtil.selectItemInList(0, material, property.getOreByProducts(), Material.class); + ItemStack byproductStack = ChemicalHelper.get(gem, byproductMaterial); + if (byproductStack.isEmpty()) { + byproductStack = ChemicalHelper.get(dust, byproductMaterial); + } + builder2.chancedOutput(byproductStack, 1000, 300); + + for (MaterialStack secondaryMaterial : ore.secondaryMaterials()) { + if (secondaryMaterial.material().hasProperty(PropertyKey.DUST)) { + ItemStack dustStack = ChemicalHelper.getGem(secondaryMaterial); + builder2.chancedOutput(dustStack, 500, 100); + break; + } + } + builder2.save(provider); } //do not try to add smelting recipes for materials which require blast furnace, or don't have smelting recipes at all. From 66590a3572ed29aa4fc2900505870da86e452903 Mon Sep 17 00:00:00 2001 From: YoungOnion <39562198+YoungOnionMC@users.noreply.github.com> Date: Sun, 26 May 2024 22:48:04 -0600 Subject: [PATCH 2/4] Change recipe map icons to use lv variant instead of steam --- .../com/gregtechceu/gtceu/common/data/GTRecipeTypes.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/com/gregtechceu/gtceu/common/data/GTRecipeTypes.java b/src/main/java/com/gregtechceu/gtceu/common/data/GTRecipeTypes.java index 6c380e0a93..224969bac6 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/data/GTRecipeTypes.java +++ b/src/main/java/com/gregtechceu/gtceu/common/data/GTRecipeTypes.java @@ -91,6 +91,7 @@ public class GTRecipeTypes { public final static GTRecipeType ALLOY_SMELTER_RECIPES = register("alloy_smelter", ELECTRIC).setMaxIOSize(2, 1, 0, 0).setEUIO(IO.IN) .setSlotOverlay(false, false, GuiTextures.FURNACE_OVERLAY_1) .setProgressBar(GuiTextures.PROGRESS_BAR_ARROW, LEFT_TO_RIGHT) + .setIconSupplier(() -> GTMachines.ALLOY_SMELTER[GTValues.LV].asStack()) .setSteamProgressBar(GuiTextures.PROGRESS_BAR_ARROW_STEAM, LEFT_TO_RIGHT) .setSound(GTSoundEntries.FURNACE); @@ -133,6 +134,7 @@ public class GTRecipeTypes { .setSlotOverlay(false, false, GuiTextures.CRUSHED_ORE_OVERLAY) .setSlotOverlay(true, false, GuiTextures.DUST_OVERLAY) .setProgressBar(GuiTextures.PROGRESS_BAR_MACERATE, LEFT_TO_RIGHT) + .setIconSupplier(() -> GTMachines.MACERATOR[GTValues.LV].asStack()) .setSteamProgressBar(GuiTextures.PROGRESS_BAR_MACERATE_STEAM, LEFT_TO_RIGHT) .setSound(GTSoundEntries.MACERATOR); @@ -182,6 +184,7 @@ public class GTRecipeTypes { .prepareBuilder(recipeBuilder -> recipeBuilder.duration(200).EUt(2)) .setSlotOverlay(false, false, GuiTextures.COMPRESSOR_OVERLAY) .setProgressBar(GuiTextures.PROGRESS_BAR_COMPRESS, LEFT_TO_RIGHT) + .setIconSupplier(() -> GTMachines.COMPRESSOR[GTValues.LV].asStack()) .setSteamProgressBar(GuiTextures.PROGRESS_BAR_COMPRESS_STEAM, LEFT_TO_RIGHT) .setSound(GTSoundEntries.COMPRESSOR); @@ -243,6 +246,7 @@ public class GTRecipeTypes { .prepareBuilder(recipeBuilder -> recipeBuilder.duration(400).EUt(2)) .setSlotOverlay(false, false, GuiTextures.EXTRACTOR_OVERLAY) .setProgressBar(GuiTextures.PROGRESS_BAR_EXTRACT, LEFT_TO_RIGHT) + .setIconSupplier(() -> GTMachines.EXTRACTOR[GTValues.LV].asStack()) .setSteamProgressBar(GuiTextures.PROGRESS_BAR_EXTRACT_STEAM, LEFT_TO_RIGHT); public final static GTRecipeType EXTRUDER_RECIPES = register("extruder", ELECTRIC).setMaxIOSize(2, 1, 0, 0).setEUIO(IO.IN) @@ -276,6 +280,7 @@ public class GTRecipeTypes { public final static GTRecipeType FORGE_HAMMER_RECIPES = register("forge_hammer", ELECTRIC).setMaxIOSize(1, 1, 0, 0).setEUIO(IO.IN) .setSlotOverlay(false, false, GuiTextures.HAMMER_OVERLAY) .setProgressBar(GuiTextures.PROGRESS_BAR_HAMMER, UP_TO_DOWN) + .setIconSupplier(() -> GTMachines.FORGE_HAMMER[GTValues.LV].asStack()) .setSteamProgressBar(GuiTextures.PROGRESS_BAR_HAMMER_STEAM, UP_TO_DOWN) .setSound(GTSoundEntries.FORGE_HAMMER); @@ -384,6 +389,7 @@ public class GTRecipeTypes { .setSlotOverlay(false, false, GuiTextures.DUST_OVERLAY) .setSlotOverlay(true, false, GuiTextures.CRUSHED_ORE_OVERLAY) .setProgressBar(GuiTextures.PROGRESS_BAR_MACERATE, LEFT_TO_RIGHT) + .setIconSupplier(() -> GTMachines.ROCK_CRUSHER[GTValues.LV].asStack()) .setSteamProgressBar(GuiTextures.PROGRESS_BAR_MACERATE_STEAM, LEFT_TO_RIGHT) .prepareBuilder(recipeBuilder -> recipeBuilder.addCondition(RockBreakerCondition.INSTANCE)) .setUiBuilder((recipe, widgetGroup) -> { From a393703528255259be1ec357016585be933899f1 Mon Sep 17 00:00:00 2001 From: YoungOnion <39562198+YoungOnionMC@users.noreply.github.com> Date: Wed, 29 May 2024 00:34:46 -0600 Subject: [PATCH 3/4] moved ore drops back down to 1 no matter the ore multiplier, and gave raw ore the multiplier for processing, therefore making raw ore synonymous to ore blocks --- .../gregtechceu/gtceu/core/MixinHelpers.java | 2 +- .../recipe/generated/OreRecipeHandler.java | 22 +++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/gregtechceu/gtceu/core/MixinHelpers.java b/src/main/java/com/gregtechceu/gtceu/core/MixinHelpers.java index 0726f5d5b5..ee9a34a925 100644 --- a/src/main/java/com/gregtechceu/gtceu/core/MixinHelpers.java +++ b/src/main/java/com/gregtechceu/gtceu/core/MixinHelpers.java @@ -188,7 +188,7 @@ public static void generateGTDynamicLoot(Map lootTa LootTable.Builder builder = BlockLootSubProvider.createSilkTouchDispatchTable(block, BLOCK_LOOT.applyExplosionDecay(block, LootItem.lootTableItem(dropItem.getItem()) - .apply(SetItemCountFunction.setCount(UniformGenerator.between(1, Math.max(1, material.getProperty(PropertyKey.ORE).getOreMultiplier() * oreMultiplier)))))); + .apply(SetItemCountFunction.setCount(UniformGenerator.between(1, Math.max(1, oreMultiplier)))))); //.apply(ApplyBonusCount.addOreBonusCount(Enchantments.BLOCK_FORTUNE)))); //disable fortune for balance reasons. (for now, until we can think of a better solution.) Supplier outputDustMat = type.material(); diff --git a/src/main/java/com/gregtechceu/gtceu/data/recipe/generated/OreRecipeHandler.java b/src/main/java/com/gregtechceu/gtceu/data/recipe/generated/OreRecipeHandler.java index 2c0b6288cc..1827b6354e 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/recipe/generated/OreRecipeHandler.java +++ b/src/main/java/com/gregtechceu/gtceu/data/recipe/generated/OreRecipeHandler.java @@ -130,15 +130,15 @@ public static void processOre(TagPrefix orePrefix, Material material, OrePropert } public static void processRawOre(TagPrefix orePrefix, Material material, OreProperty property, Consumer provider) { - ItemStack crushedStack = ChemicalHelper.get(crushed, material); + ItemStack crushedStack = ChemicalHelper.get(crushed, material, material.getProperty(PropertyKey.ORE).getOreMultiplier()); ItemStack ingotStack; Material smeltingMaterial = property.getDirectSmeltResult() == null ? material : property.getDirectSmeltResult(); if (smeltingMaterial.hasProperty(PropertyKey.INGOT)) { - ingotStack = ChemicalHelper.get(ingot, smeltingMaterial); + ingotStack = ChemicalHelper.get(ingot, smeltingMaterial, material.getProperty(PropertyKey.ORE).getOreMultiplier()); } else if (smeltingMaterial.hasProperty(PropertyKey.GEM)) { - ingotStack = ChemicalHelper.get(gem, smeltingMaterial); + ingotStack = ChemicalHelper.get(gem, smeltingMaterial, material.getProperty(PropertyKey.ORE).getOreMultiplier()); } else { - ingotStack = ChemicalHelper.get(dust, smeltingMaterial); + ingotStack = ChemicalHelper.get(dust, smeltingMaterial, material.getProperty(PropertyKey.ORE).getOreMultiplier()); } if (!crushedStack.isEmpty()) { @@ -154,7 +154,7 @@ public static void processRawOre(TagPrefix orePrefix, Material material, OreProp GTRecipeBuilder builder2 = MACERATOR_RECIPES.recipeBuilder("macerate_" + orePrefix.name + "_" + material.getName() + "_ore_to_crushed_ore") .inputItems(orePrefix, material) - .outputItems(crushedStack.getItem(), 2) + .outputItems(GTUtil.copyAmount(crushedStack.getCount() * 2, crushedStack)) .EUt(2) .duration(400); @@ -179,9 +179,9 @@ public static void processRawOre(TagPrefix orePrefix, Material material, OreProp if (!ingotStack.isEmpty() && doesMaterialUseNormalFurnace(smeltingMaterial) && !orePrefix.isIgnored(material)) { float xp = Math.round(((1 + property.getOreMultiplier() * 0.33f) / 3) * 10f) / 10f; VanillaRecipeHelper.addSmeltingRecipe(provider, "smelt_" + orePrefix.name + "_" + material.getName() + "_ore_to_ingot", - ChemicalHelper.getTag(orePrefix, material), ingotStack, xp); + ChemicalHelper.getTag(orePrefix, material), GTUtil.copyAmount(ingotStack.getCount(), ingotStack), xp); VanillaRecipeHelper.addBlastingRecipe(provider, "smelt_" + orePrefix.name + "_" + material.getName() + "_ore_to_ingot", - ChemicalHelper.getTag(orePrefix, material), ingotStack, xp); + ChemicalHelper.getTag(orePrefix, material), GTUtil.copyAmount(ingotStack.getCount(), ingotStack), xp); } if (!ConfigHolder.INSTANCE.recipes.disableManualCompression) { @@ -192,11 +192,11 @@ public static void processRawOre(TagPrefix orePrefix, Material material, OreProp VanillaRecipeHelper.addShapelessRecipe(provider, "decompress_" + material.getName() + "_from_ore_block", ChemicalHelper.get(rawOre, material, 9), ChemicalHelper.getTag(rawOreBlock, material)); - COMPRESSOR_RECIPES.recipeBuilder("compress_" + material.getName() + "to_ore_block") - .inputItems(rawOre, material, 9) - .outputItems(rawOreBlock, material) - .duration(300).EUt(2).save(provider); } + COMPRESSOR_RECIPES.recipeBuilder("compress_" + material.getName() + "to_ore_block") + .inputItems(rawOre, material, 9) + .outputItems(rawOreBlock, material) + .duration(300).EUt(2).save(provider); } public static void processCrushedOre(TagPrefix crushedPrefix, Material material, OreProperty property, Consumer provider) { From ebec62f932a90012cc57d9c2236b1c5312bd7a87 Mon Sep 17 00:00:00 2001 From: YoungOnion <39562198+YoungOnionMC@users.noreply.github.com> Date: Wed, 29 May 2024 01:54:37 -0600 Subject: [PATCH 4/4] spotless :cri: --- .../gregtechceu/gtceu/core/MixinHelpers.java | 10 +++-- .../recipe/generated/OreRecipeHandler.java | 39 ++++++++++++------- 2 files changed, 31 insertions(+), 18 deletions(-) diff --git a/src/main/java/com/gregtechceu/gtceu/core/MixinHelpers.java b/src/main/java/com/gregtechceu/gtceu/core/MixinHelpers.java index 988bcc0fc2..cd4cdf1db0 100644 --- a/src/main/java/com/gregtechceu/gtceu/core/MixinHelpers.java +++ b/src/main/java/com/gregtechceu/gtceu/core/MixinHelpers.java @@ -193,10 +193,12 @@ public static void generateGTDynamicLoot(Map lootTa int oreMultiplier = type.isDoubleDrops() ? 2 : 1; LootTable.Builder builder = BlockLootSubProvider.createSilkTouchDispatchTable(block, - BLOCK_LOOT.applyExplosionDecay(block, - LootItem.lootTableItem(dropItem.getItem()) - .apply(SetItemCountFunction.setCount(UniformGenerator.between(1, Math.max(1, oreMultiplier)))))); - //.apply(ApplyBonusCount.addOreBonusCount(Enchantments.BLOCK_FORTUNE)))); //disable fortune for balance reasons. (for now, until we can think of a better solution.) + BLOCK_LOOT.applyExplosionDecay(block, + LootItem.lootTableItem(dropItem.getItem()) + .apply(SetItemCountFunction.setCount( + UniformGenerator.between(1, Math.max(1, oreMultiplier)))))); + // .apply(ApplyBonusCount.addOreBonusCount(Enchantments.BLOCK_FORTUNE)))); //disable fortune for + // balance reasons. (for now, until we can think of a better solution.) Supplier outputDustMat = type.material(); LootPool.Builder pool = LootPool.lootPool(); diff --git a/src/main/java/com/gregtechceu/gtceu/data/recipe/generated/OreRecipeHandler.java b/src/main/java/com/gregtechceu/gtceu/data/recipe/generated/OreRecipeHandler.java index 766599eed6..e3f008c896 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/recipe/generated/OreRecipeHandler.java +++ b/src/main/java/com/gregtechceu/gtceu/data/recipe/generated/OreRecipeHandler.java @@ -145,17 +145,22 @@ public static void processOre(TagPrefix orePrefix, Material material, OrePropert } } - public static void processRawOre(TagPrefix orePrefix, Material material, OreProperty property, Consumer provider) { - ItemStack crushedStack = ChemicalHelper.get(crushed, material, material.getProperty(PropertyKey.ORE).getOreMultiplier()); + public static void processRawOre(TagPrefix orePrefix, Material material, OreProperty property, + Consumer provider) { + ItemStack crushedStack = ChemicalHelper.get(crushed, material, + material.getProperty(PropertyKey.ORE).getOreMultiplier()); ItemStack ingotStack; Material smeltingMaterial = property.getDirectSmeltResult() == null ? material : property.getDirectSmeltResult(); if (smeltingMaterial.hasProperty(PropertyKey.INGOT)) { - ingotStack = ChemicalHelper.get(ingot, smeltingMaterial, material.getProperty(PropertyKey.ORE).getOreMultiplier()); + ingotStack = ChemicalHelper.get(ingot, smeltingMaterial, + material.getProperty(PropertyKey.ORE).getOreMultiplier()); } else if (smeltingMaterial.hasProperty(PropertyKey.GEM)) { - ingotStack = ChemicalHelper.get(gem, smeltingMaterial, material.getProperty(PropertyKey.ORE).getOreMultiplier()); + ingotStack = ChemicalHelper.get(gem, smeltingMaterial, + material.getProperty(PropertyKey.ORE).getOreMultiplier()); } else { - ingotStack = ChemicalHelper.get(dust, smeltingMaterial, material.getProperty(PropertyKey.ORE).getOreMultiplier()); + ingotStack = ChemicalHelper.get(dust, smeltingMaterial, + material.getProperty(PropertyKey.ORE).getOreMultiplier()); } if (!crushedStack.isEmpty()) { @@ -170,13 +175,15 @@ public static void processRawOre(TagPrefix orePrefix, Material material, OreProp } builder.save(provider); - GTRecipeBuilder builder2 = MACERATOR_RECIPES.recipeBuilder("macerate_" + orePrefix.name + "_" + material.getName() + "_ore_to_crushed_ore") + GTRecipeBuilder builder2 = MACERATOR_RECIPES + .recipeBuilder("macerate_" + orePrefix.name + "_" + material.getName() + "_ore_to_crushed_ore") .inputItems(orePrefix, material) .outputItems(GTUtil.copyAmount(crushedStack.getCount() * 2, crushedStack)) .EUt(2) .duration(400); - Material byproductMaterial = GTUtil.selectItemInList(0, material, property.getOreByProducts(), Material.class); + Material byproductMaterial = GTUtil.selectItemInList(0, material, property.getOreByProducts(), + Material.class); ItemStack byproductStack = ChemicalHelper.get(gem, byproductMaterial); if (byproductStack.isEmpty()) { byproductStack = ChemicalHelper.get(dust, byproductMaterial); @@ -197,10 +204,14 @@ public static void processRawOre(TagPrefix orePrefix, Material material, OreProp // at all. if (!ingotStack.isEmpty() && doesMaterialUseNormalFurnace(smeltingMaterial) && !orePrefix.isIgnored(material)) { float xp = Math.round(((1 + property.getOreMultiplier() * 0.33f) / 3) * 10f) / 10f; - VanillaRecipeHelper.addSmeltingRecipe(provider, "smelt_" + orePrefix.name + "_" + material.getName() + "_ore_to_ingot", - ChemicalHelper.getTag(orePrefix, material), GTUtil.copyAmount(ingotStack.getCount(), ingotStack), xp); - VanillaRecipeHelper.addBlastingRecipe(provider, "smelt_" + orePrefix.name + "_" + material.getName() + "_ore_to_ingot", - ChemicalHelper.getTag(orePrefix, material), GTUtil.copyAmount(ingotStack.getCount(), ingotStack), xp); + VanillaRecipeHelper.addSmeltingRecipe(provider, + "smelt_" + orePrefix.name + "_" + material.getName() + "_ore_to_ingot", + ChemicalHelper.getTag(orePrefix, material), GTUtil.copyAmount(ingotStack.getCount(), ingotStack), + xp); + VanillaRecipeHelper.addBlastingRecipe(provider, + "smelt_" + orePrefix.name + "_" + material.getName() + "_ore_to_ingot", + ChemicalHelper.getTag(orePrefix, material), GTUtil.copyAmount(ingotStack.getCount(), ingotStack), + xp); } if (!ConfigHolder.INSTANCE.recipes.disableManualCompression) { @@ -213,9 +224,9 @@ public static void processRawOre(TagPrefix orePrefix, Material material, OreProp ChemicalHelper.getTag(rawOreBlock, material)); } COMPRESSOR_RECIPES.recipeBuilder("compress_" + material.getName() + "to_ore_block") - .inputItems(rawOre, material, 9) - .outputItems(rawOreBlock, material) - .duration(300).EUt(2).save(provider); + .inputItems(rawOre, material, 9) + .outputItems(rawOreBlock, material) + .duration(300).EUt(2).save(provider); } public static void processCrushedOre(TagPrefix crushedPrefix, Material material, OreProperty property,