• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

CyclopsMC / IntegratedDynamics / 20210191346

14 Dec 2025 03:32PM UTC coverage: 19.514% (-33.5%) from 53.061%
20210191346

push

github

rubensworks
Remove deprecations

663 of 8728 branches covered (7.6%)

Branch coverage included in aggregate %.

6786 of 29445 relevant lines covered (23.05%)

1.09 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/main/java/org/cyclops/integrateddynamics/gametest/GameTestsAspectsReadMachine.java
1
package org.cyclops.integrateddynamics.gametest;
2

3
import com.google.common.collect.Lists;
4
import net.minecraft.core.BlockPos;
5
import net.minecraft.gametest.framework.GameTestHelper;
6
import net.minecraft.world.item.ItemStack;
7
import net.minecraft.world.item.Items;
8
import net.minecraft.world.level.block.Blocks;
9
import net.minecraft.world.level.block.entity.FurnaceBlockEntity;
10
import org.cyclops.commoncapabilities.IngredientComponents;
11
import org.cyclops.commoncapabilities.api.ingredient.IMixedIngredients;
12
import org.cyclops.commoncapabilities.api.ingredient.MixedIngredients;
13
import org.cyclops.cyclopscore.gametest.GameTest;
14
import org.cyclops.integrateddynamics.RegistryEntries;
15
import org.cyclops.integrateddynamics.api.evaluate.EvaluationException;
16
import org.cyclops.integrateddynamics.blockentity.BlockEntityEnergyBattery;
17
import org.cyclops.integrateddynamics.core.evaluate.variable.*;
18
import org.cyclops.integrateddynamics.core.part.PartTypes;
19
import org.cyclops.integrateddynamics.part.aspect.Aspects;
20

21
import static org.cyclops.integrateddynamics.gametest.GameTestHelpersIntegratedDynamics.*;
22

