@@ -668,4 +668,49 @@ public void testFluidInterfacesToWorldExporterListCorrect(GameTestHelper helper)
668
668
});
669
669
}
670
670
671
+ @ GameTest (template = TEMPLATE_EMPTY , timeoutTicks = TIMEOUT )
672
+ public void testFluidInterfaceToExporterFluidFromSubnet (GameTestHelper helper ) {
673
+ // Place cable
674
+ helper .setBlock (POS , RegistryEntries .BLOCK_CABLE .value ());
675
+ helper .setBlock (POS .east (), RegistryEntries .BLOCK_CABLE .value ());
676
+
677
+ // Place fluid interface
678
+ PartHelpers .addPart (helper .getLevel (), helper .absolutePos (POS ), Direction .WEST , PartTypes .INTERFACE_FLUID , new ItemStack (PartTypes .INTERFACE_FLUID .getItem ()));
679
+
680
+ // Place fluid exporter
681
+ PartHelpers .addPart (helper .getLevel (), helper .absolutePos (POS .east ()), Direction .EAST , PartTypes .EXPORTER_FLUID , new ItemStack (PartTypes .EXPORTER_FLUID .getItem ()));
682
+
683
+ // Place cable for subnet
684
+ helper .setBlock (POS .west (), RegistryEntries .BLOCK_CABLE .value ());
685
+
686
+ // Place fluid interfaces in subnet
687
+ PartHelpers .addPart (helper .getLevel (), helper .absolutePos (POS .west ()), Direction .WEST , PartTypes .INTERFACE_FLUID , new ItemStack (PartTypes .INTERFACE_FLUID .getItem ()));
688
+ PartHelpers .addPart (helper .getLevel (), helper .absolutePos (POS .west ()), Direction .NORTH , PartTypes .INTERFACE_FLUID , new ItemStack (PartTypes .INTERFACE_FLUID .getItem ()));
689
+ PartHelpers .addPart (helper .getLevel (), helper .absolutePos (POS .west ()), Direction .EAST , PartTypes .INTERFACE_FLUID , new ItemStack (PartTypes .INTERFACE_FLUID .getItem ()));
690
+
691
+ // Place drying basins
692
+ helper .setBlock (POS .west ().west (), RegistryEntries .BLOCK_DRYING_BASIN .get ());
693
+ helper .setBlock (POS .west ().north (), RegistryEntries .BLOCK_DRYING_BASIN .get ());
694
+ helper .setBlock (POS .east ().east (), RegistryEntries .BLOCK_DRYING_BASIN .get ());
695
+
696
+ // Insert fluids in subnet basins
697
+ BlockEntityDryingBasin basinIn1 = helper .getBlockEntity (POS .west ().west ());
698
+ basinIn1 .getTank ().setFluid (new FluidStack (Fluids .WATER , 1_000 ));
699
+ BlockEntityDryingBasin basinIn2 = helper .getBlockEntity (POS .west ().north ());
700
+ basinIn2 .getTank ().setFluid (new FluidStack (RegistryEntries .FLUID_MENRIL_RESIN , 1_000 ));
701
+
702
+ // Place empty variable in exporter
703
+ ItemStack variableAspect = createVariableForValue (helper .getLevel (), ValueTypes .OBJECT_FLUIDSTACK , ValueObjectTypeFluidStack .ValueFluidStack .of (new FluidStack (RegistryEntries .FLUID_MENRIL_RESIN , 100 )));
704
+ placeVariableInWriter (helper .getLevel (), PartPos .of (helper .getLevel (), helper .absolutePos (POS .east ()), Direction .EAST ), TunnelAspects .Write .Fluid .FLUIDSTACK_EXPORT , variableAspect );
705
+
706
+ helper .succeedWhen (() -> {
707
+ // Check if fluid is moved
708
+ BlockEntityDryingBasin basinOut = helper .getBlockEntity (POS .east ().east ());
709
+ helper .assertValueEqual (basinOut .getTank ().getFluidAmount (), 1_000 , "Basin out does not contain fluids" );
710
+ helper .assertValueEqual (basinOut .getTank ().getFluidType (), RegistryEntries .FLUID_MENRIL_RESIN .get (), "Basin out does not contain the correct fluid type" );
711
+ helper .assertValueEqual (basinIn1 .getTank ().getFluidAmount (), 1_000 , "Basin in 1 was incorrectly drained" );
712
+ helper .assertValueEqual (basinIn2 .getTank ().getFluidAmount (), 0 , "Basin in 2 was not drained" );
713
+ });
714
+ }
715
+
671
716
}
0 commit comments