Skip to content

Commit 29dfe03

Browse files
authored
Fix autogenerating mortar recipes (#4498)
1 parent 02bfeb4 commit 29dfe03

3 files changed

Lines changed: 12 additions & 18 deletions

File tree

docs/content/Modpacks/Changes/v7.5.0.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,6 @@ You also need to adjust the generics of `getType()` and `createTemplate()` to ma
2323

2424
## Machine & Cover Copy/Paste System
2525
A new system for copying machines using the Machine Memory Card has been added, see [this page](../Other-Topics/Cover-Machine-Copy-Paste-Support.md) if you want to add extra copy/paste behaviour to your own machines and covers.
26+
27+
## Mortar Recipe Fix
28+
Previously, adding GTToolType.MORTAR to your tool did not automatically generate the recipe. This has been fixed. If you previously generated a recipe using this, you need to remove your manual recipe.

src/main/java/com/gregtechceu/gtceu/data/recipe/generated/ToolRecipeHandler.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import net.minecraft.world.item.ItemStack;
2626
import net.minecraft.world.item.Items;
2727
import net.minecraft.world.item.crafting.Ingredient;
28+
import net.minecraft.world.level.block.Blocks;
2829

2930
import com.tterrag.registrate.util.entry.ItemEntry;
3031
import it.unimi.dsi.fastutil.ints.Int2ReferenceArrayMap;
@@ -63,14 +64,19 @@ public static void run(@NotNull Consumer<FinishedRecipe> provider, @NotNull Mate
6364
}
6465

6566
private static void processTool(@NotNull Consumer<FinishedRecipe> provider, @NotNull Material material) {
67+
ItemStack stick = new ItemStack(Items.STICK);
68+
MaterialEntry ingot = new MaterialEntry(
69+
material.hasProperty(PropertyKey.GEM) ? TagPrefix.gem : TagPrefix.ingot, material);
70+
addToolRecipe(provider, material, GTToolType.MORTAR, false,
71+
" I ", "SIS", "SSS",
72+
'I', ingot,
73+
'S', new ItemStack(Blocks.STONE));
74+
6675
if (!material.shouldGenerateRecipesFor(plate)) {
6776
return;
6877
}
6978

70-
ItemStack stick = new ItemStack(Items.STICK);
7179
MaterialEntry plate = new MaterialEntry(TagPrefix.plate, material);
72-
MaterialEntry ingot = new MaterialEntry(
73-
material.hasProperty(PropertyKey.GEM) ? TagPrefix.gem : TagPrefix.ingot, material);
7480

7581
if (material.hasFlag(GENERATE_PLATE)) {
7682
addToolRecipe(provider, material, GTToolType.MINING_HAMMER, true,

src/main/java/com/gregtechceu/gtceu/data/recipe/misc/CustomToolRecipes.java

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ private static void registerPowerUnitRecipes(@NotNull Consumer<FinishedRecipe> p
130130

131131
private static void registerCustomToolRecipes(@NotNull Consumer<FinishedRecipe> provider) {
132132
registerFlintToolRecipes(provider);
133-
registerMortarRecipes(provider);
134133
registerSoftToolRecipes(provider);
135134
registerElectricRecipes(provider);
136135

@@ -178,20 +177,6 @@ private static void registerFlintToolRecipes(@NotNull Consumer<FinishedRecipe> p
178177
'S', stick);
179178
}
180179

181-
private static void registerMortarRecipes(@NotNull Consumer<FinishedRecipe> provider) {
182-
for (Material material : new Material[] {
183-
GTMaterials.Bronze, GTMaterials.Iron, GTMaterials.Invar, GTMaterials.Steel,
184-
GTMaterials.DamascusSteel, GTMaterials.CobaltBrass, GTMaterials.WroughtIron }) {
185-
186-
addToolRecipe(provider, material, GTToolType.MORTAR, false,
187-
" I ", "SIS", "SSS",
188-
'I',
189-
new MaterialEntry(material.hasProperty(PropertyKey.GEM) ? TagPrefix.gem : TagPrefix.ingot,
190-
material),
191-
'S', new ItemStack(Blocks.STONE));
192-
}
193-
}
194-
195180
private static void registerSoftToolRecipes(@NotNull Consumer<FinishedRecipe> provider) {
196181
final ItemStack stick = new ItemStack(Items.STICK);
197182

0 commit comments

Comments
 (0)