Class FluidUtilTest

java.lang.Object
net.neoforged.neoforge.oldtest.FluidUtilTest

public class FluidUtilTest extends Object
Various tests for FluidUtil, that run when the mod is loaded. If one of the tests fails, an expection will be thrown, and mod loading will fail with an error. If all tests pass, the mod will load successfully.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    FluidUtilTest(net.neoforged.bus.api.IEventBus modEventBus)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    private static void
    checkFluidStack(FluidStack stack, net.minecraft.world.level.material.Fluid fluid, int amount)
     
    private static void
    checkItemStack(net.minecraft.world.item.ItemStack stack, net.minecraft.world.item.Item item, int count)
     
    private static void
    runTests(net.neoforged.fml.event.lifecycle.FMLLoadCompleteEvent commonSetupEvent)
     
    private static void
    Ensures that tryEmptyContainer doesn't change the target fluid handler when simulating.
    private static void
    Ensures that tryEmptyContainerAndStow doesn't duplicate fluids in the target when the container is stackable.
    private static void
    Ensures that tryFillContainer doesn't change the target fluid handler when simulating.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • FluidUtilTest

      public FluidUtilTest(net.neoforged.bus.api.IEventBus modEventBus)
  • Method Details

    • runTests

      private static void runTests(net.neoforged.fml.event.lifecycle.FMLLoadCompleteEvent commonSetupEvent)
    • test_tryEmptyContainer

      private static void test_tryEmptyContainer()
      Ensures that tryEmptyContainer doesn't change the target fluid handler when simulating. Regression test for the root cause of issue #6796.
    • test_tryFillContainer

      private static void test_tryFillContainer()
      Ensures that tryFillContainer doesn't change the target fluid handler when simulating. Ant that the result of the simulated transfver is valid. Regression test for the root cause of issue #6796.
    • test_tryEmptyContainerAndStow_stackable

      private static void test_tryEmptyContainerAndStow_stackable()
      Ensures that tryEmptyContainerAndStow doesn't duplicate fluids in the target when the container is stackable. Regression test for issue #6796.
    • checkItemStack

      private static void checkItemStack(net.minecraft.world.item.ItemStack stack, net.minecraft.world.item.Item item, int count)
    • checkFluidStack

      private static void checkFluidStack(FluidStack stack, net.minecraft.world.level.material.Fluid fluid, int amount)