23
public class GameTestsAspectsReadMachine {
×
24

25
    public static final String TEMPLATE_EMPTY = "integrateddynamics:empty10";
26
    public static final BlockPos POS = BlockPos.ZERO.offset(2, 0, 2);
×
27

28
    @GameTest(template = TEMPLATE_EMPTY)
29
    public void testAspectsReadMachineIsWorkerFalse(GameTestHelper helper) {
30
        helper.setBlock(POS.west(), Blocks.STONE);
×
31
        testReadAspect(POS, helper, PartTypes.MACHINE_READER, Aspects.Read.Machine.BOOLEAN_ISWORKER, ValueTypeBoolean.ValueBoolean.of(false));
×
32
    }
×
33

34
    @GameTest(template = TEMPLATE_EMPTY)
35
    public void testAspectsReadMachineIsWorkerTrue(GameTestHelper helper) {
36
        helper.setBlock(POS.west(), Blocks.FURNACE);
×
37
        testReadAspect(POS, helper, PartTypes.MACHINE_READER, Aspects.Read.Machine.BOOLEAN_ISWORKER, ValueTypeBoolean.ValueBoolean.of(true));
×
38
    }
×
39

40
    @GameTest(template = TEMPLATE_EMPTY)
41
    public void testAspectsReadMachineHasWorkFalseInvalid(GameTestHelper helper) {
42
        helper.setBlock(POS.west(), Blocks.STONE);
×
43
        testReadAspect(POS, helper, PartTypes.MACHINE_READER, Aspects.Read.Machine.BOOLEAN_HASWORK, ValueTypeBoolean.ValueBoolean.of(false));
×
44
    }
×
45

46
    @GameTest(template = TEMPLATE_EMPTY)
47
    public void testAspectsReadMachineHasWorkFalse(GameTestHelper helper) {
48
        helper.setBlock(POS.west(), Blocks.FURNACE);
×
49
        testReadAspect(POS, helper, PartTypes.MACHINE_READER, Aspects.Read.Machine.BOOLEAN_HASWORK, ValueTypeBoolean.ValueBoolean.of(false));
×
50
    }
×
51

52
    @GameTest(template = TEMPLATE_EMPTY)
53
    public void testAspectsReadMachineHasWorkTrue(GameTestHelper helper) {
54
        helper.setBlock(POS.west(), Blocks.FURNACE);
×
55
        FurnaceBlockEntity machine = helper.getBlockEntity(POS.west(), FurnaceBlockEntity.class);
×
56
        machine.setItem(0, new ItemStack(Items.RAW_IRON));
×
57
        testReadAspect(POS, helper, PartTypes.MACHINE_READER, Aspects.Read.Machine.BOOLEAN_HASWORK, ValueTypeBoolean.ValueBoolean.of(true));
×
58
    }
×
59

60
    @GameTest(template = TEMPLATE_EMPTY)
61
    public void testAspectsReadMachineCanWorkFalseInvalid(GameTestHelper helper) {
62
        helper.setBlock(POS.west(), Blocks.STONE);
×
63
        testReadAspect(POS, helper, PartTypes.MACHINE_READER, Aspects.Read.Machine.BOOLEAN_CANWORK, ValueTypeBoolean.ValueBoolean.of(false));
×
64
    }
×
65

66
    @GameTest(template = TEMPLATE_EMPTY)
67
    public void testAspectsReadMachineCanWorkFalse(GameTestHelper helper) {
68
        helper.setBlock(POS.west(), Blocks.FURNACE);
×
69
        testReadAspect(POS, helper, PartTypes.MACHINE_READER, Aspects.Read.Machine.BOOLEAN_CANWORK, ValueTypeBoolean.ValueBoolean.of(false));
×
70
    }
×
71

72
    @GameTest(template = TEMPLATE_EMPTY)
73
    public void testAspectsReadMachineCanWorkTrue(GameTestHelper helper) {
74
        helper.setBlock(POS.west(), Blocks.FURNACE);
×
75
        FurnaceBlockEntity machine = helper.getBlockEntity(POS.west(), FurnaceBlockEntity.class);
×
76
        machine.setItem(1, new ItemStack(Items.COAL));
×
77
        testReadAspect(POS, helper, PartTypes.MACHINE_READER, Aspects.Read.Machine.BOOLEAN_CANWORK, ValueTypeBoolean.ValueBoolean.of(true));
×
78
    }
×
79

80
    @GameTest(template = TEMPLATE_EMPTY)
81
    public void testAspectsReadMachineIsWorkingFalseInvalid(GameTestHelper helper) {
82
        helper.setBlock(POS.west(), Blocks.STONE);
×
83
        testReadAspect(POS, helper, PartTypes.MACHINE_READER, Aspects.Read.Machine.BOOLEAN_ISWORKING, ValueTypeBoolean.ValueBoolean.of(false));
×
84
    }
×
85

86
    @GameTest(template = TEMPLATE_EMPTY)
87
    public void testAspectsReadMachineIsWorkingFalse(GameTestHelper helper) {
88
        helper.setBlock(POS.west(), Blocks.FURNACE);
×
89
        testReadAspect(POS, helper, PartTypes.MACHINE_READER, Aspects.Read.Machine.BOOLEAN_ISWORKING, ValueTypeBoolean.ValueBoolean.of(false));
×
90
    }
×
91

92
    @GameTest(template = TEMPLATE_EMPTY)
93
    public void testAspectsReadMachineIsWorkingTrue(GameTestHelper helper) {
94
        helper.setBlock(POS.west(), Blocks.FURNACE);
×
95
        FurnaceBlockEntity machine = helper.getBlockEntity(POS.west(), FurnaceBlockEntity.class);
×
96
        machine.setItem(0, new ItemStack(Items.RAW_IRON));
×
97
        machine.setItem(1, new ItemStack(Items.COAL));
×
98
        testReadAspect(POS, helper, PartTypes.MACHINE_READER, Aspects.Read.Machine.BOOLEAN_ISWORKING, ValueTypeBoolean.ValueBoolean.of(true));
×
99
    }
×
100

101
    @GameTest(template = TEMPLATE_EMPTY)
102
    public void testAspectsReadMachineIsTemperatureFalse(GameTestHelper helper) {
103
        helper.setBlock(POS.west(), Blocks.STONE);
×
104
        testReadAspect(POS, helper, PartTypes.MACHINE_READER, Aspects.Read.Machine.BOOLEAN_ISTEMPERATURE, ValueTypeBoolean.ValueBoolean.of(false));
×
105
    }
×
106

107
    @GameTest(template = TEMPLATE_EMPTY)
108
    public void testAspectsReadMachineIsTemperatureTrue(GameTestHelper helper) {
109
        helper.setBlock(POS.west(), Blocks.FURNACE);
×
110
        testReadAspect(POS, helper, PartTypes.MACHINE_READER, Aspects.Read.Machine.BOOLEAN_ISTEMPERATURE, ValueTypeBoolean.ValueBoolean.of(true));
×
111
    }
×
112

113
    @GameTest(template = TEMPLATE_EMPTY)
114
    public void testAspectsReadMachineTemperatureInvalid(GameTestHelper helper) {
115
        helper.setBlock(POS.west(), Blocks.STONE);
×
116
        testReadAspect(POS, helper, PartTypes.MACHINE_READER, Aspects.Read.Machine.DOUBLE_TEMPERATURE, ValueTypeDouble.ValueDouble.of(0D));
×
117
    }
×
118

119
    @GameTest(template = TEMPLATE_EMPTY)
120
    public void testAspectsReadMachineTemperature(GameTestHelper helper) {
121
        helper.setBlock(POS.west(), Blocks.FURNACE);
×
122
        FurnaceBlockEntity machine = helper.getBlockEntity(POS.west(), FurnaceBlockEntity.class);
×
123
        machine.setItem(0, new ItemStack(Items.RAW_IRON));
×
124
        machine.setItem(1, new ItemStack(Items.COAL));
×
125
        testReadAspect(POS, helper, PartTypes.MACHINE_READER, Aspects.Read.Machine.DOUBLE_TEMPERATURE, ValueTypeDouble.ValueDouble.of(273.15D + 1600D));
×
126
    }
×
127

128
    @GameTest(template = TEMPLATE_EMPTY)
129
    public void testAspectsReadMachineTemperatureWorking(GameTestHelper helper) {
130
        helper.setBlock(POS.west(), Blocks.FURNACE);
×
131
        testReadAspect(POS, helper, PartTypes.MACHINE_READER, Aspects.Read.Machine.DOUBLE_TEMPERATURE, ValueTypeDouble.ValueDouble.of(273.15D));
×
132
    }
×
133

134
    @GameTest(template = TEMPLATE_EMPTY)
135
    public void testAspectsReadMachineMaxTemperatureInvalid(GameTestHelper helper) {
136
        helper.setBlock(POS.west(), Blocks.STONE);
×
137
        testReadAspect(POS, helper, PartTypes.MACHINE_READER, Aspects.Read.Machine.DOUBLE_MAXTEMPERATURE, ValueTypeDouble.ValueDouble.of(0D));
×
138
    }
×
139

140
    @GameTest(template = TEMPLATE_EMPTY)
141
    public void testAspectsReadMachineMaxTemperature(GameTestHelper helper) {
142
        helper.setBlock(POS.west(), Blocks.FURNACE);
×
143
        testReadAspect(POS, helper, PartTypes.MACHINE_READER, Aspects.Read.Machine.DOUBLE_MAXTEMPERATURE, ValueTypeDouble.ValueDouble.of(Double.MAX_VALUE));
×
144
    }
×
145

146
    @GameTest(template = TEMPLATE_EMPTY)
147
    public void testAspectsReadMachineMinTemperatureInvalid(GameTestHelper helper) {
148
        helper.setBlock(POS.west(), Blocks.STONE);
×
149
        testReadAspect(POS, helper, PartTypes.MACHINE_READER, Aspects.Read.Machine.DOUBLE_MINTEMPERATURE, ValueTypeDouble.ValueDouble.of(0D));
×
150
    }
×
151

152
    @GameTest(template = TEMPLATE_EMPTY)
153
    public void testAspectsReadMachineMinTemperature(GameTestHelper helper) {
154
        helper.setBlock(POS.west(), Blocks.FURNACE);
×
155
        testReadAspect(POS, helper, PartTypes.MACHINE_READER, Aspects.Read.Machine.DOUBLE_MINTEMPERATURE, ValueTypeDouble.ValueDouble.of(273.15));
×
156
    }
×
157

158
    @GameTest(template = TEMPLATE_EMPTY)
159
    public void testAspectsReadMachineDefaultTemperatureInvalid(GameTestHelper helper) {
160
        helper.setBlock(POS.west(), Blocks.STONE);
×
161
        testReadAspect(POS, helper, PartTypes.MACHINE_READER, Aspects.Read.Machine.DOUBLE_DEFAULTTEMPERATURE, ValueTypeDouble.ValueDouble.of(0D));
×
162
    }
×
163

164
    @GameTest(template = TEMPLATE_EMPTY)
165
    public void testAspectsReadMachineDefaultTemperature(GameTestHelper helper) {
166
        helper.setBlock(POS.west(), Blocks.FURNACE);
×
167
        testReadAspect(POS, helper, PartTypes.MACHINE_READER, Aspects.Read.Machine.DOUBLE_DEFAULTTEMPERATURE, ValueTypeDouble.ValueDouble.of(273.15));
×
168
    }
×
169

170
    @GameTest(template = TEMPLATE_EMPTY)
171
    public void testAspectsReadMachineIsRecipeHandlerFalse(GameTestHelper helper) {
172
        helper.setBlock(POS.west(), Blocks.STONE);
×
173
        testReadAspect(POS, helper, PartTypes.MACHINE_READER, Aspects.Read.Machine.BOOLEAN_ISRECIPEHANDLER, ValueTypeBoolean.ValueBoolean.of(false));
×
174
    }
×
175

176
    @GameTest(template = TEMPLATE_EMPTY)
177
    public void testAspectsReadMachineIsRecipeHandlerTrue(GameTestHelper helper) {
178
        helper.setBlock(POS.west(), Blocks.FURNACE);
×
179
        testReadAspect(POS, helper, PartTypes.MACHINE_READER, Aspects.Read.Machine.BOOLEAN_ISRECIPEHANDLER, ValueTypeBoolean.ValueBoolean.of(true));
×
180
    }
×
181

182
    @GameTest(template = TEMPLATE_EMPTY)
183
    public void testAspectsReadMachineRecipesInvalid(GameTestHelper helper) {
184
        helper.setBlock(POS.west(), Blocks.STONE);
×
185
        testReadAspect(POS, helper, PartTypes.MACHINE_READER, Aspects.Read.Machine.LIST_GETRECIPES, ValueTypeList.ValueList.ofAll());
×
186
    }
×
187

188
    @GameTest(template = TEMPLATE_EMPTY)
189
    public void testAspectsReadMachineRecipes(GameTestHelper helper) {
190
        helper.setBlock(POS.west(), Blocks.FURNACE);
×
191
        testReadAspectPredicate(POS, helper, PartTypes.MACHINE_READER, Aspects.Read.Machine.LIST_GETRECIPES, list -> {
×
192
            try {
193
                return list.getRawValue().getLength() > 10;
×
194
            } catch (EvaluationException e) {
×
195
                throw new RuntimeException(e);
×
196
            }
197
        });
198
    }
×
199

200
    @GameTest(template = TEMPLATE_EMPTY)
201
    public void testAspectsReadMachineGetRecipeOutputInvalid(GameTestHelper helper) {
202
        helper.setBlock(POS.west(), Blocks.STONE);
×
203
        testReadAspectOperator(POS, helper, PartTypes.MACHINE_READER, Aspects.Read.Machine.OPERATOR_GETRECIPEOUTPUT,
×
204
                Lists.newArrayList(ValueObjectTypeIngredients.ValueIngredients.of(MixedIngredients.ofInstance(IngredientComponents.ITEMSTACK, new ItemStack(Items.RAW_IRON)))),
×
205
                ValueObjectTypeIngredients.ValueIngredients.of(null)
×
206
        );
207
    }
×
208

209
    @GameTest(template = TEMPLATE_EMPTY)
210
    public void testAspectsReadMachineGetRecipeOutput(GameTestHelper helper) {
211
        helper.setBlock(POS.west(), Blocks.FURNACE);
×
212
        IMixedIngredients ingredients = MixedIngredients.ofInstance(IngredientComponents.ITEMSTACK, new ItemStack(Items.RAW_IRON));
×
213
        testReadAspectOperator(POS, helper, PartTypes.MACHINE_READER, Aspects.Read.Machine.OPERATOR_GETRECIPEOUTPUT,
×
214
                Lists.newArrayList(ValueObjectTypeIngredients.ValueIngredients.of(ingredients)),
×
215
                ValueObjectTypeIngredients.ValueIngredients.of(MixedIngredients.ofInstance(IngredientComponents.ITEMSTACK, new ItemStack(Items.IRON_INGOT)))
×
216
        );
217
    }
×
218

219
    @GameTest(template = TEMPLATE_EMPTY)
220
    public void testAspectsReadMachineGetRecipeInputsInvalid(GameTestHelper helper) {
221
        helper.setBlock(POS.west(), Blocks.STONE);
×
222
        testReadAspectOperator(POS, helper, PartTypes.MACHINE_READER, Aspects.Read.Machine.OPERATOR_GETRECIPEINPUTS,
×
223
                Lists.newArrayList(ValueObjectTypeIngredients.ValueIngredients.of(MixedIngredients.ofInstance(IngredientComponents.ITEMSTACK, new ItemStack(Items.IRON_INGOT)))),
×
224
                ValueTypeList.ValueList.ofAll()
×
225
        );
226
    }
×
227

228
    @GameTest(template = TEMPLATE_EMPTY)
229
    public void testAspectsReadMachineGetRecipeInputs(GameTestHelper helper) {
230
        helper.setBlock(POS.west(), Blocks.FURNACE);
×
231
        IMixedIngredients ingredients = MixedIngredients.ofInstance(IngredientComponents.ITEMSTACK, new ItemStack(Items.IRON_INGOT));
×
232
        testReadAspectOperatorPredicate(POS, helper, PartTypes.MACHINE_READER, Aspects.Read.Machine.OPERATOR_GETRECIPEINPUTS,
×
233
                Lists.newArrayList(ValueObjectTypeIngredients.ValueIngredients.of(ingredients)),
×
234
                value -> {
235
                    try {
236
                        return value instanceof ValueTypeList.ValueList<?,?> list && list.getRawValue().getLength() >= 3;
×
237
                    } catch (EvaluationException e) {
×
238
                        throw new RuntimeException(e);
×
239
                    }
240
                }
241
        );
242
    }
×
243

244
    @GameTest(template = TEMPLATE_EMPTY)
245
    public void testAspectsReadMachineGetRecipesByInputsInvalid(GameTestHelper helper) {
246
        helper.setBlock(POS.west(), Blocks.STONE);
×
247
        testReadAspectOperator(POS, helper, PartTypes.MACHINE_READER, Aspects.Read.Machine.OPERATOR_GETRECIPESBYINPUT,
×
248
                Lists.newArrayList(ValueObjectTypeIngredients.ValueIngredients.of(MixedIngredients.ofInstance(IngredientComponents.ITEMSTACK, new ItemStack(Items.RAW_IRON)))),
×
249
                ValueTypeList.ValueList.ofAll()
×
250
        );
251
    }
×
252

253
    @GameTest(template = TEMPLATE_EMPTY)
254
    public void testAspectsReadMachineGetRecipesByInputsInputs(GameTestHelper helper) {
255
        helper.setBlock(POS.west(), Blocks.FURNACE);
×
256
        IMixedIngredients ingredients = MixedIngredients.ofInstance(IngredientComponents.ITEMSTACK, new ItemStack(Items.RAW_IRON));
×
257
        testReadAspectOperatorPredicate(POS, helper, PartTypes.MACHINE_READER, Aspects.Read.Machine.OPERATOR_GETRECIPESBYINPUT,
×
258
                Lists.newArrayList(ValueObjectTypeIngredients.ValueIngredients.of(ingredients)),
×
259
                value -> {
260
                    try {
261
                        return value instanceof ValueTypeList.ValueList<?,?> list && list.getRawValue().getLength() == 1;
×
262
                    } catch (EvaluationException e) {
×
263
                        throw new RuntimeException(e);
×
264
                    }
265
                }
266
        );
267
    }
×
268

269
    @GameTest(template = TEMPLATE_EMPTY)
270
    public void testAspectsReadMachineGetRecipesByOutputInvalid(GameTestHelper helper) {
271
        helper.setBlock(POS.west(), Blocks.STONE);
×
272
        testReadAspectOperator(POS, helper, PartTypes.MACHINE_READER, Aspects.Read.Machine.OPERATOR_GETRECIPESBYOUTPUT,
×
273
                Lists.newArrayList(ValueObjectTypeIngredients.ValueIngredients.of(MixedIngredients.ofInstance(IngredientComponents.ITEMSTACK, new ItemStack(Items.IRON_INGOT)))),
×
274
                ValueTypeList.ValueList.ofAll()
×
275
        );
276
    }
×
277

278
    @GameTest(template = TEMPLATE_EMPTY)
279
    public void testAspectsReadMachineGetRecipesByOutput(GameTestHelper helper) {
280
        helper.setBlock(POS.west(), Blocks.FURNACE);
×
281
        IMixedIngredients ingredients = MixedIngredients.ofInstance(IngredientComponents.ITEMSTACK, new ItemStack(Items.IRON_INGOT));
×
282
        testReadAspectOperatorPredicate(POS, helper, PartTypes.MACHINE_READER, Aspects.Read.Machine.OPERATOR_GETRECIPESBYOUTPUT,
×
283
                Lists.newArrayList(ValueObjectTypeIngredients.ValueIngredients.of(ingredients)),
×
284
                value -> {
285
                    try {
286
                        return value instanceof ValueTypeList.ValueList<?,?> list && list.getRawValue().getLength() == 3;
×
287
                    } catch (EvaluationException e) {
×
288
                        throw new RuntimeException(e);
×
289
                    }
290
                }
291
        );
292
    }
×
293

294
    @GameTest(template = TEMPLATE_EMPTY)
295
    public void testAspectsReadMachineGetRecipeByInputsInvalid(GameTestHelper helper) {
296
        helper.setBlock(POS.west(), Blocks.STONE);
×
297
        testReadAspectOperator(POS, helper, PartTypes.MACHINE_READER, Aspects.Read.Machine.OPERATOR_GETRECIPEBYINPUT,
×
298
                Lists.newArrayList(ValueObjectTypeIngredients.ValueIngredients.of(MixedIngredients.ofInstance(IngredientComponents.ITEMSTACK, new ItemStack(Items.RAW_IRON)))),
×
299
                ValueObjectTypeRecipe.ValueRecipe.of(null)
×
300
        );
301
    }
×
302

303
    @GameTest(template = TEMPLATE_EMPTY)
304
    public void testAspectsReadMachineGetRecipeByInputsInputs(GameTestHelper helper) {
305
        helper.setBlock(POS.west(), Blocks.FURNACE);
×
306
        IMixedIngredients ingredients = MixedIngredients.ofInstance(IngredientComponents.ITEMSTACK, new ItemStack(Items.RAW_IRON));
×
307
        testReadAspectOperatorPredicate(POS, helper, PartTypes.MACHINE_READER, Aspects.Read.Machine.OPERATOR_GETRECIPEBYINPUT,
×
308
                Lists.newArrayList(ValueObjectTypeIngredients.ValueIngredients.of(ingredients)),
×
309
                value -> value instanceof ValueObjectTypeRecipe.ValueRecipe recipe && recipe.getRawValue().isPresent()
×
310
        );
311
    }
×
312

313
    @GameTest(template = TEMPLATE_EMPTY)
314
    public void testAspectsReadMachineGetRecipeByOutputInvalid(GameTestHelper helper) {
315
        helper.setBlock(POS.west(), Blocks.STONE);
×
316
        testReadAspectOperator(POS, helper, PartTypes.MACHINE_READER, Aspects.Read.Machine.OPERATOR_GETRECIPEBYOUTPUT,
×
317
                Lists.newArrayList(ValueObjectTypeIngredients.ValueIngredients.of(MixedIngredients.ofInstance(IngredientComponents.ITEMSTACK, new ItemStack(Items.IRON_INGOT)))),
×
318
                ValueObjectTypeRecipe.ValueRecipe.of(null)
×
319
        );
320
    }
×
321

322
    @GameTest(template = TEMPLATE_EMPTY)
323
    public void testAspectsReadMachineGetRecipeByOutput(GameTestHelper helper) {
324
        helper.setBlock(POS.west(), Blocks.FURNACE);
×
325
        IMixedIngredients ingredients = MixedIngredients.ofInstance(IngredientComponents.ITEMSTACK, new ItemStack(Items.IRON_INGOT));
×
326
        testReadAspectOperatorPredicate(POS, helper, PartTypes.MACHINE_READER, Aspects.Read.Machine.OPERATOR_GETRECIPEBYOUTPUT,
×
327
                Lists.newArrayList(ValueObjectTypeIngredients.ValueIngredients.of(ingredients)),
×
328
                value -> value instanceof ValueObjectTypeRecipe.ValueRecipe recipe && recipe.getRawValue().isPresent()
×
329
        );
330
    }
×
331

332
    @GameTest(template = TEMPLATE_EMPTY)
333
    public void testAspectsReadMachineIsEnergyInvalid(GameTestHelper helper) {
334
        helper.setBlock(POS.west(), Blocks.STONE);
×
335
        testReadAspect(POS, helper, PartTypes.MACHINE_READER, Aspects.Read.Machine.BOOLEAN_ISENERGY, ValueTypeBoolean.ValueBoolean.of(false));
×
336
    }
×
337

338
    @GameTest(template = TEMPLATE_EMPTY)
339
    public void testAspectsReadMachineIsEnergyValid(GameTestHelper helper) {
340
        helper.setBlock(POS.west(), RegistryEntries.BLOCK_ENERGY_BATTERY.get());
×
341
        testReadAspect(POS, helper, PartTypes.MACHINE_READER, Aspects.Read.Machine.BOOLEAN_ISENERGY, ValueTypeBoolean.ValueBoolean.of(true));
×
342
    }
×
343

344
    @GameTest(template = TEMPLATE_EMPTY)
345
    public void testAspectsReadMachineCanExtractEnergyInvalid(GameTestHelper helper) {
346
        helper.setBlock(POS.west(), Blocks.STONE);
×
347
        testReadAspect(POS, helper, PartTypes.MACHINE_READER, Aspects.Read.Machine.BOOLEAN_CANEXTRACTENERGY, ValueTypeBoolean.ValueBoolean.of(false));
×
348
    }
×
349

350
    @GameTest(template = TEMPLATE_EMPTY)
351
    public void testAspectsReadMachineCanExtractEnergyValid(GameTestHelper helper) {
352
        helper.setBlock(POS.west(), RegistryEntries.BLOCK_ENERGY_BATTERY.get());
×
353
        BlockEntityEnergyBattery battery = helper.getBlockEntity(POS.west(), BlockEntityEnergyBattery.class);
×
354
        battery.setEnergyStored(100);
×
355
        testReadAspect(POS, helper, PartTypes.MACHINE_READER, Aspects.Read.Machine.BOOLEAN_CANEXTRACTENERGY, ValueTypeBoolean.ValueBoolean.of(true));
×
356
    }
×
357

358
    @GameTest(template = TEMPLATE_EMPTY)
359
    public void testAspectsReadMachineCanExtractEnergyValidFalse(GameTestHelper helper) {
360
        helper.setBlock(POS.west(), RegistryEntries.BLOCK_ENERGY_BATTERY.get());
×
361
        BlockEntityEnergyBattery battery = helper.getBlockEntity(POS.west(), BlockEntityEnergyBattery.class);
×
362
        battery.setEnergyStored(0);
×
363
        testReadAspect(POS, helper, PartTypes.MACHINE_READER, Aspects.Read.Machine.BOOLEAN_CANEXTRACTENERGY, ValueTypeBoolean.ValueBoolean.of(false));
×
364
    }
×
365

366
    @GameTest(template = TEMPLATE_EMPTY)
367
    public void testAspectsReadMachineCanInsertEnergyInvalid(GameTestHelper helper) {
368
        helper.setBlock(POS.west(), Blocks.STONE);
×
369
        testReadAspect(POS, helper, PartTypes.MACHINE_READER, Aspects.Read.Machine.BOOLEAN_CANINSERTENERGY, ValueTypeBoolean.ValueBoolean.of(false));
×
370
    }
×
371

372
    @GameTest(template = TEMPLATE_EMPTY)
373
    public void testAspectsReadMachineCanInsertEnergyValid(GameTestHelper helper) {
374
        helper.setBlock(POS.west(), RegistryEntries.BLOCK_ENERGY_BATTERY.get());
×
375
        testReadAspect(POS, helper, PartTypes.MACHINE_READER, Aspects.Read.Machine.BOOLEAN_CANINSERTENERGY, ValueTypeBoolean.ValueBoolean.of(true));
×
376
    }
×
377

378
    @GameTest(template = TEMPLATE_EMPTY)
379
    public void testAspectsReadMachineIsEnergyFullInvalid(GameTestHelper helper) {
380
        helper.setBlock(POS.west(), Blocks.STONE);
×
381
        testReadAspect(POS, helper, PartTypes.MACHINE_READER, Aspects.Read.Machine.BOOLEAN_ISENERGYFULL, ValueTypeBoolean.ValueBoolean.of(false));
×
382
    }
×
383

384
    @GameTest(template = TEMPLATE_EMPTY)
385
    public void testAspectsReadMachineIsEnergyFullValid(GameTestHelper helper) {
386
        helper.setBlock(POS.west(), RegistryEntries.BLOCK_ENERGY_BATTERY.get());
×
387
        BlockEntityEnergyBattery battery = helper.getBlockEntity(POS.west(), BlockEntityEnergyBattery.class);
×
388
        battery.setEnergyStored(1_000_000);
×
389
        testReadAspect(POS, helper, PartTypes.MACHINE_READER, Aspects.Read.Machine.BOOLEAN_ISENERGYFULL, ValueTypeBoolean.ValueBoolean.of(true));
×
390
    }
×
391

392
    @GameTest(template = TEMPLATE_EMPTY)
393
    public void testAspectsReadMachineIsEnergyFullValidFalse(GameTestHelper helper) {
394
        helper.setBlock(POS.west(), RegistryEntries.BLOCK_ENERGY_BATTERY.get());
×
395
        BlockEntityEnergyBattery battery = helper.getBlockEntity(POS.west(), BlockEntityEnergyBattery.class);
×
396
        battery.setEnergyStored(100);
×
397
        testReadAspect(POS, helper, PartTypes.MACHINE_READER, Aspects.Read.Machine.BOOLEAN_ISENERGYFULL, ValueTypeBoolean.ValueBoolean.of(false));
×
398
    }
×
399

400
    @GameTest(template = TEMPLATE_EMPTY)
401
    public void testAspectsReadMachineIsEnergyEmptyInvalid(GameTestHelper helper) {
402
        helper.setBlock(POS.west(), Blocks.STONE);
×
403
        testReadAspect(POS, helper, PartTypes.MACHINE_READER, Aspects.Read.Machine.BOOLEAN_ISENERGYEMPTY, ValueTypeBoolean.ValueBoolean.of(false));
×
404
    }
×
405

406
    @GameTest(template = TEMPLATE_EMPTY)
407
    public void testAspectsReadMachineIsEnergyEmptyValid(GameTestHelper helper) {
408
        helper.setBlock(POS.west(), RegistryEntries.BLOCK_ENERGY_BATTERY.get());
×
409
        BlockEntityEnergyBattery battery = helper.getBlockEntity(POS.west(), BlockEntityEnergyBattery.class);
×
410
        battery.setEnergyStored(0);
×
411
        testReadAspect(POS, helper, PartTypes.MACHINE_READER, Aspects.Read.Machine.BOOLEAN_ISENERGYEMPTY, ValueTypeBoolean.ValueBoolean.of(true));
×
412
    }
×
413

414
    @GameTest(template = TEMPLATE_EMPTY)
415
    public void testAspectsReadMachineIsEnergyEmptyValidFalse(GameTestHelper helper) {
416
        helper.setBlock(POS.west(), RegistryEntries.BLOCK_ENERGY_BATTERY.get());
×
417
        BlockEntityEnergyBattery battery = helper.getBlockEntity(POS.west(), BlockEntityEnergyBattery.class);
×
418
        battery.setEnergyStored(100);
×
419
        testReadAspect(POS, helper, PartTypes.MACHINE_READER, Aspects.Read.Machine.BOOLEAN_ISENERGYEMPTY, ValueTypeBoolean.ValueBoolean.of(false));
×
420
    }
×
421

422
    @GameTest(template = TEMPLATE_EMPTY)
423
    public void testAspectsReadMachineIsEnergyNonEmptyInvalid(GameTestHelper helper) {
424
        helper.setBlock(POS.west(), Blocks.STONE);
×
425
        testReadAspect(POS, helper, PartTypes.MACHINE_READER, Aspects.Read.Machine.BOOLEAN_ISENERGYNONEMPTY, ValueTypeBoolean.ValueBoolean.of(false));
×
426
    }
×
427

428
    @GameTest(template = TEMPLATE_EMPTY)
429
    public void testAspectsReadMachineIsEnergyNonEmptyValid(GameTestHelper helper) {
430
        helper.setBlock(POS.west(), RegistryEntries.BLOCK_ENERGY_BATTERY.get());
×
431
        BlockEntityEnergyBattery battery = helper.getBlockEntity(POS.west(), BlockEntityEnergyBattery.class);
×
432
        battery.setEnergyStored(100);
×
433
        testReadAspect(POS, helper, PartTypes.MACHINE_READER, Aspects.Read.Machine.BOOLEAN_ISENERGYNONEMPTY, ValueTypeBoolean.ValueBoolean.of(true));
×
434
    }
×
435

436
    @GameTest(template = TEMPLATE_EMPTY)
437
    public void testAspectsReadMachineIsEnergyNonEmptyValidFalse(GameTestHelper helper) {
438
        helper.setBlock(POS.west(), RegistryEntries.BLOCK_ENERGY_BATTERY.get());
×
439
        BlockEntityEnergyBattery battery = helper.getBlockEntity(POS.west(), BlockEntityEnergyBattery.class);
×
440
        battery.setEnergyStored(0);
×
441
        testReadAspect(POS, helper, PartTypes.MACHINE_READER, Aspects.Read.Machine.BOOLEAN_ISENERGYNONEMPTY, ValueTypeBoolean.ValueBoolean.of(false));
×
442
    }
×
443

444
    @GameTest(template = TEMPLATE_EMPTY)
445
    public void testAspectsReadMachineEnergyStoredInvalid(GameTestHelper helper) {
446
        helper.setBlock(POS.west(), Blocks.STONE);
×
447
        testReadAspect(POS, helper, PartTypes.MACHINE_READER, Aspects.Read.Machine.INTEGER_ENERGYSTORED, ValueTypeLong.ValueLong.of(0));
×
448
    }
×
449

450
    @GameTest(template = TEMPLATE_EMPTY)
451
    public void testAspectsReadMachineEnergyStoredValid(GameTestHelper helper) {
452
        helper.setBlock(POS.west(), RegistryEntries.BLOCK_ENERGY_BATTERY.get());
×
453
        BlockEntityEnergyBattery battery = helper.getBlockEntity(POS.west(), BlockEntityEnergyBattery.class);
×
454
        battery.setEnergyStored(100);
×
455
        testReadAspect(POS, helper, PartTypes.MACHINE_READER, Aspects.Read.Machine.INTEGER_ENERGYSTORED, ValueTypeLong.ValueLong.of(100));
×
456
    }
×
457

458
    @GameTest(template = TEMPLATE_EMPTY)
459
    public void testAspectsReadMachineEnergyCapacityInvalid(GameTestHelper helper) {
460
        helper.setBlock(POS.west(), Blocks.STONE);
×
461
        testReadAspect(POS, helper, PartTypes.MACHINE_READER, Aspects.Read.Machine.INTEGER_ENERGYCAPACITY, ValueTypeLong.ValueLong.of(0));
×
462
    }
×
463

464
    @GameTest(template = TEMPLATE_EMPTY)
465
    public void testAspectsReadMachineEnergyCapacityValid(GameTestHelper helper) {
466
        helper.setBlock(POS.west(), RegistryEntries.BLOCK_ENERGY_BATTERY.get());
×
467
        BlockEntityEnergyBattery battery = helper.getBlockEntity(POS.west(), BlockEntityEnergyBattery.class);
×
468
        battery.setEnergyStored(100);
×
469
        testReadAspect(POS, helper, PartTypes.MACHINE_READER, Aspects.Read.Machine.INTEGER_ENERGYCAPACITY, ValueTypeLong.ValueLong.of(1_000_000));
×
470
    }
×
471

472
    @GameTest(template = TEMPLATE_EMPTY)
473
    public void testAspectsReadMachineEnergyFillRatioInvalid(GameTestHelper helper) {
474
        helper.setBlock(POS.west(), Blocks.STONE);
×
475
        testReadAspect(POS, helper, PartTypes.MACHINE_READER, Aspects.Read.Machine.DOUBLE_ENERGYFILLRATIO, ValueTypeDouble.ValueDouble.of(0));
×
476
    }
×
477

478
    @GameTest(template = TEMPLATE_EMPTY)
479
    public void testAspectsReadMachineEnergyFillRatioValid(GameTestHelper helper) {
480
        helper.setBlock(POS.west(), RegistryEntries.BLOCK_ENERGY_BATTERY.get());
×
481
        BlockEntityEnergyBattery battery = helper.getBlockEntity(POS.west(), BlockEntityEnergyBattery.class);
×
482
        battery.setEnergyStored(500_000);
×
483
        testReadAspect(POS, helper, PartTypes.MACHINE_READER, Aspects.Read.Machine.DOUBLE_ENERGYFILLRATIO, ValueTypeDouble.ValueDouble.of(0.5));
×
484
    }
×
485

486
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc