• 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/GameTestsAspectsReadFluid.java
1
package org.cyclops.integrateddynamics.gametest;
2

3
import net.minecraft.core.BlockPos;
4
import net.minecraft.gametest.framework.GameTestHelper;
5
import net.minecraft.world.level.block.Blocks;
6
import net.minecraft.world.level.material.Fluids;
7
import net.neoforged.neoforge.fluids.FluidStack;
8
import org.cyclops.cyclopscore.gametest.GameTest;
9
import org.cyclops.integrateddynamics.RegistryEntries;
10
import org.cyclops.integrateddynamics.blockentity.BlockEntityDryingBasin;
11
import org.cyclops.integrateddynamics.core.evaluate.variable.*;
12
import org.cyclops.integrateddynamics.core.part.PartTypes;
13
import org.cyclops.integrateddynamics.part.aspect.Aspects;
14

15
import static org.cyclops.integrateddynamics.gametest.GameTestHelpersIntegratedDynamics.testReadAspect;
16

17
public class GameTestsAspectsReadFluid {
×
18

19
    public static final String TEMPLATE_EMPTY = "integrateddynamics:empty10";
20
    public static final BlockPos POS = BlockPos.ZERO.offset(2, 0, 2);
×
21

22
    @GameTest(template = TEMPLATE_EMPTY)
23
    public void testAspectsReadFluidFullTrue(GameTestHelper helper) {
24
        helper.setBlock(POS.west(), RegistryEntries.BLOCK_DRYING_BASIN.get());
×
25
        BlockEntityDryingBasin dryingBasin = helper.getBlockEntity(POS.west(), BlockEntityDryingBasin.class);
×
26
        dryingBasin.getTank().setFluid(new FluidStack(Fluids.WATER, 1_000));
×
27
        testReadAspect(POS, helper, PartTypes.FLUID_READER, Aspects.Read.Fluid.BOOLEAN_FULL, ValueTypeBoolean.ValueBoolean.of(true));
×
28
    }
×
29

30
    @GameTest(template = TEMPLATE_EMPTY)
31
    public void testAspectsReadFluidFullFalse(GameTestHelper helper) {
32
        helper.setBlock(POS.west(), RegistryEntries.BLOCK_DRYING_BASIN.get());
×
33
        BlockEntityDryingBasin dryingBasin = helper.getBlockEntity(POS.west(), BlockEntityDryingBasin.class);
×
34
        dryingBasin.getTank().setFluid(new FluidStack(Fluids.WATER, 10));
×
35
        testReadAspect(POS, helper, PartTypes.FLUID_READER, Aspects.Read.Fluid.BOOLEAN_FULL, ValueTypeBoolean.ValueBoolean.of(false));
×
36
    }
×
37

38
    @GameTest(template = TEMPLATE_EMPTY)
39
    public void testAspectsReadFluidEmptyTrue(GameTestHelper helper) {
40
        helper.setBlock(POS.west(), RegistryEntries.BLOCK_DRYING_BASIN.get());
×
41
        BlockEntityDryingBasin dryingBasin = helper.getBlockEntity(POS.west(), BlockEntityDryingBasin.class);
×
42
        testReadAspect(POS, helper, PartTypes.FLUID_READER, Aspects.Read.Fluid.BOOLEAN_EMPTY, ValueTypeBoolean.ValueBoolean.of(true));
×
43
    }
×
44

45
    @GameTest(template = TEMPLATE_EMPTY)
46
    public void testAspectsReadFluidEmptyFalse(GameTestHelper helper) {
47
        helper.setBlock(POS.west(), RegistryEntries.BLOCK_DRYING_BASIN.get());
×
48
        BlockEntityDryingBasin dryingBasin = helper.getBlockEntity(POS.west(), BlockEntityDryingBasin.class);
×
49
        dryingBasin.getTank().setFluid(new FluidStack(Fluids.WATER, 10));
×
50
        testReadAspect(POS, helper, PartTypes.FLUID_READER, Aspects.Read.Fluid.BOOLEAN_EMPTY, ValueTypeBoolean.ValueBoolean.of(false));
×
51
    }
×
52

53
    @GameTest(template = TEMPLATE_EMPTY)
54
    public void testAspectsReadFluidNonEmptyTrue(GameTestHelper helper) {
55
        helper.setBlock(POS.west(), RegistryEntries.BLOCK_DRYING_BASIN.get());
×
56
        BlockEntityDryingBasin dryingBasin = helper.getBlockEntity(POS.west(), BlockEntityDryingBasin.class);
×
57
        dryingBasin.getTank().setFluid(new FluidStack(Fluids.WATER, 10));
×
58
        testReadAspect(POS, helper, PartTypes.FLUID_READER, Aspects.Read.Fluid.BOOLEAN_NONEMPTY, ValueTypeBoolean.ValueBoolean.of(true));
×
59
    }
×
60

61
    @GameTest(template = TEMPLATE_EMPTY)
62
    public void testAspectsReadFluidNonEmptyFalse(GameTestHelper helper) {
63
        helper.setBlock(POS.west(), RegistryEntries.BLOCK_DRYING_BASIN.get());
×
64
        BlockEntityDryingBasin dryingBasin = helper.getBlockEntity(POS.west(), BlockEntityDryingBasin.class);
×
65
        testReadAspect(POS, helper, PartTypes.FLUID_READER, Aspects.Read.Fluid.BOOLEAN_NONEMPTY, ValueTypeBoolean.ValueBoolean.of(false));
×
66
    }
×
67

68
    @GameTest(template = TEMPLATE_EMPTY)
69
    public void testAspectsReadFluidApplicableTrue(GameTestHelper helper) {
70
        helper.setBlock(POS.west(), RegistryEntries.BLOCK_DRYING_BASIN.get());
×
71
        testReadAspect(POS, helper, PartTypes.FLUID_READER, Aspects.Read.Fluid.BOOLEAN_APPLICABLE, ValueTypeBoolean.ValueBoolean.of(true));
×
72
    }
×
73

74
    @GameTest(template = TEMPLATE_EMPTY)
75
    public void testAspectsReadFluidApplicableFalse(GameTestHelper helper) {
76
        testReadAspect(POS, helper, PartTypes.FLUID_READER, Aspects.Read.Fluid.BOOLEAN_APPLICABLE, ValueTypeBoolean.ValueBoolean.of(false));
×
77
    }
×
78

79
    @GameTest(template = TEMPLATE_EMPTY)
80
    public void testAspectsReadFluidAmount(GameTestHelper helper) {
81
        helper.setBlock(POS.west(), RegistryEntries.BLOCK_DRYING_BASIN.get());
×
82
        BlockEntityDryingBasin dryingBasin = helper.getBlockEntity(POS.west(), BlockEntityDryingBasin.class);
×
83
        dryingBasin.getTank().setFluid(new FluidStack(Fluids.WATER, 10));
×
84
        testReadAspect(POS, helper, PartTypes.FLUID_READER, Aspects.Read.Fluid.LONG_AMOUNT, ValueTypeLong.ValueLong.of(10));
×
85
    }
×
86

87
    @GameTest(template = TEMPLATE_EMPTY)
88
    public void testAspectsReadFluidAmountTotal(GameTestHelper helper) {
89
        helper.setBlock(POS.west(), RegistryEntries.BLOCK_DRYING_BASIN.get());
×
90
        BlockEntityDryingBasin dryingBasin = helper.getBlockEntity(POS.west(), BlockEntityDryingBasin.class);
×
91
        dryingBasin.getTank().setFluid(new FluidStack(Fluids.WATER, 10));
×
92
        testReadAspect(POS, helper, PartTypes.FLUID_READER, Aspects.Read.Fluid.LONG_AMOUNTTOTAL, ValueTypeLong.ValueLong.of(10));
×
93
    }
×
94

95
    @GameTest(template = TEMPLATE_EMPTY)
96
    public void testAspectsReadFluidCapacityValid(GameTestHelper helper) {
97
        helper.setBlock(POS.west(), RegistryEntries.BLOCK_DRYING_BASIN.get());
×
98
        testReadAspect(POS, helper, PartTypes.FLUID_READER, Aspects.Read.Fluid.LONG_CAPACITY, ValueTypeLong.ValueLong.of(1_000));
×
99
    }
×
100

101
    @GameTest(template = TEMPLATE_EMPTY)
102
    public void testAspectsReadFluidCapacityInvalid(GameTestHelper helper) {
103
        testReadAspect(POS, helper, PartTypes.FLUID_READER, Aspects.Read.Fluid.LONG_CAPACITY, ValueTypeLong.ValueLong.of(0));
×
104
    }
×
105

106
    @GameTest(template = TEMPLATE_EMPTY)
107
    public void testAspectsReadFluidCapacityTotalValid(GameTestHelper helper) {
108
        helper.setBlock(POS.west(), RegistryEntries.BLOCK_DRYING_BASIN.get());
×
109
        testReadAspect(POS, helper, PartTypes.FLUID_READER, Aspects.Read.Fluid.LONG_CAPACITYTOTAL, ValueTypeLong.ValueLong.of(1_000));
×
110
    }
×
111

112
    @GameTest(template = TEMPLATE_EMPTY)
113
    public void testAspectsReadFluidCapacityTotalInvalid(GameTestHelper helper) {
114
        testReadAspect(POS, helper, PartTypes.FLUID_READER, Aspects.Read.Fluid.LONG_CAPACITYTOTAL, ValueTypeLong.ValueLong.of(0));
×
115
    }
×
116

117
    @GameTest(template = TEMPLATE_EMPTY)
118
    public void testAspectsReadFluidTanksValid(GameTestHelper helper) {
119
        helper.setBlock(POS.west(), RegistryEntries.BLOCK_DRYING_BASIN.get());
×
120
        testReadAspect(POS, helper, PartTypes.FLUID_READER, Aspects.Read.Fluid.INTEGER_TANKS, ValueTypeInteger.ValueInteger.of(1));
×
121
    }
×
122

123
    @GameTest(template = TEMPLATE_EMPTY)
124
    public void testAspectsReadFluidTanksInvalid(GameTestHelper helper) {
125
        testReadAspect(POS, helper, PartTypes.FLUID_READER, Aspects.Read.Fluid.INTEGER_TANKS, ValueTypeInteger.ValueInteger.of(0));
×
126
    }
×
127

128
    @GameTest(template = TEMPLATE_EMPTY)
129
    public void testAspectsReadFluidFillRatio(GameTestHelper helper) {
130
        helper.setBlock(POS.west(), RegistryEntries.BLOCK_DRYING_BASIN.get());
×
131
        BlockEntityDryingBasin dryingBasin = helper.getBlockEntity(POS.west(), BlockEntityDryingBasin.class);
×
132
        dryingBasin.getTank().setFluid(new FluidStack(Fluids.WATER, 500));
×
133
        testReadAspect(POS, helper, PartTypes.FLUID_READER, Aspects.Read.Fluid.DOUBLE_FILLRATIO, ValueTypeDouble.ValueDouble.of(0.5D));
×
134
    }
×
135

136
    @GameTest(template = TEMPLATE_EMPTY)
137
    public void testAspectsReadFluidTankFluids(GameTestHelper helper) {
138
        helper.setBlock(POS.west(), RegistryEntries.BLOCK_DRYING_BASIN.get());
×
139
        BlockEntityDryingBasin dryingBasin = helper.getBlockEntity(POS.west(), BlockEntityDryingBasin.class);
×
140
        dryingBasin.getTank().setFluid(new FluidStack(Fluids.WATER, 500));
×
141
        testReadAspect(POS, helper, PartTypes.FLUID_READER, Aspects.Read.Fluid.LIST_TANKFLUIDS, ValueTypeList.ValueList.ofAll(
×
142
                ValueObjectTypeFluidStack.ValueFluidStack.of(new FluidStack(Fluids.WATER, 500))
×
143
        ));
144
    }
×
145

146
    @GameTest(template = TEMPLATE_EMPTY)
147
    public void testAspectsReadFluidTankCapacities(GameTestHelper helper) {
148
        helper.setBlock(POS.west(), RegistryEntries.BLOCK_DRYING_BASIN.get());
×
149
        BlockEntityDryingBasin dryingBasin = helper.getBlockEntity(POS.west(), BlockEntityDryingBasin.class);
×
150
        dryingBasin.getTank().setFluid(new FluidStack(Fluids.WATER, 500));
×
151
        testReadAspect(POS, helper, PartTypes.FLUID_READER, Aspects.Read.Fluid.LIST_TANKCAPACITIES, ValueTypeList.ValueList.ofAll(
×
152
                ValueTypeInteger.ValueInteger.of(1_000)
×
153
        ));
154
    }
×
155

156
    @GameTest(template = TEMPLATE_EMPTY)
157
    public void testAspectsReadFluidFluidStack(GameTestHelper helper) {
158
        helper.setBlock(POS.west(), RegistryEntries.BLOCK_DRYING_BASIN.get());
×
159
        BlockEntityDryingBasin dryingBasin = helper.getBlockEntity(POS.west(), BlockEntityDryingBasin.class);
×
160
        dryingBasin.getTank().setFluid(new FluidStack(Fluids.WATER, 500));
×
161
        testReadAspect(POS, helper, PartTypes.FLUID_READER, Aspects.Read.Fluid.FLUIDSTACK, ValueObjectTypeFluidStack.ValueFluidStack.of(new FluidStack(Fluids.WATER, 500)));
×
162
    }
×
163

164
    @GameTest(template = TEMPLATE_EMPTY)
165
    public void testAspectsReadFluidBlockValid(GameTestHelper helper) {
166
        helper.setBlock(POS.west(), Blocks.WATER);
×
167
        testReadAspect(POS, helper, PartTypes.FLUID_READER, Aspects.Read.Fluid.BLOCK, ValueObjectTypeFluidStack.ValueFluidStack.of(new FluidStack(Fluids.WATER, 1_000)));
×
168
    }
×
169

170
    @GameTest(template = TEMPLATE_EMPTY)
171
    public void testAspectsReadFluidBlockInvalid(GameTestHelper helper) {
172
        testReadAspect(POS, helper, PartTypes.FLUID_READER, Aspects.Read.Fluid.BLOCK, ValueObjectTypeFluidStack.ValueFluidStack.of(FluidStack.EMPTY));
×
173
    }
×
174

175
}
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