Fixed incompatibility of dict iterator

Closes #121
This commit is contained in:
TheDarkDnKTv 2021-05-18 06:18:58 +03:00
parent bc57a5c97a
commit e6c48f2f40
8 changed files with 123 additions and 87 deletions

View file

@ -885,28 +885,28 @@ public class GT_ModHandler {
/** /**
* Shapeless Crafting Recipes. Deletes conflicting Recipes too. * Shapeless Crafting Recipes. Deletes conflicting Recipes too.
*/ */
public static boolean addShapelessCraftingRecipe(ItemStack aResult, Object[] aRecipe) { public static boolean addShapelessCraftingRecipe(ItemStack aResult, Object... aRecipe) {
return addShapelessCraftingRecipe(aResult, isElectricItem(aResult), aRecipe); return addShapelessCraftingRecipe(aResult, isElectricItem(aResult), aRecipe);
} }
/** /**
* Shapeless Crafting Recipes. Deletes conflicting Recipes too. * Shapeless Crafting Recipes. Deletes conflicting Recipes too.
*/ */
public static boolean addShapelessCraftingRecipe(ItemStack aResult, boolean aUseIC2Handler, Object[] aRecipe) { public static boolean addShapelessCraftingRecipe(ItemStack aResult, boolean aUseIC2Handler, Object... aRecipe) {
return addShapelessCraftingRecipe(aResult, aUseIC2Handler, true, aRecipe); return addShapelessCraftingRecipe(aResult, aUseIC2Handler, true, aRecipe);
} }
/** /**
* Shapeless Crafting Recipes. Deletes conflicting Recipes too. * Shapeless Crafting Recipes. Deletes conflicting Recipes too.
*/ */
public static boolean addShapelessCraftingRecipe(ItemStack aResult, boolean aUseIC2Handler, boolean aBuffered, Object[] aRecipe) { public static boolean addShapelessCraftingRecipe(ItemStack aResult, boolean aUseIC2Handler, boolean aBuffered, Object... aRecipe) {
return addShapelessCraftingRecipe(aResult, aUseIC2Handler, aBuffered, false, aRecipe); return addShapelessCraftingRecipe(aResult, aUseIC2Handler, aBuffered, false, aRecipe);
} }
/** /**
* Shapeless Crafting Recipes. Deletes conflicting Recipes too. * Shapeless Crafting Recipes. Deletes conflicting Recipes too.
*/ */
public static boolean addShapelessCraftingRecipe(ItemStack aResult, boolean aUseIC2Handler, boolean aBuffered, boolean aKeepNBT, Object[] aRecipe) { public static boolean addShapelessCraftingRecipe(ItemStack aResult, boolean aUseIC2Handler, boolean aBuffered, boolean aKeepNBT, Object... aRecipe) {
aResult = GT_OreDictUnificator.get(true, aResult); aResult = GT_OreDictUnificator.get(true, aResult);
if (aRecipe == null || aRecipe.length <= 0) return false; if (aRecipe == null || aRecipe.length <= 0) return false;
for (byte i = 0; i < aRecipe.length; i++) { for (byte i = 0; i < aRecipe.length; i++) {

View file

@ -91,9 +91,13 @@ public class RecipeHandler {
while (iter.hasNext() && !smeltingRemove.isEmpty()) { while (iter.hasNext() && !smeltingRemove.isEmpty()) {
Entry<ItemStack, ItemStack> entr = iter.next(); Entry<ItemStack, ItemStack> entr = iter.next();
for (IFurnanceMatcher matcher : smeltingRemove) { Iterator<IFurnanceMatcher> iter2 = smeltingRemove.iterator();
while (iter2.hasNext()) {
IFurnanceMatcher matcher = iter2.next();
if (matcher.matches(entr.getKey(), entr.getValue())) { if (matcher.matches(entr.getKey(), entr.getValue())) {
iter.remove(); iter.remove();
iter2.remove();
break;
} }
} }
} }
@ -138,6 +142,7 @@ public class RecipeHandler {
if (matcher.matches(entry.getKey(), entry.getValue())) { if (matcher.matches(entry.getKey(), entry.getValue())) {
iter.remove(); iter.remove();
iter2.remove(); iter2.remove();
break;
} }
} }
} }

View file

@ -66,10 +66,6 @@ public class ProcessingIngot1 implements IOreRecipeRegistrator {
RecipeMaps.BENDING.factory().EUt(24).duration(Math.max(aMaterial.getMass() * 2, 1)).setShaped(true).input(RecipeEntry.fromStacks(1, entry.ores, Match.STRICT)).nonConsumable(GT_Items.Circuit_Integrated.getWithDamage(0, 1)).output(GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 1)).buildAndRegister(); RecipeMaps.BENDING.factory().EUt(24).duration(Math.max(aMaterial.getMass() * 2, 1)).setShaped(true).input(RecipeEntry.fromStacks(1, entry.ores, Match.STRICT)).nonConsumable(GT_Items.Circuit_Integrated.getWithDamage(0, 1)).output(GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 1)).buildAndRegister();
if (GT_OreDictUnificator.get(OrePrefixes.plateDense, aMaterial) != null) if (GT_OreDictUnificator.get(OrePrefixes.plateDense, aMaterial) != null)
RecipeMaps.BENDING.factory().EUt(24).duration(Math.max(aMaterial.getMass() * 18, 1)).setShaped(true).input(RecipeEntry.fromStacks(9, entry.ores, Match.STRICT)).nonConsumable(GT_Items.Circuit_Integrated.getWithDamage(0, 9)).output(GT_OreDictUnificator.get(OrePrefixes.plateDense, aMaterial, 1)).buildAndRegister(); RecipeMaps.BENDING.factory().EUt(24).duration(Math.max(aMaterial.getMass() * 18, 1)).setShaped(true).input(RecipeEntry.fromStacks(9, entry.ores, Match.STRICT)).nonConsumable(GT_Items.Circuit_Integrated.getWithDamage(0, 9)).output(GT_OreDictUnificator.get(OrePrefixes.plateDense, aMaterial, 1)).buildAndRegister();
// RecipeMaps.BENDING.factory().EUt(24).duration(Math.max(aMaterial.getMass() * 4, 1)).setShaped(true).input(RecipeEntry.fromStacks(2, entry.ores, Match.STRICT)).nonConsumable(GT_Items.Circuit_Integrated.getWithDamage(0, 2)).output(GT_OreDictUnificator.get(OrePrefixes.plateDouble, aMaterial, 1)).buildAndRegister();
// RecipeMaps.BENDING.factory().EUt(24).duration(Math.max(aMaterial.getMass() * 6, 1)).setShaped(true).input(RecipeEntry.fromStacks(3, entry.ores, Match.STRICT)).nonConsumable(GT_Items.Circuit_Integrated.getWithDamage(0, 3)).output(GT_OreDictUnificator.get(OrePrefixes.plateTriple, aMaterial, 1)).buildAndRegister();
// RecipeMaps.BENDING.factory().EUt(24).duration(Math.max(aMaterial.getMass() * 8, 1)).setShaped(true).input(RecipeEntry.fromStacks(4, entry.ores, Match.STRICT)).nonConsumable(GT_Items.Circuit_Integrated.getWithDamage(0, 4)).output(GT_OreDictUnificator.get(OrePrefixes.plateQuadruple, aMaterial, 1)).buildAndRegister();
// RecipeMaps.BENDING.factory().EUt(24).duration(Math.max(aMaterial.getMass() * 10, 1)).setShaped(true).input(RecipeEntry.fromStacks(5, entry.ores, Match.STRICT)).nonConsumable(GT_Items.Circuit_Integrated.getWithDamage(0, 5)).output(GT_OreDictUnificator.get(OrePrefixes.plateQuintuple, aMaterial, 1)).buildAndRegister();
} }
if (!OrePrefixes.block.isIgnored(aMaterial)) { if (!OrePrefixes.block.isIgnored(aMaterial)) {

View file

@ -30,31 +30,36 @@ public class ProcessingIngot2 implements IOreRecipeRegistrator {
for (OreDictEntry entry : entries) { for (OreDictEntry entry : entries) {
Materials aMaterial = this.getMaterial(aPrefix, entry); Materials aMaterial = this.getMaterial(aPrefix, entry);
if (this.isExecutable(aPrefix, aMaterial)) { if (this.isExecutable(aPrefix, aMaterial)) {
if (!aMaterial.contains(SubTag.NO_SMASHING)) { ItemStack aStack = GT_OreDictUnificator.get(OrePrefixes.ingotDouble, aMaterial);
RecipeMaps.BENDING.factory().EUt(24).setShaped(true) if (aStack != null && !aMaterial.contains(SubTag.NO_SMASHING)) {
.duration(Math.max(aMaterial.getMass() * 2, 1))
.input(RecipeEntry.fromStacks(entry.ores, Match.STRICT))
.nonConsumable(GT_Items.Circuit_Integrated.getWithDamage(0, 1))
.output(GT_OreDictUnificator.get(OrePrefixes.plateDouble, aMaterial, 1L))
.buildAndRegister();
RecipeMaps.BENDING.factory().EUt(24).setShaped(true) RecipeMaps.BENDING.factory().EUt(24).setShaped(true)
.duration(Math.max(aMaterial.getMass() * 4, 1)) .duration(Math.max(aMaterial.getMass() * 4, 1))
.input(RecipeEntry.fromStacks(2, entry.ores, Match.STRICT)) .input(OrePrefixes.ingot, aMaterial, 2)
.nonConsumable(GT_Items.Circuit_Integrated.getWithDamage(0, 2)) .nonConsumable(GT_Items.Circuit_Integrated.getWithDamage(0, 2))
.output(GT_OreDictUnificator.get(OrePrefixes.plateQuadruple, aMaterial, 1L)) .output(aStack)
.buildAndRegister(); .buildAndRegister();
}
ItemStack aStack = GT_OreDictUnificator.get(OrePrefixes.ingotDouble, aMaterial);
if (aStack != null && !aMaterial.contains(SubTag.NO_SMASHING) && GregTech_API.sRecipeFile.get(GT_ConfigCategories.Tools.hammerdoubleingot, OrePrefixes.ingot.get(aMaterial), true)) { if (GregTech_API.sRecipeFile.get(GT_ConfigCategories.Tools.hammerdoubleingot, OrePrefixes.ingot.get(aMaterial), true)) {
RecipeHandler.executeOnFinish(() -> { RecipeHandler.executeOnFinish(() -> {
GT_ModHandler.addCraftingRecipe(GT_Utility.copyAmount(1, aStack), GT_ModHandler.addCraftingRecipe(GT_Utility.copyAmount(1, aStack),
new Object[] { "I", "B", "H", 'H', GT_ToolDictNames.craftingToolHardHammer, 'I', OrePrefixes.ingot.get(aMaterial), 'B', OrePrefixes.ingot.get(aMaterial) }); new Object[] { "I", "B", "H", 'H', GT_ToolDictNames.craftingToolHardHammer, 'I', OrePrefixes.ingot.get(aMaterial), 'B', OrePrefixes.ingot.get(aMaterial) });
GT_ModHandler.addShapelessCraftingRecipe(GT_Utility.copyAmount(1, aStack), GT_ModHandler.addShapelessCraftingRecipe(GT_Utility.copyAmount(1, aStack),
new Object[] { GT_ToolDictNames.craftingToolForgeHammer, OrePrefixes.ingot.get(aMaterial), OrePrefixes.ingot.get(aMaterial) }); new Object[] { GT_ToolDictNames.craftingToolForgeHammer, OrePrefixes.ingot.get(aMaterial), OrePrefixes.ingot.get(aMaterial) });
}); });
} else { } else {
RecipeHandler.executeOnFinish(() -> GT_ModHandler.addShapelessCraftingRecipe(GT_Utility.copyAmount(1, aStack), new Object[] { OrePrefixes.ingot.get(aMaterial), OrePrefixes.ingot.get(aMaterial) })); RecipeHandler.executeOnFinish(() -> GT_ModHandler.addShapelessCraftingRecipe(GT_Utility.copyAmount(1, aStack), new Object[] { OrePrefixes.ingot.get(aMaterial), OrePrefixes.ingot.get(aMaterial) }));
}
ItemStack plate = GT_OreDictUnificator.get(OrePrefixes.plateDouble, aMaterial);
if (plate != null) {
RecipeMaps.BENDING.factory().EUt(24).setShaped(true)
.duration(Math.max(aMaterial.getMass() * 2, 1))
.input(RecipeEntry.fromStacks(entry.ores, Match.STRICT))
.nonConsumable(GT_Items.Circuit_Integrated.getWithDamage(0, 1))
.output(plate)
.buildAndRegister();
}
} }
} }
} }

View file

@ -30,30 +30,36 @@ public class ProcessingIngot3 implements IOreRecipeRegistrator {
for (OreDictEntry entry : entries) { for (OreDictEntry entry : entries) {
Materials aMaterial = this.getMaterial(aPrefix, entry); Materials aMaterial = this.getMaterial(aPrefix, entry);
if (this.isExecutable(aPrefix, aMaterial)) { if (this.isExecutable(aPrefix, aMaterial)) {
if (!aMaterial.contains(SubTag.NO_SMASHING)) { ItemStack aStack = GT_OreDictUnificator.get(OrePrefixes.plateTriple, aMaterial);
RecipeMaps.BENDING.factory().EUt(24).setShaped(true) if (aStack != null && !aMaterial.contains(SubTag.NO_SMASHING)) {
.duration(Math.max(aMaterial.getMass() * 2, 1))
.input(RecipeEntry.fromStacks(entry.ores, Match.STRICT))
.nonConsumable(GT_Items.Circuit_Integrated.getWithDamage(0, 1))
.output(GT_OreDictUnificator.get(OrePrefixes.plateTriple, aMaterial, 1L));
RecipeMaps.BENDING.factory().EUt(24).setShaped(true) RecipeMaps.BENDING.factory().EUt(24).setShaped(true)
.duration(Math.max(aMaterial.getMass() * 6, 1)) .duration(Math.max(aMaterial.getMass() * 6, 1))
.input(RecipeEntry.fromStacks(3, entry.ores, Match.STRICT)) .input(OrePrefixes.ingot, aMaterial, 3)
.nonConsumable(GT_Items.Circuit_Integrated.getWithDamage(0, 3)) .nonConsumable(GT_Items.Circuit_Integrated.getWithDamage(0, 3))
.output(GT_OreDictUnificator.get(OrePrefixes.plateTriple, aMaterial, 1L)); .output(aStack);
if (GregTech_API.sRecipeFile.get(GT_ConfigCategories.Tools.hammertripleingot, OrePrefixes.ingot.get(aMaterial), true)) {
RecipeHandler.executeOnFinish(() -> {
GT_ModHandler.addCraftingRecipe(GT_Utility.copyAmount(1, aStack),
new Object[] { "I", "B", "H", 'H', GT_ToolDictNames.craftingToolHardHammer, 'I', OrePrefixes.ingotDouble.get(aMaterial), 'B', OrePrefixes.ingot.get(aMaterial) });
GT_ModHandler.addShapelessCraftingRecipe(GT_Utility.copyAmount(1, aStack),
new Object[] { GT_ToolDictNames.craftingToolForgeHammer, OrePrefixes.ingot.get(aMaterial), OrePrefixes.ingot.get(aMaterial), OrePrefixes.ingot.get(aMaterial) });
});
} else {
RecipeHandler.executeOnFinish(() -> GT_ModHandler.addShapelessCraftingRecipe(GT_Utility.copyAmount(1, aStack),
new Object[] { OrePrefixes.ingot.get(aMaterial), OrePrefixes.ingot.get(aMaterial), OrePrefixes.ingot.get(aMaterial) }));
}
} }
ItemStack aStack = GT_OreDictUnificator.get(OrePrefixes.plateTriple, aMaterial); ItemStack plate = GT_OreDictUnificator.get(OrePrefixes.plateTriple, aMaterial);
if (aStack != null && !aMaterial.contains(SubTag.NO_SMASHING) && GregTech_API.sRecipeFile.get(GT_ConfigCategories.Tools.hammertripleingot, OrePrefixes.ingot.get(aMaterial), true)) { if (plate != null) {
RecipeHandler.executeOnFinish(() -> { RecipeMaps.BENDING.factory().EUt(24).setShaped(true)
GT_ModHandler.addCraftingRecipe(GT_Utility.copyAmount(1, aStack), .duration(Math.max(aMaterial.getMass() * 3, 1))
new Object[] { "I", "B", "H", 'H', GT_ToolDictNames.craftingToolHardHammer, 'I', OrePrefixes.ingotDouble.get(aMaterial), 'B', OrePrefixes.ingot.get(aMaterial) }); .input(RecipeEntry.fromStacks(entry.ores, Match.STRICT))
GT_ModHandler.addShapelessCraftingRecipe(GT_Utility.copyAmount(1, aStack), .nonConsumable(GT_Items.Circuit_Integrated.getWithDamage(0, 1))
new Object[] { GT_ToolDictNames.craftingToolForgeHammer, OrePrefixes.ingot.get(aMaterial), OrePrefixes.ingot.get(aMaterial), OrePrefixes.ingot.get(aMaterial) }); .output(plate)
}); .buildAndRegister();
} else {
RecipeHandler.executeOnFinish(() -> GT_ModHandler.addShapelessCraftingRecipe(GT_Utility.copyAmount(1, aStack),
new Object[] { OrePrefixes.ingot.get(aMaterial), OrePrefixes.ingot.get(aMaterial), OrePrefixes.ingot.get(aMaterial) }));
} }
} }
} }

View file

@ -17,8 +17,8 @@ import gregtechmod.api.util.OreDictEntry;
import gregtechmod.common.RecipeHandler; import gregtechmod.common.RecipeHandler;
import gregtechmod.common.recipe.RecipeEntry; import gregtechmod.common.recipe.RecipeEntry;
import gregtechmod.common.recipe.RecipeMaps; import gregtechmod.common.recipe.RecipeMaps;
import net.minecraft.item.ItemStack;
import gregtechmod.common.recipe.RecipeEntry.Match; import gregtechmod.common.recipe.RecipeEntry.Match;
import net.minecraft.item.ItemStack;
public class ProcessingIngot4 implements IOreRecipeRegistrator { public class ProcessingIngot4 implements IOreRecipeRegistrator {
@ -30,25 +30,36 @@ public class ProcessingIngot4 implements IOreRecipeRegistrator {
for (OreDictEntry entry : entries) { for (OreDictEntry entry : entries) {
Materials aMaterial = this.getMaterial(aPrefix, entry); Materials aMaterial = this.getMaterial(aPrefix, entry);
if (this.isExecutable(aPrefix, aMaterial)) { if (this.isExecutable(aPrefix, aMaterial)) {
if (!aMaterial.contains(SubTag.NO_SMASHING)) { ItemStack aStack = GT_OreDictUnificator.get(aPrefix, aMaterial);
if (aStack != null && !aMaterial.contains(SubTag.NO_SMASHING)) {
RecipeMaps.BENDING.factory().EUt(24).setShaped(true) RecipeMaps.BENDING.factory().EUt(24).setShaped(true)
.duration(Math.max(aMaterial.getMass() * 2, 1)) .duration(Math.max(aMaterial.getMass() * 2, 1))
.input(RecipeEntry.fromStacks(entry.ores, Match.STRICT)) .input(OrePrefixes.ingot, aMaterial, 4)
.nonConsumable(GT_Items.Circuit_Integrated.getWithDamage(0, 1)) .nonConsumable(GT_Items.Circuit_Integrated.getWithDamage(0, 4))
.output(GT_OreDictUnificator.get(OrePrefixes.plateQuadruple, aMaterial, 1L)) .output(aStack)
.buildAndRegister(); .buildAndRegister();
}
ItemStack aStack = GT_OreDictUnificator.get(OrePrefixes.plateQuadruple, aMaterial); if (GregTech_API.sRecipeFile.get(GT_ConfigCategories.Tools.hammerquadrupleingot, OrePrefixes.ingot.get(aMaterial), true)) {
if (aStack != null && !aMaterial.contains(SubTag.NO_SMASHING) && GregTech_API.sRecipeFile.get(GT_ConfigCategories.Tools.hammerquadrupleingot, OrePrefixes.ingot.get(aMaterial), true)) { RecipeHandler.executeOnFinish(() -> {
RecipeHandler.executeOnFinish(() -> { GT_ModHandler.addCraftingRecipe(GT_Utility.copyAmount(1, aStack),
GT_ModHandler.addCraftingRecipe(GT_Utility.copyAmount(1, aStack), new Object[] { "I", "B", "H", 'H', GT_ToolDictNames.craftingToolHardHammer, 'I', OrePrefixes.ingotTriple.get(aMaterial), 'B', OrePrefixes.ingot.get(aMaterial) });
new Object[] { "I", "B", "H", 'H', GT_ToolDictNames.craftingToolHardHammer, 'I', OrePrefixes.ingotTriple.get(aMaterial), 'B', OrePrefixes.ingot.get(aMaterial) }); GT_ModHandler.addShapelessCraftingRecipe(GT_Utility.copyAmount(1, aStack),
GT_ModHandler.addShapelessCraftingRecipe(GT_Utility.copyAmount(1, aStack), new Object[] { GT_ToolDictNames.craftingToolForgeHammer, OrePrefixes.ingot.get(aMaterial), OrePrefixes.ingot.get(aMaterial), OrePrefixes.ingot.get(aMaterial), OrePrefixes.ingot.get(aMaterial) });
new Object[] { GT_ToolDictNames.craftingToolForgeHammer, OrePrefixes.ingot.get(aMaterial), OrePrefixes.ingot.get(aMaterial), OrePrefixes.ingot.get(aMaterial), OrePrefixes.ingot.get(aMaterial) }); });
}); } else {
} else { RecipeHandler.executeOnFinish(() -> GT_ModHandler.addShapelessCraftingRecipe(GT_Utility.copyAmount(1, aStack), OrePrefixes.ingot.get(aMaterial), OrePrefixes.ingot.get(aMaterial), OrePrefixes.ingot.get(aMaterial), OrePrefixes.ingot.get(aMaterial)));
RecipeHandler.executeOnFinish(() -> GT_ModHandler.addShapelessCraftingRecipe(GT_Utility.copyAmount(1, aStack), new Object[] { OrePrefixes.ingot.get(aMaterial), OrePrefixes.ingot.get(aMaterial), OrePrefixes.ingot.get(aMaterial), OrePrefixes.ingot.get(aMaterial) })); }
ItemStack plate = GT_OreDictUnificator.get(OrePrefixes.plateQuadruple, aMaterial);
if (plate != null) {
RecipeMaps.BENDING.factory().EUt(24).setShaped(true)
.duration(Math.max(aMaterial.getMass() * 4, 1))
.input(RecipeEntry.fromStacks(entry.ores, Match.STRICT))
.nonConsumable(GT_Items.Circuit_Integrated.getWithDamage(0, 1))
.output(plate)
.buildAndRegister();
}
} }
} }
} }

View file

@ -30,26 +30,35 @@ public class ProcessingIngot5 implements IOreRecipeRegistrator {
for (OreDictEntry entry : entries) { for (OreDictEntry entry : entries) {
Materials aMaterial = this.getMaterial(aPrefix, entry); Materials aMaterial = this.getMaterial(aPrefix, entry);
if (this.isExecutable(aPrefix, aMaterial)) { if (this.isExecutable(aPrefix, aMaterial)) {
if (!aMaterial.contains(SubTag.NO_SMASHING)) { ItemStack aStack = GT_OreDictUnificator.get(aPrefix, aMaterial);
if (aStack != null && !aMaterial.contains(SubTag.NO_SMASHING)) {
RecipeMaps.BENDING.factory().EUt(24).setShaped(true) RecipeMaps.BENDING.factory().EUt(24).setShaped(true)
.duration(Math.max(aMaterial.getMass() * 2, 1)) .duration(Math.max(aMaterial.getMass() * 2, 1))
.input(RecipeEntry.fromStacks(5, entry.ores, Match.STRICT)) .input(OrePrefixes.ingot, aMaterial, 5)
.nonConsumable(GT_Items.Circuit_Integrated.getWithDamage(0, 1)) .nonConsumable(GT_Items.Circuit_Integrated.getWithDamage(0, 5))
.output(GT_OreDictUnificator.get(OrePrefixes.plateQuintuple, aMaterial, 1L)) .output(aStack)
.buildAndRegister(); .buildAndRegister();
} if (GregTech_API.sRecipeFile.get(GT_ConfigCategories.Tools.hammerquintupleingot, OrePrefixes.ingot.get(aMaterial), true)) {
RecipeHandler.executeOnFinish(() -> {
GT_ModHandler.addCraftingRecipe(GT_Utility.copyAmount(1, aStack),
new Object[] { "I", "B", "H", 'H', GT_ToolDictNames.craftingToolHardHammer, 'I', OrePrefixes.ingotQuadruple.get(aMaterial), 'B', OrePrefixes.ingot.get(aMaterial) });
GT_ModHandler.addShapelessCraftingRecipe(GT_Utility.copyAmount(1, aStack),
new Object[] { GT_ToolDictNames.craftingToolForgeHammer, OrePrefixes.ingot.get(aMaterial), OrePrefixes.ingot.get(aMaterial), OrePrefixes.ingot.get(aMaterial), OrePrefixes.ingot.get(aMaterial), OrePrefixes.ingot.get(aMaterial) });
});
} else {
RecipeHandler.executeOnFinish(() -> GT_ModHandler.addShapelessCraftingRecipe(GT_Utility.copyAmount(1, aStack),
new Object[] { OrePrefixes.ingot.get(aMaterial), OrePrefixes.ingot.get(aMaterial), OrePrefixes.ingot.get(aMaterial), OrePrefixes.ingot.get(aMaterial), OrePrefixes.ingot.get(aMaterial) }));
}
ItemStack aStack = GT_OreDictUnificator.get(OrePrefixes.plateQuintuple, aMaterial); ItemStack plate = GT_OreDictUnificator.get(OrePrefixes.plateQuintuple, aMaterial);
if (aStack != null && !aMaterial.contains(SubTag.NO_SMASHING) && GregTech_API.sRecipeFile.get(GT_ConfigCategories.Tools.hammerquintupleingot, OrePrefixes.ingot.get(aMaterial), true)) { if (plate != null) {
RecipeHandler.executeOnFinish(() -> { RecipeMaps.BENDING.factory().EUt(24).setShaped(true)
GT_ModHandler.addCraftingRecipe(GT_Utility.copyAmount(1, aStack), .duration(Math.max(aMaterial.getMass() * 5, 1))
new Object[] { "I", "B", "H", 'H', GT_ToolDictNames.craftingToolHardHammer, 'I', OrePrefixes.ingotQuadruple.get(aMaterial), 'B', OrePrefixes.ingot.get(aMaterial) }); .input(RecipeEntry.fromStacks(entry.ores, Match.STRICT))
GT_ModHandler.addShapelessCraftingRecipe(GT_Utility.copyAmount(1, aStack), .nonConsumable(GT_Items.Circuit_Integrated.getWithDamage(0, 1))
new Object[] { GT_ToolDictNames.craftingToolForgeHammer, OrePrefixes.ingot.get(aMaterial), OrePrefixes.ingot.get(aMaterial), OrePrefixes.ingot.get(aMaterial), OrePrefixes.ingot.get(aMaterial), OrePrefixes.ingot.get(aMaterial) }); .output(plate)
}); .buildAndRegister();
} else { }
RecipeHandler.executeOnFinish(() -> GT_ModHandler.addShapelessCraftingRecipe(GT_Utility.copyAmount(1, aStack),
new Object[] { OrePrefixes.ingot.get(aMaterial), OrePrefixes.ingot.get(aMaterial), OrePrefixes.ingot.get(aMaterial), OrePrefixes.ingot.get(aMaterial), OrePrefixes.ingot.get(aMaterial) }));
} }
} }
} }

View file

@ -14,6 +14,7 @@ import gregtechmod.api.util.OreDictEntry;
import gregtechmod.common.RecipeHandler; import gregtechmod.common.RecipeHandler;
import gregtechmod.common.recipe.RecipeEntry; import gregtechmod.common.recipe.RecipeEntry;
import gregtechmod.common.recipe.RecipeMaps; import gregtechmod.common.recipe.RecipeMaps;
import net.minecraft.item.ItemStack;
import gregtechmod.common.recipe.RecipeEntry.Match; import gregtechmod.common.recipe.RecipeEntry.Match;
public class ProcessingNugget implements IOreRecipeRegistrator { public class ProcessingNugget implements IOreRecipeRegistrator {
@ -26,10 +27,12 @@ public class ProcessingNugget implements IOreRecipeRegistrator {
for (OreDictEntry entry : entries) { for (OreDictEntry entry : entries) {
Materials aMaterial = this.getMaterial(aPrefix, entry); Materials aMaterial = this.getMaterial(aPrefix, entry);
if (this.isExecutable(aPrefix, aMaterial) && (aMaterial.mTypes & 2) != 0) { if (this.isExecutable(aPrefix, aMaterial) && (aMaterial.mTypes & 2) != 0) {
RecipeMaps.LATHE.factory().EUt(8) ItemStack round = GT_OreDictUnificator.get(OrePrefixes.round, aMaterial, 1L);
if (round != null) RecipeMaps.LATHE.factory().EUt(8)
.duration(Math.max(aMaterial.getMass() / 4, 1)) .duration(Math.max(aMaterial.getMass() / 4, 1))
.input(RecipeEntry.fromStacks(entry.ores, Match.STRICT)) .input(RecipeEntry.fromStacks(entry.ores, Match.STRICT))
.output(GT_OreDictUnificator.get(OrePrefixes.round, aMaterial, 1L)) .output(round)
.buildAndRegister(); .buildAndRegister();
RecipeMaps.ALLOY_SMELTING.factory().EUt(2).duration(200) RecipeMaps.ALLOY_SMELTING.factory().EUt(2).duration(200)
.input(RecipeEntry.fromStacks(9, entry.ores, Match.STRICT)) .input(RecipeEntry.fromStacks(9, entry.ores, Match.STRICT))
@ -38,7 +41,8 @@ public class ProcessingNugget implements IOreRecipeRegistrator {
RecipeHandler.executeOnFinish(() -> { RecipeHandler.executeOnFinish(() -> {
GameRegistry.addRecipe(new GT_Shapeless_Recipe(GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial, 1L), new Object[] { entry.oreDictName, entry.oreDictName, entry.oreDictName, entry.oreDictName, entry.oreDictName, entry.oreDictName, entry.oreDictName, entry.oreDictName, entry.oreDictName })); GameRegistry.addRecipe(new GT_Shapeless_Recipe(GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial, 1L), new Object[] { entry.oreDictName, entry.oreDictName, entry.oreDictName, entry.oreDictName, entry.oreDictName, entry.oreDictName, entry.oreDictName, entry.oreDictName, entry.oreDictName }));
GameRegistry.addRecipe(new GT_Shapeless_Recipe(GT_OreDictUnificator.get(OrePrefixes.round, aMaterial, 1L), new Object[] { GT_ToolDictNames.craftingToolFile.toString(), entry.oreDictName, entry.oreDictName })); if (round != null)
GameRegistry.addRecipe(new GT_Shapeless_Recipe(GT_OreDictUnificator.get(OrePrefixes.round, aMaterial, 1L), new Object[] { GT_ToolDictNames.craftingToolFile.toString(), entry.oreDictName, entry.oreDictName }));
}); });
} }
} }