Search in sources :

Example 1 with TankManager

use of buildcraft.lib.fluid.TankManager in project BuildCraft by BuildCraft.

the class TankManagerTester method testSimpleMoving.

@Test
public void testSimpleMoving() {
    TankManager manager = new TankManager();
    manager.add(new Tank("tank_1", 3, null));
    Assert.assertEquals(2, manager.fill(new FluidStack(FluidRegistry.WATER, 2), true));
    Assert.assertEquals(1, manager.fill(new FluidStack(FluidRegistry.WATER, 2), true));
    Assert.assertTrue(new FluidStack(FluidRegistry.WATER, 3).isFluidStackIdentical(manager.drain(new FluidStack(FluidRegistry.WATER, 5), true)));
    manager.add(new Tank("tank_2", 3, null));
    Assert.assertEquals(5, manager.fill(new FluidStack(FluidRegistry.LAVA, 5), true));
    Assert.assertTrue(new FluidStack(FluidRegistry.LAVA, 4).isFluidStackIdentical(manager.drain(new FluidStack(FluidRegistry.LAVA, 4), true)));
    Assert.assertEquals(1, manager.get(1).getFluid().amount);
}
Also used : TankManager(buildcraft.lib.fluid.TankManager) FluidStack(net.minecraftforge.fluids.FluidStack) Tank(buildcraft.lib.fluid.Tank) Test(org.junit.Test)

Aggregations

Tank (buildcraft.lib.fluid.Tank)1 TankManager (buildcraft.lib.fluid.TankManager)1 FluidStack (net.minecraftforge.fluids.FluidStack)1 Test (org.junit.Test)1