Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raw Ore Recipe Balance Changes #1332

Merged
merged 8 commits into from
May 29, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ public class GTRecipeTypes {
.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);

Expand Down Expand Up @@ -144,6 +145,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);

Expand Down Expand Up @@ -195,6 +197,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);

Expand Down Expand Up @@ -263,6 +266,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)
Expand Down Expand Up @@ -297,6 +301,7 @@ public class GTRecipeTypes {
.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);

Expand Down Expand Up @@ -411,6 +416,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) -> {
Expand Down
6 changes: 2 additions & 4 deletions src/main/java/com/gregtechceu/gtceu/core/MixinHelpers.java
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,8 @@ public static void generateGTDynamicLoot(Map<ResourceLocation, LootTable> 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.)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,16 +147,20 @@ public static void processOre(TagPrefix orePrefix, Material material, OrePropert

public static void processRawOre(TagPrefix orePrefix, Material material, OreProperty property,
Consumer<FinishedRecipe> 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()) {
Expand All @@ -171,16 +175,29 @@ public static void processRawOre(TagPrefix orePrefix, Material material, OreProp
}
builder.save(provider);

MACERATOR_RECIPES
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(GTUtil.copyAmount(crushedStack.getCount() * 2, crushedStack))
.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
Expand All @@ -189,10 +206,12 @@ public static void processRawOre(TagPrefix orePrefix, Material material, OreProp
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) {
Expand All @@ -203,11 +222,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,
Expand Down
Loading