Skip to content

Commit 050d129

Browse files
committed
Fix CraftTweaker .circuit(#) ignoring config #
CTRecipeBuilder::circuit(num) was improperly converting inputs resulting in the NBT not being considered during recipe lookups. This old bug from GTCE's logic resulted in all such recipes matching any integrated circuit rather than the one with the requested configuration. Now validates the requested config number and supplies a nonConsumable IntCircuitIngredient instead, resulting in the correct behavior.
1 parent ca3b6d1 commit 050d129

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main/java/gregtech/api/recipes/crafttweaker/CTRecipeBuilder.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package gregtech.api.recipes.crafttweaker;
22

3+
import crafttweaker.CraftTweakerAPI;
34
import crafttweaker.annotations.ZenRegister;
45
import crafttweaker.api.item.IIngredient;
56
import crafttweaker.api.item.IItemStack;
@@ -67,7 +68,9 @@ public CTRecipeBuilder notConsumable(ILiquidStack ingredient) {
6768

6869
@ZenMethod
6970
public CTRecipeBuilder circuit(int num) {
70-
this.backingBuilder.notConsumable(CraftTweakerIngredientWrapper.fromStacks(IntCircuitIngredient.getIntegratedCircuit(num)));
71+
if(num < 0 || num > IntCircuitIngredient.CIRCUIT_MAX)
72+
CraftTweakerAPI.logError("Invalid circuit number "+ num, new IllegalArgumentException());
73+
this.backingBuilder.notConsumable(new IntCircuitIngredient(num));
7174
return this;
7275
}
7376

0 commit comments

Comments
 (0)