Skip to content

Commit 7f1bc33

Browse files
committed
Fix tests
1 parent f5ac4a7 commit 7f1bc33

File tree

4 files changed

+54
-21
lines changed

4 files changed

+54
-21
lines changed

src/test/java/com/gregtechceu/gtceu/api/recipe/ingredient/IntProviderFluidIngredientTest.java

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,14 @@ public static void prepare(ServerLevel level) {
7878
CENTRIFUGE_RECIPE_TYPE = TestUtils.createRecipeType("ranged_fluid_ingredient_centrifuge_tests",
7979
GTRecipeTypes.CENTRIFUGE_RECIPES);
8080

81-
CR_RECIPE_TYPE.getLookup().addRecipe(CR_RECIPE_TYPE
81+
var CRHandler = CR_RECIPE_TYPE.getAdditionHandler();
82+
CRHandler.beginStaging();
83+
var LCRHandler = LCR_RECIPE_TYPE.getAdditionHandler();
84+
LCRHandler.beginStaging();
85+
var centHandler = CENTRIFUGE_RECIPE_TYPE.getAdditionHandler();
86+
centHandler.beginStaging();
87+
88+
CRHandler.addStaging(CR_RECIPE_TYPE
8289
.recipeBuilder(GTCEu.id("test_ranged_input_fluid_cr"))
8390
.inputFluidsRanged(CR_IN, UniformInt.of(0, 9))
8491
.inputItems(COBBLE)
@@ -87,15 +94,15 @@ public static void prepare(ServerLevel level) {
8794
.duration(2)
8895
.buildRawRecipe());
8996

90-
CR_RECIPE_TYPE.getLookup().addRecipe(CR_RECIPE_TYPE
97+
CRHandler.addStaging(CR_RECIPE_TYPE
9198
.recipeBuilder(GTCEu.id("test_ranged_output_fluid_cr"))
9299
.inputFluids(CR_OUT)
93100
.outputFluidsRanged(REDSTONE, UniformInt.of(0, 9))
94101
.EUt(GTValues.V[GTValues.HV])
95102
.duration(2)
96103
.buildRawRecipe());
97104

98-
LCR_RECIPE_TYPE.getLookup().addRecipe(LCR_RECIPE_TYPE
105+
LCRHandler.addStaging(LCR_RECIPE_TYPE
99106
.recipeBuilder(GTCEu.id("test_ranged_input_fluid_lcr"))
100107
.inputFluidsRanged(LCR_IN, UniformInt.of(0, 9))
101108
.inputFluids(RUBBER)
@@ -104,15 +111,15 @@ public static void prepare(ServerLevel level) {
104111
.duration(2)
105112
.buildRawRecipe());
106113

107-
LCR_RECIPE_TYPE.getLookup().addRecipe(LCR_RECIPE_TYPE
114+
LCRHandler.addStaging(LCR_RECIPE_TYPE
108115
.recipeBuilder(GTCEu.id("test_ranged_output_fluid_lcr"))
109116
.inputFluids(LCR_OUT)
110117
.outputFluidsRanged(REDSTONE, UniformInt.of(0, 9))
111118
.EUt(GTValues.V[GTValues.HV])
112119
.duration(2)
113120
.buildRawRecipe());
114121

115-
CENTRIFUGE_RECIPE_TYPE.getLookup().addRecipe(CENTRIFUGE_RECIPE_TYPE
122+
centHandler.addStaging(CENTRIFUGE_RECIPE_TYPE
116123
.recipeBuilder(GTCEu.id("test_ranged_input_fluid_cent"))
117124
.inputFluidsRanged(LCENT_IN, UniformInt.of(0, 40))
118125
.inputItems(COBBLE)
@@ -121,13 +128,17 @@ public static void prepare(ServerLevel level) {
121128
.duration(4)
122129
.buildRawRecipe());
123130

124-
CENTRIFUGE_RECIPE_TYPE.getLookup().addRecipe(CENTRIFUGE_RECIPE_TYPE
131+
centHandler.addStaging(CENTRIFUGE_RECIPE_TYPE
125132
.recipeBuilder(GTCEu.id("test_ranged_output_fluid_cent"))
126133
.inputFluids(LCENT_OUT)
127134
.outputFluidsRanged(REDSTONE, UniformInt.of(0, 40))
128135
.EUt(GTValues.V[GTValues.IV])
129136
.duration(4)
130137
.buildRawRecipe());
138+
139+
CRHandler.completeStaging();
140+
LCRHandler.completeStaging();
141+
centHandler.completeStaging();
131142
}
132143

133144
private static MetaMachine getMetaMachine(BlockEntity entity) {

src/test/java/com/gregtechceu/gtceu/api/recipe/ingredient/IntProviderIngredientTest.java

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import com.gregtechceu.gtceu.api.machine.multiblock.WorkableMultiblockMachine;
1212
import com.gregtechceu.gtceu.api.machine.trait.NotifiableItemStackHandler;
1313
import com.gregtechceu.gtceu.api.recipe.GTRecipeType;
14+
import com.gregtechceu.gtceu.common.data.GTRecipeTypes;
1415
import com.gregtechceu.gtceu.common.machine.multiblock.part.FluidHatchPartMachine;
1516
import com.gregtechceu.gtceu.common.machine.multiblock.part.ItemBusPartMachine;
1617
import com.gregtechceu.gtceu.common.machine.multiblock.part.ParallelHatchPartMachine;
@@ -66,11 +67,20 @@ public class IntProviderIngredientTest {
6667

6768
@BeforeBatch(batch = "RangedIngredients")
6869
public static void prepare(ServerLevel level) {
69-
CR_RECIPE_TYPE = TestUtils.createRecipeType("ranged_ingredient_cr_tests", 2, 2, 3, 2);
70-
LCR_RECIPE_TYPE = TestUtils.createRecipeType("ranged_ingredient_lcr_tests", 3, 3, 5, 4);
71-
CENTRIFUGE_RECIPE_TYPE = TestUtils.createRecipeType("ranged_ingredient_centrifuge_tests", 2, 6, 1, 6);
72-
73-
CR_RECIPE_TYPE.getLookup().addRecipe(CR_RECIPE_TYPE
70+
CR_RECIPE_TYPE = TestUtils.createRecipeType("ranged_ingredient_cr_tests", GTRecipeTypes.CHEMICAL_RECIPES);
71+
LCR_RECIPE_TYPE = TestUtils.createRecipeType("ranged_ingredient_lcr_tests",
72+
GTRecipeTypes.LARGE_CHEMICAL_RECIPES);
73+
CENTRIFUGE_RECIPE_TYPE = TestUtils.createRecipeType("ranged_ingredient_centrifuge_tests",
74+
GTRecipeTypes.CENTRIFUGE_RECIPES);
75+
76+
var CRHandler = CR_RECIPE_TYPE.getAdditionHandler();
77+
CRHandler.beginStaging();
78+
var LCRHandler = LCR_RECIPE_TYPE.getAdditionHandler();
79+
LCRHandler.beginStaging();
80+
var centHandler = CENTRIFUGE_RECIPE_TYPE.getAdditionHandler();
81+
centHandler.beginStaging();
82+
83+
CRHandler.addStaging(CR_RECIPE_TYPE
7484
.recipeBuilder(GTCEu.id("test_ranged_input_item_cr"))
7585
.inputItemsRanged(CR_IN, UniformInt.of(0, 9))
7686
.inputItems(COBBLE)
@@ -79,15 +89,15 @@ public static void prepare(ServerLevel level) {
7989
.duration(2)
8090
.buildRawRecipe());
8191

82-
CR_RECIPE_TYPE.getLookup().addRecipe(CR_RECIPE_TYPE
92+
CRHandler.addStaging(CR_RECIPE_TYPE
8393
.recipeBuilder(GTCEu.id("test_ranged_output_item_cr"))
8494
.inputItems(CR_OUT)
8595
.outputItemsRanged(STONE, UniformInt.of(0, 9))
8696
.EUt(GTValues.V[GTValues.HV])
8797
.duration(2)
8898
.buildRawRecipe());
8999

90-
LCR_RECIPE_TYPE.getLookup().addRecipe(LCR_RECIPE_TYPE
100+
LCRHandler.addStaging(LCR_RECIPE_TYPE
91101
.recipeBuilder(GTCEu.id("test_ranged_input_item_lcr"))
92102
.inputItemsRanged(LCR_IN, UniformInt.of(0, 9))
93103
.inputItems(COBBLE)
@@ -96,15 +106,15 @@ public static void prepare(ServerLevel level) {
96106
.duration(2)
97107
.buildRawRecipe());
98108

99-
LCR_RECIPE_TYPE.getLookup().addRecipe(LCR_RECIPE_TYPE
109+
LCRHandler.addStaging(LCR_RECIPE_TYPE
100110
.recipeBuilder(GTCEu.id("test_ranged_output_item_lcr"))
101111
.inputItems(LCR_OUT)
102112
.outputItemsRanged(STONE, UniformInt.of(0, 9))
103113
.EUt(GTValues.V[GTValues.HV])
104114
.duration(2)
105115
.buildRawRecipe());
106116

107-
CENTRIFUGE_RECIPE_TYPE.getLookup().addRecipe(CENTRIFUGE_RECIPE_TYPE
117+
centHandler.addStaging(CENTRIFUGE_RECIPE_TYPE
108118
.recipeBuilder(GTCEu.id("test_ranged_input_item_cent"))
109119
.inputItemsRanged(LCENT_IN, UniformInt.of(0, 4))
110120
.inputItems(COBBLE)
@@ -113,13 +123,17 @@ public static void prepare(ServerLevel level) {
113123
.duration(4)
114124
.buildRawRecipe());
115125

116-
CENTRIFUGE_RECIPE_TYPE.getLookup().addRecipe(CENTRIFUGE_RECIPE_TYPE
126+
centHandler.addStaging(CENTRIFUGE_RECIPE_TYPE
117127
.recipeBuilder(GTCEu.id("test_ranged_output_item_cent"))
118128
.inputItems(LCENT_OUT)
119129
.outputItemsRanged(STONE, UniformInt.of(0, 4))
120130
.EUt(GTValues.V[GTValues.IV])
121131
.duration(4)
122132
.buildRawRecipe());
133+
134+
CRHandler.completeStaging();
135+
LCRHandler.completeStaging();
136+
centHandler.completeStaging();
123137
}
124138

125139
private static MetaMachine getMetaMachine(BlockEntity entity) {

src/test/java/com/gregtechceu/gtceu/api/recipe/ingredient/NBTPredicateTest.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,18 @@ public class NBTPredicateTest {
3535
@BeforeBatch(batch = "NBTPredicateTest")
3636
public static void prepare(ServerLevel level) {
3737
CR_RECIPE_TYPE = TestUtils.createRecipeType("nbt_predicate_ingredient_cr_tests", CHEMICAL_RECIPES);
38-
CR_RECIPE_TYPE.getLookup().addRecipe(
38+
var CRHandler = CR_RECIPE_TYPE.getAdditionHandler();
39+
CRHandler.beginStaging();
40+
41+
CRHandler.addStaging(
3942
CR_RECIPE_TYPE.recipeBuilder("nbt_predicate_test")
4043
.inputItemNbtPredicate(new ItemStack(Items.FEATHER), eq("foo", "bar"))
4144
.outputItems(new ItemStack(Items.COAL))
4245
.EUt(GTValues.V[GTValues.HV])
4346
.duration(5)
4447
.buildRawRecipe());
4548

46-
CR_RECIPE_TYPE.getLookup().addRecipe(
49+
CRHandler.addStaging(
4750
CR_RECIPE_TYPE.recipeBuilder("nbt_predicate_test_chanced")
4851
.chance(4000)
4952
.inputItemNbtPredicate(new ItemStack(Items.FEATHER), eq("bin", "bar"))
@@ -53,7 +56,7 @@ public static void prepare(ServerLevel level) {
5356
.duration(4)
5457
.buildRawRecipe());
5558

56-
CR_RECIPE_TYPE.getLookup().addRecipe(
59+
CRHandler.addStaging(
5760
CR_RECIPE_TYPE.recipeBuilder("nbt_predicate_test_ranged")
5861
.inputItemRanged(new IntProviderIngredient(new NBTPredicateIngredient(
5962
new ItemStack(Items.FEATHER), eq("bash", "bar")), UniformInt.of(0, 4)))
@@ -62,7 +65,7 @@ public static void prepare(ServerLevel level) {
6265
.duration(4)
6366
.buildRawRecipe());
6467

65-
CR_RECIPE_TYPE.getLookup().addRecipe(
68+
CRHandler.addStaging(
6669
CR_RECIPE_TYPE.recipeBuilder("nbt_predicate_test_chanced_ranged")
6770
.chance(4000)
6871
.inputItemRanged(new IntProviderIngredient(new NBTPredicateIngredient(
@@ -72,6 +75,7 @@ public static void prepare(ServerLevel level) {
7275
.EUt(GTValues.V[GTValues.HV])
7376
.duration(4)
7477
.buildRawRecipe());
78+
CRHandler.completeStaging();
7579
}
7680

7781
@GameTest(template = "empty", batch = "NBTPredicateTest")

src/test/java/com/gregtechceu/gtceu/common/machine/multiblock/electric/AssemblyLineTests.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,18 @@ public class AssemblyLineTests {
3333
@BeforeBatch(batch = "Assline")
3434
public static void prepare(ServerLevel level) {
3535
ASSLINE_RECIPE_TYPE = TestUtils.createRecipeType("assline_tests", ASSEMBLY_LINE_RECIPES);
36-
ASSLINE_RECIPE_TYPE.getLookup().addRecipe(ASSLINE_RECIPE_TYPE
36+
var assLineHandler = ASSLINE_RECIPE_TYPE.getAdditionHandler();
37+
assLineHandler.beginStaging();
38+
39+
assLineHandler.addStaging(ASSLINE_RECIPE_TYPE
3740
.recipeBuilder(GTCEu.id("test_assline"))
3841
.inputItems(new ItemStack(Blocks.COBBLESTONE), new ItemStack(Blocks.ACACIA_WOOD))
3942
.inputFluids(new FluidStack(Fluids.WATER, 1), new FluidStack(Fluids.LAVA, 1))
4043
.outputItems(new ItemStack(Blocks.STONE))
4144
.EUt(GTValues.VA[GTValues.HV]).duration(1)
4245
// NBT has a schematic in it with an EV energy input hatch
4346
.buildRawRecipe());
47+
assLineHandler.completeStaging();
4448
}
4549

4650
private record BusHolder(ItemBusPartMachine inputBus1, ItemBusPartMachine inputBus2,

0 commit comments

Comments
 (0)