Class GameTestHelper

java.lang.Object
com.gtnewhorizons.horizonqa.api.GameTestHelper

public class GameTestHelper extends Object
Passed to every @GameTest method. Provides world interaction, assertions, and the fluent sequence API.

Coordinate-based methods use test-local positions and provide parallel overloads for raw coordinates, TestPos, and structure-label strings. Label overloads resolve through pos(String), including structure rotation, and throw LabelResolutionException when the fixture has no matching label.

  • Constructor Summary

    Constructors
    Constructor
    Description
    GameTestHelper(GameTestInstance instance, net.minecraft.world.WorldServer world, int originX, int originY, int originZ)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    absolute(int x, int y, int z)
    Convert test-local block coordinates to an absolute TestPos in world space.
    Convert a test-local block position to an absolute TestPos in world space.
    Resolve a named coordinate label to world-absolute coordinates.
    void
    afterTest(Runnable callback)
    Register callback to run once when this test ends, regardless of outcome.
    void
    assertBlockAbsent(net.minecraft.block.Block unexpected, int x, int y, int z)
    Assert that the block at test-local position (x, y, z) is NOT unexpected.
    void
    assertBlockAbsent(net.minecraft.block.Block unexpected, TestPos pos)
    Assert that the block at test-local position pos is NOT unexpected.
    void
    assertBlockAbsent(net.minecraft.block.Block unexpected, String label)
    Assert that the block at the named structure position is NOT unexpected.
    void
    assertBlockPresent(net.minecraft.block.Block expected, int x, int y, int z)
    Assert that the block at test-local position (x, y, z) is expected.
    void
    assertBlockPresent(net.minecraft.block.Block expected, int meta, int x, int y, int z)
    Assert that the block at test-local position is expected with the given metadata.
    void
    assertBlockPresent(net.minecraft.block.Block expected, int meta, TestPos pos)
    Assert that the block at pos is expected with the given metadata.
    void
    assertBlockPresent(net.minecraft.block.Block expected, int meta, String label)
    Assert that the block at the named structure position is expected with the given metadata.
    void
    assertBlockPresent(net.minecraft.block.Block expected, TestPos pos)
    Assert that the block at test-local position pos is expected.
    void
    assertBlockPresent(net.minecraft.block.Block expected, String label)
    Assert that the block at the named structure position is expected.
    void
    assertEntityAbsent(int x, int y, int z)
    Assert that no live entity exists in the single test-local block at (x, y, z).
    void
    Assert that no live entity exists in the single test-local block at pos.
    void
    assertEntityAbsent(Class<? extends net.minecraft.entity.Entity> type, int x, int y, int z)
    Assert that no live entity of type exists in the single test-local block at (x, y, z).
    void
    assertEntityAbsent(Class<? extends net.minecraft.entity.Entity> type, TestPos pos)
    Assert that no live entity of type exists in the single test-local block at pos.
    void
    assertEntityAbsent(Class<? extends net.minecraft.entity.Entity> type, String label)
    Assert that no live entity of type exists at the named structure position.
    void
    Assert that no live entity exists at the named structure position.
    void
    assertEntityCount(int expectedCount, int x, int y, int z)
    Assert that exactly expectedCount live entities exist in the single test-local block at (x, y, z).
    void
    assertEntityCount(int expectedCount, int minX, int minY, int minZ, int maxX, int maxY, int maxZ)
    Assert that exactly expectedCount live entities exist in the inclusive test-local block range.
    void
    assertEntityCount(int expectedCount, TestPos pos)
    Assert the live entity count in the single test-local block at pos.
    void
    assertEntityCount(int expectedCount, TestPos min, TestPos max)
    Assert the live entity count in the inclusive test-local block range.
    void
    assertEntityCount(int expectedCount, String label)
    Assert the live entity count at the named structure position.
    void
    assertEntityCount(int expectedCount, String minLabel, String maxLabel)
    Assert the live entity count in the inclusive range between two structure labels.
    void
    assertEntityCount(Class<? extends net.minecraft.entity.Entity> type, int expectedCount, int x, int y, int z)
    Assert that exactly expectedCount live entities of type exist in the single test-local block at (x, y, z).
    void
    assertEntityCount(Class<? extends net.minecraft.entity.Entity> type, int expectedCount, int minX, int minY, int minZ, int maxX, int maxY, int maxZ)
    Assert that exactly expectedCount live entities of type exist in the inclusive test-local block range.
    void
    assertEntityCount(Class<? extends net.minecraft.entity.Entity> type, int expectedCount, TestPos pos)
    Assert the live entity count of type in the single test-local block at pos.
    void
    assertEntityCount(Class<? extends net.minecraft.entity.Entity> type, int expectedCount, TestPos min, TestPos max)
    Assert the live entity count of type in the inclusive test-local block range.
    void
    assertEntityCount(Class<? extends net.minecraft.entity.Entity> type, int expectedCount, String label)
    Assert the live entity count of type at the named structure position.
    void
    assertEntityCount(Class<? extends net.minecraft.entity.Entity> type, int expectedCount, String minLabel, String maxLabel)
    Assert the live entity count of type in the inclusive range between two structure labels.
    void
    assertEntityNBT(net.minecraft.entity.Entity entity, net.minecraft.nbt.NBTTagCompound expectedSubset)
    Assert that the entity's NBT contains all keys/values from expectedSubset.
    void
    assertEntityNBTPath(net.minecraft.entity.Entity entity, String path, String expectedValue)
    Assert a specific value at a dotted NBT path on an entity (e.g.
    net.minecraft.entity.Entity
    assertEntityPresent(int x, int y, int z)
    Assert that at least one live entity exists in the single test-local block at (x, y, z).
    net.minecraft.entity.Entity
    Assert that at least one live entity exists in the single test-local block at pos.
    <T extends net.minecraft.entity.Entity>
    T
    assertEntityPresent(Class<T> type, int x, int y, int z)
    Assert that at least one live entity of type exists in the single test-local block at (x, y, z).
    <T extends net.minecraft.entity.Entity>
    T
    Assert that at least one live entity of type exists in the block at pos.
    <T extends net.minecraft.entity.Entity>
    T
    assertEntityPresent(Class<T> type, String label)
    Assert that at least one live entity of type exists at the named structure position.
    net.minecraft.entity.Entity
    Assert that at least one live entity exists at the named structure position.
    void
    assertEquals(double expected, double actual, double delta)
    Fail if |expected - actual| > delta.
    void
    assertEquals(double expected, double actual, double delta, String message)
    Fail if |expected - actual| > delta.
    void
    assertEquals(long expected, long actual)
    Fail if expected != actual.
    void
    assertEquals(long expected, long actual, String message)
    Fail if expected != actual.
    void
    assertEquals(Object expected, Object actual)
    Fail if expected and actual are not equal per Objects.equals(java.lang.Object, java.lang.Object).
    void
    assertEquals(Object expected, Object actual, String message)
    Fail if expected and actual are not equal per Objects.equals(java.lang.Object, java.lang.Object).
    void
    assertFalse(boolean condition)
    Fail if condition is true.
    void
    assertFalse(boolean condition, String message)
    Fail if condition is true.
    void
    assertFluidTank(int x, int y, int z, net.minecraftforge.fluids.FluidStack expected)
    Assert that the fluid handler at test-local position contains at least expected.amount mB of the expected fluid.
    void
    assertFluidTank(TestPos pos, net.minecraftforge.fluids.FluidStack expected)
    Assert that the fluid handler at the test-local position contains at least expected.
    void
    assertFluidTank(String label, net.minecraftforge.fluids.FluidStack expected)
    Assert that the fluid handler at the named structure position contains at least expected.
    void
    assertFluidTankEmpty(int x, int y, int z)
    Assert that the fluid handler at test-local position has no fluid.
    void
    Assert that the fluid handler at the test-local position has no fluid.
    void
    Assert that the fluid handler at the named structure position has no fluid.
    <T> T
    assertInstanceOf(Class<T> type, Object actual)
    Fail if actual is not an instance of type.
    <T> T
    assertInstanceOf(Class<T> type, Object actual, String message)
    Fail if actual is not an instance of type.
    void
    assertInventoryContains(int x, int y, int z, net.minecraft.item.ItemStack expected)
    Assert that the inventory at test-local position contains at least the given stack (item, damage, NBT match; stack size is minimum).
    void
    assertInventoryContains(TestPos pos, net.minecraft.item.ItemStack expected)
    Assert that the inventory at test-local (relative) TestPos contains at least the given stack.
    void
    assertInventoryContains(String label, net.minecraft.item.ItemStack expected)
    Assert that the inventory at the named structure position contains at least expected.
    void
    assertInventoryCount(int x, int y, int z, net.minecraft.item.ItemStack template, long expectedCount)
    Assert that exactly expectedCount items matching template exist across the inventory at test-local position.
    void
    assertInventoryCount(TestPos pos, net.minecraft.item.ItemStack template, long expectedCount)
    Assert an exact matching item count across the inventory at a test-local (relative) TestPos.
    void
    assertInventoryCount(String label, net.minecraft.item.ItemStack template, long expectedCount)
    Assert an exact matching item count in the inventory at the named structure position.
    void
    assertInventoryEmpty(int x, int y, int z)
    Assert that every slot of the inventory at test-local position is empty.
    void
    Assert that every slot of the inventory at the test-local position is empty.
    void
    Assert that every slot of the inventory at the named structure position is empty.
    void
    assertItemEqual(net.minecraft.item.ItemStack expected, net.minecraft.item.ItemStack actual)
    Fail if expected and actual differ by item, damage, stack size, or NBT.
    void
    assertItemEqual(net.minecraft.item.ItemStack expected, net.minecraft.item.ItemStack actual, String message)
    Fail if expected and actual differ by item, damage, stack size, or NBT.
    void
    assertIterableEquals(Iterable<?> expected, Iterable<?> actual)
    Assert that two iterables contain equal elements in the same order.
    void
    assertIterableEquals(Iterable<?> expected, Iterable<?> actual, String message)
    Assert that two iterables contain equal elements in the same order (deep equality via Objects.equals(java.lang.Object, java.lang.Object)).
    void
    assertLinesMatch(List<String> expectedLines, List<String> actualLines)
    Assert that actualLines matches expectedLines — see assertLinesMatch(List, List, String).
    void
    assertLinesMatch(List<String> expectedLines, List<String> actualLines, String message)
    Assert that actualLines matches expectedLines line by line.
    void
    assertNotEquals(double unexpected, double actual, double delta)
    Fail if |unexpected - actual| <= delta.
    void
    assertNotEquals(double unexpected, double actual, double delta, String message)
    Fail if |unexpected - actual| <= delta.
    void
    assertNotEquals(long unexpected, long actual)
    Fail if unexpected == actual.
    void
    assertNotEquals(long unexpected, long actual, String message)
    Fail if unexpected == actual.
    void
    assertNotEquals(Object unexpected, Object actual)
    Fail if unexpected and actual are equal per Objects.equals(java.lang.Object, java.lang.Object).
    void
    assertNotEquals(Object unexpected, Object actual, String message)
    Fail if unexpected and actual are equal per Objects.equals(java.lang.Object, java.lang.Object).
    void
    Fail if actual is null.
    void
    assertNotNull(Object actual, String message)
    Fail if actual is null.
    void
    assertNotSame(Object unexpected, Object actual)
    Fail if unexpected and actual are the same object reference (==).
    void
    assertNotSame(Object unexpected, Object actual, String message)
    Fail if unexpected and actual are the same object reference (==).
    void
    Fail if actual is not null.
    void
    assertNull(Object actual, String message)
    Fail if actual is not null.
    void
    assertRedstonePower(int x, int y, int z, int minPower)
    Assert that the block at test-local position is receiving at least minPower redstone power.
    void
    assertRedstonePower(TestPos pos, int minPower)
    Assert the minimum redstone power at the test-local position.
    void
    assertRedstonePower(String label, int minPower)
    Assert the minimum redstone power at the named structure position.
    void
    assertSame(Object expected, Object actual)
    Fail if expected and actual are not the same object reference (==).
    void
    assertSame(Object expected, Object actual, String message)
    Fail if expected and actual are not the same object reference (==).
    void
    assertSlot(int x, int y, int z, int slot, net.minecraft.item.ItemStack expected)
    Assert that a specific slot contains the given stack (exact item + damage + NBT + size).
    void
    assertSlot(TestPos pos, int slot, net.minecraft.item.ItemStack expected)
    Assert the contents of a specific inventory slot at the test-local position.
    void
    assertSlot(String label, int slot, net.minecraft.item.ItemStack expected)
    Assert the contents of a specific inventory slot at the named structure position.
    <T extends Throwable>
    T
    assertThrows(Class<T> expectedType, Runnable action)
    Assert that action throws an exception of exactly type expectedType.
    <T extends Throwable>
    T
    assertThrows(Class<T> expectedType, Runnable action, String message)
    Assert that action throws an exception of exactly type expectedType.
    net.minecraft.tileentity.TileEntity
    assertTileEntityPresent(int x, int y, int z)
    Assert that a TileEntity exists at test-local position (x, y, z).
    net.minecraft.tileentity.TileEntity
    Assert that a TileEntity exists at the test-local position and return it.
    <T extends net.minecraft.tileentity.TileEntity>
    T
    assertTileEntityPresent(Class<T> type, int x, int y, int z)
    Assert that a TileEntity of a specific type exists at test-local position.
    <T extends net.minecraft.tileentity.TileEntity>
    T
    Assert that a TileEntity of type exists at the test-local position and return it.
    <T extends net.minecraft.tileentity.TileEntity>
    T
    Assert that a TileEntity of type exists at the named structure position and return it.
    net.minecraft.tileentity.TileEntity
    Assert that a TileEntity exists at the named structure position and return it.
    void
    assertTileNBT(int x, int y, int z, net.minecraft.nbt.NBTTagCompound expectedSubset)
    Assert that the TileEntity NBT at test-local position contains all keys/values from expectedSubset.
    void
    assertTileNBT(TestPos pos, net.minecraft.nbt.NBTTagCompound expectedSubset)
    Assert that the TileEntity NBT at the test-local position contains expectedSubset.
    void
    assertTileNBT(String label, net.minecraft.nbt.NBTTagCompound expectedSubset)
    Assert that the TileEntity NBT at the named structure position contains expectedSubset.
    void
    assertTileNBTPath(int x, int y, int z, String path, String expectedValue)
    Assert a specific value at a dotted NBT path (e.g.
    void
    assertTileNBTPath(TestPos pos, String path, String expectedValue)
    Assert a value at a dotted NBT path on the TileEntity at the test-local position.
    void
    assertTileNBTPath(String label, String path, String expectedValue)
    Assert a value at a dotted NBT path on the TileEntity at the named structure position.
    void
    assertTrue(boolean condition)
    Fail if condition is false.
    void
    assertTrue(boolean condition, String message)
    Fail if condition is false.
    void
    assumeFalse(boolean condition, String reason)
    Skip this test when condition is true.
    void
    assumeTrue(boolean condition, String reason)
    Skip this test when condition is false.
    void
    clearSlot(int x, int y, int z, int slot)
    Directly clear an inventory slot at test-local position, bypassing normal extraction rules, then mark the inventory dirty.
    void
    clearSlot(TestPos pos, int slot)
    Directly clear an inventory slot at a test-local (relative) TestPos.
    void
    clearSlot(String label, int slot)
    Directly clear an inventory slot at the named structure position.
    long
    countItems(int x, int y, int z, net.minecraft.item.ItemStack template)
    Count all items matching template (item, damage, and NBT) in the inventory at test-local position.
    long
    countItems(TestPos pos, net.minecraft.item.ItemStack template)
    Count all items matching template in the inventory at a test-local (relative) TestPos.
    long
    countItems(String label, net.minecraft.item.ItemStack template)
    Count all matching items in the inventory at the named structure position.
    void
    destroyBlock(int x, int y, int z)
    Destroy the block at test-local position (replace with air).
    void
    Destroy the block at the test-local position.
    void
    Destroy the block at the named structure position.
    void
    Disable random block ticks in this world (e.g.
    int
    extractItem(int x, int y, int z, net.minecraft.item.ItemStack template, int maxAmount)
    Extract up to maxAmount items matching template from the inventory.
    int
    extractItem(TestPos pos, net.minecraft.item.ItemStack template, int maxAmount)
    Extract matching items from the inventory at the test-local position.
    int
    extractItem(String label, net.minecraft.item.ItemStack template, int maxAmount)
    Extract matching items from the inventory at the named structure position.
    void
    Immediately fail this test with no message.
    void
    fail(String message)
    Immediately fail this test with message.
    void
    fixWorldTime(long ticks)
    Fix the world time to a specific value and disable the daylight cycle.
    <T extends net.minecraft.entity.Entity>
    List<T>
    getEntities(Class<T> type, int x, int y, int z)
    Return live entities of type whose bounding boxes intersect the single test-local block at (x, y, z).
    <T extends net.minecraft.entity.Entity>
    List<T>
    getEntities(Class<T> type, int minX, int minY, int minZ, int maxX, int maxY, int maxZ)
    Return live entities of type whose bounding boxes intersect the inclusive test-local block range.
    <T extends net.minecraft.entity.Entity>
    List<T>
    getEntities(Class<T> type, TestPos pos)
    Return live entities of type intersecting the single test-local block at pos.
    <T extends net.minecraft.entity.Entity>
    List<T>
    getEntities(Class<T> type, TestPos min, TestPos max)
    Return live entities of type intersecting the inclusive test-local block range.
    <T extends net.minecraft.entity.Entity>
    List<T>
    getEntities(Class<T> type, String label)
    Return live entities of type intersecting the single block at the named structure position.
    <T extends net.minecraft.entity.Entity>
    List<T>
    getEntities(Class<T> type, String minLabel, String maxLabel)
    Return live entities of type intersecting the inclusive range between two structure labels.
    net.minecraft.nbt.NBTTagCompound
    getEntityNBT(net.minecraft.entity.Entity entity)
    Return a deep copy of an entity's serialized NBT.
    int
     
    int
     
    int
     
    Event log for this test instance.
    net.minecraft.nbt.NBTTagCompound
    getTileNBT(int x, int y, int z)
    Return a deep copy of the TileEntity's serialized NBT at test-local position.
    net.minecraft.nbt.NBTTagCompound
    Return a deep copy of the TileEntity's serialized NBT at the test-local position.
    net.minecraft.nbt.NBTTagCompound
    Return a deep copy of the TileEntity's serialized NBT at the named structure position.
    net.minecraft.world.WorldServer
     
    Return the GTNH-specific helper that provides GregTech machine assertions, EU supply, time-warp, and fluid-hatch utilities.
    void
    insertFluid(int x, int y, int z, net.minecraftforge.fluids.FluidStack fluid)
    Insert a FluidStack into the fluid handler at test-local position.
    void
    insertFluid(TestPos pos, net.minecraftforge.fluids.FluidStack fluid)
    Insert a FluidStack into the fluid handler at the test-local position.
    void
    insertFluid(String label, net.minecraftforge.fluids.FluidStack fluid)
    Insert a FluidStack into the fluid handler at the named structure position.
    void
    insertItem(int x, int y, int z, net.minecraft.item.ItemStack stack)
    Insert an ItemStack into the inventory at test-local position.
    void
    insertItem(TestPos pos, net.minecraft.item.ItemStack stack)
    Insert an ItemStack into the inventory at a test-local (relative) TestPos.
    void
    insertItem(String label, net.minecraft.item.ItemStack stack)
    Insert an ItemStack into the inventory at the named structure position.
    onEachTick(Runnable callback)
    Deprecated.
    Use onEachTick(String, Runnable) so failures identify the callback.
    onEachTick(String name, Runnable callback)
    Register a named, initially enabled callback that runs once per test tick until the test ends.
    Register a named, initially disabled per-tick callback.
    pos(String label)
    Resolve a named coordinate label from this test's structure template.
    void
    pulseRedstone(int x, int y, int z, int durationTicks)
    Place a redstone block at the given test-local position for durationTicks, then remove it.
    void
    pulseRedstone(TestPos pos, int durationTicks)
    Pulse a redstone block at the test-local position.
    void
    pulseRedstone(String label, int durationTicks)
    Pulse a redstone block at the named structure position.
    void
    setBlock(int x, int y, int z, net.minecraft.block.Block block)
     
    void
    setBlock(int x, int y, int z, net.minecraft.block.Block block, int meta)
    Place a block at test-local position.
    void
    setBlock(TestPos pos, net.minecraft.block.Block block)
    Place a block at the test-local position.
    void
    setBlock(TestPos pos, net.minecraft.block.Block block, int meta)
    Place a block with metadata at the test-local position.
    void
    setBlock(String label, net.minecraft.block.Block block)
    Place a block at the named structure position.
    void
    setBlock(String label, net.minecraft.block.Block block, int meta)
    Place a block with metadata at the named structure position.
    void
    setRedstoneInput(int x, int y, int z, int strength)
    Set a redstone signal source (repeater-like) at test-local position by placing a redstone block (strength = 15) or air (strength = 0).
    void
    setRedstoneInput(TestPos pos, int strength)
    Set a redstone signal source at the test-local position.
    void
    setRedstoneInput(String label, int strength)
    Set a redstone signal source at the named structure position.
    void
    setSlot(int x, int y, int z, int slot, net.minecraft.item.ItemStack stack)
    Directly set an inventory slot at test-local position to a copy of stack, bypassing normal insertion rules, then mark the inventory dirty.
    void
    setSlot(TestPos pos, int slot, net.minecraft.item.ItemStack stack)
    Directly set an inventory slot at a test-local (relative) TestPos.
    void
    setSlot(String label, int slot, net.minecraft.item.ItemStack stack)
    Directly set an inventory slot at the named structure position.
    void
    setTile(int x, int y, int z, net.minecraft.nbt.NBTTagCompound nbt)
    Apply an NBT compound to the TileEntity at test-local position.
    void
    setTile(TestPos pos, net.minecraft.nbt.NBTTagCompound nbt)
    Apply an NBT compound to the TileEntity at the test-local position.
    void
    setTile(String label, net.minecraft.nbt.NBTTagCompound nbt)
    Apply an NBT compound to the TileEntity at the named structure position.
    void
    Apply a weather preset and lock it for the duration of the test.
    void
    simulateLeftClick(int x, int y, int z, net.minecraftforge.common.util.FakePlayer player)
    Simulate a left-click (block punch) at test-local position.
    void
    simulateLeftClick(TestPos pos, net.minecraftforge.common.util.FakePlayer player)
    Simulate a left-click on the block at the test-local position.
    void
    simulateLeftClick(String label, net.minecraftforge.common.util.FakePlayer player)
    Simulate a left-click on the block at the named structure position.
    boolean
    simulateRightClick(int x, int y, int z, net.minecraftforge.common.util.FakePlayer player, net.minecraft.item.ItemStack heldItem)
    Simulate a right-click on the block at test-local position using the given player and held item.
    boolean
    simulateRightClick(TestPos pos, net.minecraftforge.common.util.FakePlayer player, net.minecraft.item.ItemStack heldItem)
    Simulate a right-click on the block at the test-local position.
    boolean
    simulateRightClick(String label, net.minecraftforge.common.util.FakePlayer player, net.minecraft.item.ItemStack heldItem)
    Simulate a right-click on the block at the named structure position.
    net.minecraft.entity.Entity
    spawnEntity(String entityId, double x, double y, double z)
    Create an entity by NBT entity id, spawn it at the test-local position, and return it.
    net.minecraft.entity.Entity
    spawnEntity(String entityId, TestPos pos)
    Create an entity by NBT entity id and spawn it at the test-local block position.
    net.minecraft.entity.Entity
    spawnEntity(String entityId, String label)
    Create an entity by NBT entity id and spawn it at the named structure position.
    <T extends net.minecraft.entity.Entity>
    T
    spawnEntity(T entity, double x, double y, double z)
    Spawn entity at the test-local position and return it.
    <T extends net.minecraft.entity.Entity>
    T
    spawnEntity(T entity, TestPos pos)
    Spawn entity at the test-local block position and return it.
    <T extends net.minecraft.entity.Entity>
    T
    spawnEntity(T entity, String label)
    Spawn entity at the named structure position and return it.
    net.minecraftforge.common.util.FakePlayer
    spawnFakePlayer(String profileName)
    Spawn a fake player with the given profile name, positioned at the test's origin.
    Create and attach a new GameTestSequence to this test.
    void
    Immediately mark this test as passed.
    void
    Pass at the end of timeoutTicks after the final tick's callbacks and sequence actions have run.
    void
    Polls predicate each tick; passes on the first true.

    Methods inherited from class java.lang.Object

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

    • GameTestHelper

      public GameTestHelper(GameTestInstance instance, net.minecraft.world.WorldServer world, int originX, int originY, int originZ)
  • Method Details

    • absolute

      public TestPos absolute(int x, int y, int z)
      Convert test-local block coordinates to an absolute TestPos in world space.
    • absolute

      public TestPos absolute(TestPos pos)
      Convert a test-local block position to an absolute TestPos in world space.
    • pos

      public TestPos pos(String label)
      Resolve a named coordinate label from this test's structure template. Returned coordinates are test-local and include the test's @GameTest(rotation = ...) transform.
      Throws:
      LabelResolutionException - if this test has no such label
    • absolute

      public TestPos absolute(String label)
      Resolve a named coordinate label to world-absolute coordinates. The label is first resolved with pos(String), so test rotation is applied.
      Throws:
      LabelResolutionException - if this test has no such label
    • startSequence

      public GameTestSequence startSequence()
      Create and attach a new GameTestSequence to this test. Must be called at most once per test method. Returns the sequence so the caller can chain step methods.
    • succeed

      public void succeed()
      Immediately mark this test as passed. Equivalent to startSequence().thenSucceed() but without the one-tick delay.
    • succeedWhen

      public void succeedWhen(BooleanSupplier predicate)
      Polls predicate each tick; passes on the first true. At most once per test.
    • succeedAtTimeout

      public void succeedAtTimeout()
      Pass at the end of timeoutTicks after the final tick's callbacks and sequence actions have run.
    • onEachTick

      public TickCallbackHandle onEachTick(String name, Runnable callback)
      Register a named, initially enabled callback that runs once per test tick until the test ends. Useful for negative assertions that must hold continuously.

      The returned handle is initially enabled and can temporarily disable or permanently remove the callback. Per-tick callbacks run in registration order during the END phase, before succeedWhen, END-phase sequence actions, and timeout evaluation. A callback registered while per-tick callbacks are running begins on the next tick. If the callback fails, name is included in reports. Use onEachTickDisabled(String, Runnable) when a sequence enables the callback later.

      Parameters:
      name - non-blank diagnostic name for this callback
      callback - action invoked during each enabled END phase
      Returns:
      a handle that controls this callback registration
    • onEachTick

      @Deprecated public TickCallbackHandle onEachTick(Runnable callback)
      Deprecated.
      Use onEachTick(String, Runnable) so failures identify the callback.
      Register an initially enabled callback without a diagnostic name.
    • onEachTickDisabled

      public TickCallbackHandle onEachTickDisabled(String name, Runnable callback)
      Register a named, initially disabled per-tick callback. Enable the returned handle from a sequence action when its observation window begins.
      Parameters:
      name - non-blank diagnostic name for this callback
      callback - action invoked during each enabled END phase
      Returns:
      a disabled handle that controls this callback registration
    • afterTest

      public void afterTest(Runnable callback)
      Register callback to run once when this test ends, regardless of outcome.
    • assumeTrue

      public void assumeTrue(boolean condition, String reason)
      Skip this test when condition is false. The reason is included in machine-readable reports. Like assertion helpers, a failed assumption aborts the current test callback immediately.
    • assumeFalse

      public void assumeFalse(boolean condition, String reason)
      Skip this test when condition is true. The reason is included in machine-readable reports. Like assertion helpers, a failed assumption aborts the current test callback immediately.
    • fail

      public void fail(String message)
      Immediately fail this test with message. Throws GameTestAssertException so that any enclosing thenExecute lambda propagates the failure correctly.
    • fail

      public void fail()
      Immediately fail this test with no message.
    • assertTrue

      public void assertTrue(boolean condition, String message)
      Fail if condition is false.
    • assertTrue

      public void assertTrue(boolean condition)
      Fail if condition is false.
    • assertFalse

      public void assertFalse(boolean condition, String message)
      Fail if condition is true.
    • assertFalse

      public void assertFalse(boolean condition)
      Fail if condition is true.
    • assertNull

      public void assertNull(Object actual, String message)
      Fail if actual is not null.
    • assertNull

      public void assertNull(Object actual)
      Fail if actual is not null.
    • assertNotNull

      public void assertNotNull(Object actual, String message)
      Fail if actual is null.
    • assertNotNull

      public void assertNotNull(Object actual)
      Fail if actual is null.
    • assertEquals

      public void assertEquals(Object expected, Object actual, String message)
      Fail if expected and actual are not equal per Objects.equals(java.lang.Object, java.lang.Object).
    • assertEquals

      public void assertEquals(Object expected, Object actual)
      Fail if expected and actual are not equal per Objects.equals(java.lang.Object, java.lang.Object).
    • assertItemEqual

      public void assertItemEqual(net.minecraft.item.ItemStack expected, net.minecraft.item.ItemStack actual, String message)
      Fail if expected and actual differ by item, damage, stack size, or NBT. The failure message prints all four fields for both stacks. Two null stacks compare equal.
    • assertItemEqual

      public void assertItemEqual(net.minecraft.item.ItemStack expected, net.minecraft.item.ItemStack actual)
      Fail if expected and actual differ by item, damage, stack size, or NBT. The failure message prints all four fields for both stacks. Two null stacks compare equal.
    • assertEquals

      public void assertEquals(long expected, long actual, String message)
      Fail if expected != actual.
    • assertEquals

      public void assertEquals(long expected, long actual)
      Fail if expected != actual.
    • assertEquals

      public void assertEquals(double expected, double actual, double delta, String message)
      Fail if |expected - actual| > delta.
    • assertEquals

      public void assertEquals(double expected, double actual, double delta)
      Fail if |expected - actual| > delta.
    • assertNotEquals

      public void assertNotEquals(Object unexpected, Object actual, String message)
      Fail if unexpected and actual are equal per Objects.equals(java.lang.Object, java.lang.Object).
    • assertNotEquals

      public void assertNotEquals(Object unexpected, Object actual)
      Fail if unexpected and actual are equal per Objects.equals(java.lang.Object, java.lang.Object).
    • assertNotEquals

      public void assertNotEquals(long unexpected, long actual, String message)
      Fail if unexpected == actual.
    • assertNotEquals

      public void assertNotEquals(long unexpected, long actual)
      Fail if unexpected == actual.
    • assertNotEquals

      public void assertNotEquals(double unexpected, double actual, double delta, String message)
      Fail if |unexpected - actual| <= delta.
    • assertNotEquals

      public void assertNotEquals(double unexpected, double actual, double delta)
      Fail if |unexpected - actual| <= delta.
    • assertSame

      public void assertSame(Object expected, Object actual, String message)
      Fail if expected and actual are not the same object reference (==).
    • assertSame

      public void assertSame(Object expected, Object actual)
      Fail if expected and actual are not the same object reference (==).
    • assertNotSame

      public void assertNotSame(Object unexpected, Object actual, String message)
      Fail if unexpected and actual are the same object reference (==).
    • assertNotSame

      public void assertNotSame(Object unexpected, Object actual)
      Fail if unexpected and actual are the same object reference (==).
    • assertInstanceOf

      public <T> T assertInstanceOf(Class<T> type, Object actual, String message)
      Fail if actual is not an instance of type. Returns actual cast to T.
    • assertInstanceOf

      public <T> T assertInstanceOf(Class<T> type, Object actual)
      Fail if actual is not an instance of type. Returns actual cast to T.
    • assertThrows

      public <T extends Throwable> T assertThrows(Class<T> expectedType, Runnable action, String message)
      Assert that action throws an exception of exactly type expectedType. Returns the thrown exception for further inspection. Fails if nothing is thrown or the wrong type is thrown.
    • assertThrows

      public <T extends Throwable> T assertThrows(Class<T> expectedType, Runnable action)
      Assert that action throws an exception of exactly type expectedType. Returns the thrown exception for further inspection.
    • assertIterableEquals

      public void assertIterableEquals(Iterable<?> expected, Iterable<?> actual, String message)
      Assert that two iterables contain equal elements in the same order (deep equality via Objects.equals(java.lang.Object, java.lang.Object)).
    • assertIterableEquals

      public void assertIterableEquals(Iterable<?> expected, Iterable<?> actual)
      Assert that two iterables contain equal elements in the same order.
    • assertLinesMatch

      public void assertLinesMatch(List<String> expectedLines, List<String> actualLines, String message)
      Assert that actualLines matches expectedLines line by line. Each expected line is first compared verbatim; on mismatch it is tried as a regex. Use ">>" to skip all remaining actual lines, or ">> N >>" to skip exactly N lines.
    • assertLinesMatch

      public void assertLinesMatch(List<String> expectedLines, List<String> actualLines)
      Assert that actualLines matches expectedLines — see assertLinesMatch(List, List, String).
    • getWorld

      public net.minecraft.world.WorldServer getWorld()
    • getRecorder

      public EventLog getRecorder()
      Event log for this test instance. Events are appended in emit order; filter with snapshot().stream() to query specific event types.
    • getOriginX

      public int getOriginX()
    • getOriginY

      public int getOriginY()
    • getOriginZ

      public int getOriginZ()
    • assertBlockPresent

      public void assertBlockPresent(net.minecraft.block.Block expected, int x, int y, int z)
      Assert that the block at test-local position (x, y, z) is expected. Optionally checks metadata when meta >= 0.
    • assertBlockPresent

      public void assertBlockPresent(net.minecraft.block.Block expected, TestPos pos)
      Assert that the block at test-local position pos is expected.
    • assertBlockPresent

      public void assertBlockPresent(net.minecraft.block.Block expected, String label)
      Assert that the block at the named structure position is expected.
    • assertBlockPresent

      public void assertBlockPresent(net.minecraft.block.Block expected, int meta, int x, int y, int z)
      Assert that the block at test-local position is expected with the given metadata. Pass meta < 0 to skip the meta check.
    • assertBlockPresent

      public void assertBlockPresent(net.minecraft.block.Block expected, int meta, TestPos pos)
      Assert that the block at pos is expected with the given metadata.
    • assertBlockPresent

      public void assertBlockPresent(net.minecraft.block.Block expected, int meta, String label)
      Assert that the block at the named structure position is expected with the given metadata.
    • assertBlockAbsent

      public void assertBlockAbsent(net.minecraft.block.Block unexpected, int x, int y, int z)
      Assert that the block at test-local position (x, y, z) is NOT unexpected.
    • assertBlockAbsent

      public void assertBlockAbsent(net.minecraft.block.Block unexpected, TestPos pos)
      Assert that the block at test-local position pos is NOT unexpected.
    • assertBlockAbsent

      public void assertBlockAbsent(net.minecraft.block.Block unexpected, String label)
      Assert that the block at the named structure position is NOT unexpected.
    • assertTileEntityPresent

      public net.minecraft.tileentity.TileEntity assertTileEntityPresent(int x, int y, int z)
      Assert that a TileEntity exists at test-local position (x, y, z). Returns the TileEntity for further inspection.
    • assertTileEntityPresent

      public net.minecraft.tileentity.TileEntity assertTileEntityPresent(TestPos pos)
      Assert that a TileEntity exists at the test-local position and return it.
    • assertTileEntityPresent

      public net.minecraft.tileentity.TileEntity assertTileEntityPresent(String label)
      Assert that a TileEntity exists at the named structure position and return it.
    • assertTileEntityPresent

      public <T extends net.minecraft.tileentity.TileEntity> T assertTileEntityPresent(Class<T> type, int x, int y, int z)
      Assert that a TileEntity of a specific type exists at test-local position. Returns the TileEntity cast to the requested type.
    • assertTileEntityPresent

      public <T extends net.minecraft.tileentity.TileEntity> T assertTileEntityPresent(Class<T> type, TestPos pos)
      Assert that a TileEntity of type exists at the test-local position and return it.
    • assertTileEntityPresent

      public <T extends net.minecraft.tileentity.TileEntity> T assertTileEntityPresent(Class<T> type, String label)
      Assert that a TileEntity of type exists at the named structure position and return it.
    • assertTileNBT

      public void assertTileNBT(int x, int y, int z, net.minecraft.nbt.NBTTagCompound expectedSubset)
      Assert that the TileEntity NBT at test-local position contains all keys/values from expectedSubset. Only the keys present in expectedSubset are checked.
    • assertTileNBT

      public void assertTileNBT(TestPos pos, net.minecraft.nbt.NBTTagCompound expectedSubset)
      Assert that the TileEntity NBT at the test-local position contains expectedSubset.
    • assertTileNBT

      public void assertTileNBT(String label, net.minecraft.nbt.NBTTagCompound expectedSubset)
      Assert that the TileEntity NBT at the named structure position contains expectedSubset.
    • assertTileNBTPath

      public void assertTileNBTPath(int x, int y, int z, String path, String expectedValue)
      Assert a specific value at a dotted NBT path (e.g. "mInventory.0.id"). Comparison is done via the tag's string representation.
    • assertTileNBTPath

      public void assertTileNBTPath(TestPos pos, String path, String expectedValue)
      Assert a value at a dotted NBT path on the TileEntity at the test-local position.
    • assertTileNBTPath

      public void assertTileNBTPath(String label, String path, String expectedValue)
      Assert a value at a dotted NBT path on the TileEntity at the named structure position.
    • getTileNBT

      public net.minecraft.nbt.NBTTagCompound getTileNBT(int x, int y, int z)
      Return a deep copy of the TileEntity's serialized NBT at test-local position.
    • getTileNBT

      public net.minecraft.nbt.NBTTagCompound getTileNBT(TestPos pos)
      Return a deep copy of the TileEntity's serialized NBT at the test-local position.
    • getTileNBT

      public net.minecraft.nbt.NBTTagCompound getTileNBT(String label)
      Return a deep copy of the TileEntity's serialized NBT at the named structure position.
    • getEntities

      public <T extends net.minecraft.entity.Entity> List<T> getEntities(Class<T> type, int x, int y, int z)
      Return live entities of type whose bounding boxes intersect the single test-local block at (x, y, z).
    • getEntities

      public <T extends net.minecraft.entity.Entity> List<T> getEntities(Class<T> type, TestPos pos)
      Return live entities of type intersecting the single test-local block at pos.
    • getEntities

      public <T extends net.minecraft.entity.Entity> List<T> getEntities(Class<T> type, String label)
      Return live entities of type intersecting the single block at the named structure position.
    • getEntities

      public <T extends net.minecraft.entity.Entity> List<T> getEntities(Class<T> type, int minX, int minY, int minZ, int maxX, int maxY, int maxZ)
      Return live entities of type whose bounding boxes intersect the inclusive test-local block range.
    • getEntities

      public <T extends net.minecraft.entity.Entity> List<T> getEntities(Class<T> type, TestPos min, TestPos max)
      Return live entities of type intersecting the inclusive test-local block range.
    • getEntities

      public <T extends net.minecraft.entity.Entity> List<T> getEntities(Class<T> type, String minLabel, String maxLabel)
      Return live entities of type intersecting the inclusive range between two structure labels.
    • assertEntityPresent

      public net.minecraft.entity.Entity assertEntityPresent(int x, int y, int z)
      Assert that at least one live entity exists in the single test-local block at (x, y, z). Returns the first matching entity for further inspection.
    • assertEntityPresent

      public net.minecraft.entity.Entity assertEntityPresent(TestPos pos)
      Assert that at least one live entity exists in the single test-local block at pos.
    • assertEntityPresent

      public net.minecraft.entity.Entity assertEntityPresent(String label)
      Assert that at least one live entity exists at the named structure position.
    • assertEntityPresent

      public <T extends net.minecraft.entity.Entity> T assertEntityPresent(Class<T> type, int x, int y, int z)
      Assert that at least one live entity of type exists in the single test-local block at (x, y, z). Returns the first matching entity for further inspection.
    • assertEntityPresent

      public <T extends net.minecraft.entity.Entity> T assertEntityPresent(Class<T> type, TestPos pos)
      Assert that at least one live entity of type exists in the block at pos.
    • assertEntityPresent

      public <T extends net.minecraft.entity.Entity> T assertEntityPresent(Class<T> type, String label)
      Assert that at least one live entity of type exists at the named structure position.
    • assertEntityAbsent

      public void assertEntityAbsent(int x, int y, int z)
      Assert that no live entity exists in the single test-local block at (x, y, z).
    • assertEntityAbsent

      public void assertEntityAbsent(TestPos pos)
      Assert that no live entity exists in the single test-local block at pos.
    • assertEntityAbsent

      public void assertEntityAbsent(String label)
      Assert that no live entity exists at the named structure position.
    • assertEntityAbsent

      public void assertEntityAbsent(Class<? extends net.minecraft.entity.Entity> type, int x, int y, int z)
      Assert that no live entity of type exists in the single test-local block at (x, y, z).
    • assertEntityAbsent

      public void assertEntityAbsent(Class<? extends net.minecraft.entity.Entity> type, TestPos pos)
      Assert that no live entity of type exists in the single test-local block at pos.
    • assertEntityAbsent

      public void assertEntityAbsent(Class<? extends net.minecraft.entity.Entity> type, String label)
      Assert that no live entity of type exists at the named structure position.
    • assertEntityCount

      public void assertEntityCount(int expectedCount, int x, int y, int z)
      Assert that exactly expectedCount live entities exist in the single test-local block at (x, y, z).
    • assertEntityCount

      public void assertEntityCount(int expectedCount, TestPos pos)
      Assert the live entity count in the single test-local block at pos.
    • assertEntityCount

      public void assertEntityCount(int expectedCount, String label)
      Assert the live entity count at the named structure position.
    • assertEntityCount

      public void assertEntityCount(Class<? extends net.minecraft.entity.Entity> type, int expectedCount, int x, int y, int z)
      Assert that exactly expectedCount live entities of type exist in the single test-local block at (x, y, z).
    • assertEntityCount

      public void assertEntityCount(Class<? extends net.minecraft.entity.Entity> type, int expectedCount, TestPos pos)
      Assert the live entity count of type in the single test-local block at pos.
    • assertEntityCount

      public void assertEntityCount(Class<? extends net.minecraft.entity.Entity> type, int expectedCount, String label)
      Assert the live entity count of type at the named structure position.
    • assertEntityCount

      public void assertEntityCount(int expectedCount, int minX, int minY, int minZ, int maxX, int maxY, int maxZ)
      Assert that exactly expectedCount live entities exist in the inclusive test-local block range.
    • assertEntityCount

      public void assertEntityCount(int expectedCount, TestPos min, TestPos max)
      Assert the live entity count in the inclusive test-local block range.
    • assertEntityCount

      public void assertEntityCount(int expectedCount, String minLabel, String maxLabel)
      Assert the live entity count in the inclusive range between two structure labels.
    • assertEntityCount

      public void assertEntityCount(Class<? extends net.minecraft.entity.Entity> type, int expectedCount, int minX, int minY, int minZ, int maxX, int maxY, int maxZ)
      Assert that exactly expectedCount live entities of type exist in the inclusive test-local block range.
    • assertEntityCount

      public void assertEntityCount(Class<? extends net.minecraft.entity.Entity> type, int expectedCount, TestPos min, TestPos max)
      Assert the live entity count of type in the inclusive test-local block range.
    • assertEntityCount

      public void assertEntityCount(Class<? extends net.minecraft.entity.Entity> type, int expectedCount, String minLabel, String maxLabel)
      Assert the live entity count of type in the inclusive range between two structure labels.
    • spawnEntity

      public <T extends net.minecraft.entity.Entity> T spawnEntity(T entity, double x, double y, double z)
      Spawn entity at the test-local position and return it.
      Throws:
      GameTestAssertException - if the world refuses to spawn the entity
    • spawnEntity

      public <T extends net.minecraft.entity.Entity> T spawnEntity(T entity, TestPos pos)
      Spawn entity at the test-local block position and return it.
    • spawnEntity

      public <T extends net.minecraft.entity.Entity> T spawnEntity(T entity, String label)
      Spawn entity at the named structure position and return it.
    • spawnEntity

      public net.minecraft.entity.Entity spawnEntity(String entityId, double x, double y, double z)
      Create an entity by NBT entity id, spawn it at the test-local position, and return it.
    • spawnEntity

      public net.minecraft.entity.Entity spawnEntity(String entityId, TestPos pos)
      Create an entity by NBT entity id and spawn it at the test-local block position.
    • spawnEntity

      public net.minecraft.entity.Entity spawnEntity(String entityId, String label)
      Create an entity by NBT entity id and spawn it at the named structure position.
    • assertEntityNBT

      public void assertEntityNBT(net.minecraft.entity.Entity entity, net.minecraft.nbt.NBTTagCompound expectedSubset)
      Assert that the entity's NBT contains all keys/values from expectedSubset. Only the keys present in expectedSubset are checked.
    • assertEntityNBTPath

      public void assertEntityNBTPath(net.minecraft.entity.Entity entity, String path, String expectedValue)
      Assert a specific value at a dotted NBT path on an entity (e.g. "Pos.0"). Comparison is done via the tag's string representation.
    • getEntityNBT

      public net.minecraft.nbt.NBTTagCompound getEntityNBT(net.minecraft.entity.Entity entity)
      Return a deep copy of an entity's serialized NBT.
    • insertItem

      public void insertItem(int x, int y, int z, net.minecraft.item.ItemStack stack)
      Insert an ItemStack into the inventory at test-local position. Auto-detects ISidedInventory vs plain IInventory.
      Throws:
      GameTestAssertException - if no inventory exists or the stack couldn't be fully inserted
    • insertItem

      public void insertItem(TestPos pos, net.minecraft.item.ItemStack stack)
      Insert an ItemStack into the inventory at a test-local (relative) TestPos.
    • insertItem

      public void insertItem(String label, net.minecraft.item.ItemStack stack)
      Insert an ItemStack into the inventory at the named structure position.
    • assertInventoryContains

      public void assertInventoryContains(int x, int y, int z, net.minecraft.item.ItemStack expected)
      Assert that the inventory at test-local position contains at least the given stack (item, damage, NBT match; stack size is minimum).
    • assertInventoryContains

      public void assertInventoryContains(TestPos pos, net.minecraft.item.ItemStack expected)
      Assert that the inventory at test-local (relative) TestPos contains at least the given stack.
    • assertInventoryContains

      public void assertInventoryContains(String label, net.minecraft.item.ItemStack expected)
      Assert that the inventory at the named structure position contains at least expected.
    • countItems

      public long countItems(int x, int y, int z, net.minecraft.item.ItemStack template)
      Count all items matching template (item, damage, and NBT) in the inventory at test-local position. The template's stack size is ignored.
    • countItems

      public long countItems(TestPos pos, net.minecraft.item.ItemStack template)
      Count all items matching template in the inventory at a test-local (relative) TestPos.
    • countItems

      public long countItems(String label, net.minecraft.item.ItemStack template)
      Count all matching items in the inventory at the named structure position.
    • assertInventoryCount

      public void assertInventoryCount(int x, int y, int z, net.minecraft.item.ItemStack template, long expectedCount)
      Assert that exactly expectedCount items matching template exist across the inventory at test-local position. The template's stack size is ignored and expectedCount may be zero.
    • assertInventoryCount

      public void assertInventoryCount(TestPos pos, net.minecraft.item.ItemStack template, long expectedCount)
      Assert an exact matching item count across the inventory at a test-local (relative) TestPos.
    • assertInventoryCount

      public void assertInventoryCount(String label, net.minecraft.item.ItemStack template, long expectedCount)
      Assert an exact matching item count in the inventory at the named structure position.
    • assertInventoryEmpty

      public void assertInventoryEmpty(int x, int y, int z)
      Assert that every slot of the inventory at test-local position is empty.
    • assertInventoryEmpty

      public void assertInventoryEmpty(TestPos pos)
      Assert that every slot of the inventory at the test-local position is empty.
    • assertInventoryEmpty

      public void assertInventoryEmpty(String label)
      Assert that every slot of the inventory at the named structure position is empty.
    • assertSlot

      public void assertSlot(int x, int y, int z, int slot, net.minecraft.item.ItemStack expected)
      Assert that a specific slot contains the given stack (exact item + damage + NBT + size).
    • assertSlot

      public void assertSlot(TestPos pos, int slot, net.minecraft.item.ItemStack expected)
      Assert the contents of a specific inventory slot at the test-local position.
    • assertSlot

      public void assertSlot(String label, int slot, net.minecraft.item.ItemStack expected)
      Assert the contents of a specific inventory slot at the named structure position.
    • setSlot

      public void setSlot(int x, int y, int z, int slot, net.minecraft.item.ItemStack stack)
      Directly set an inventory slot at test-local position to a copy of stack, bypassing normal insertion rules, then mark the inventory dirty.
    • setSlot

      public void setSlot(TestPos pos, int slot, net.minecraft.item.ItemStack stack)
      Directly set an inventory slot at a test-local (relative) TestPos.
    • setSlot

      public void setSlot(String label, int slot, net.minecraft.item.ItemStack stack)
      Directly set an inventory slot at the named structure position.
    • clearSlot

      public void clearSlot(int x, int y, int z, int slot)
      Directly clear an inventory slot at test-local position, bypassing normal extraction rules, then mark the inventory dirty.
    • clearSlot

      public void clearSlot(TestPos pos, int slot)
      Directly clear an inventory slot at a test-local (relative) TestPos.
    • clearSlot

      public void clearSlot(String label, int slot)
      Directly clear an inventory slot at the named structure position.
    • extractItem

      public int extractItem(int x, int y, int z, net.minecraft.item.ItemStack template, int maxAmount)
      Extract up to maxAmount items matching template from the inventory. Returns the actual amount extracted.
    • extractItem

      public int extractItem(TestPos pos, net.minecraft.item.ItemStack template, int maxAmount)
      Extract matching items from the inventory at the test-local position.
    • extractItem

      public int extractItem(String label, net.minecraft.item.ItemStack template, int maxAmount)
      Extract matching items from the inventory at the named structure position.
    • insertFluid

      public void insertFluid(int x, int y, int z, net.minecraftforge.fluids.FluidStack fluid)
      Insert a FluidStack into the fluid handler at test-local position.
      Throws:
      GameTestAssertException - if no fluid handler exists or the fluid couldn't be fully inserted
    • insertFluid

      public void insertFluid(TestPos pos, net.minecraftforge.fluids.FluidStack fluid)
      Insert a FluidStack into the fluid handler at the test-local position.
    • insertFluid

      public void insertFluid(String label, net.minecraftforge.fluids.FluidStack fluid)
      Insert a FluidStack into the fluid handler at the named structure position.
    • assertFluidTank

      public void assertFluidTank(int x, int y, int z, net.minecraftforge.fluids.FluidStack expected)
      Assert that the fluid handler at test-local position contains at least expected.amount mB of the expected fluid.
    • assertFluidTank

      public void assertFluidTank(TestPos pos, net.minecraftforge.fluids.FluidStack expected)
      Assert that the fluid handler at the test-local position contains at least expected.
    • assertFluidTank

      public void assertFluidTank(String label, net.minecraftforge.fluids.FluidStack expected)
      Assert that the fluid handler at the named structure position contains at least expected.
    • assertFluidTankEmpty

      public void assertFluidTankEmpty(int x, int y, int z)
      Assert that the fluid handler at test-local position has no fluid.
    • assertFluidTankEmpty

      public void assertFluidTankEmpty(TestPos pos)
      Assert that the fluid handler at the test-local position has no fluid.
    • assertFluidTankEmpty

      public void assertFluidTankEmpty(String label)
      Assert that the fluid handler at the named structure position has no fluid.
    • setBlock

      public void setBlock(int x, int y, int z, net.minecraft.block.Block block, int meta)
      Place a block at test-local position. Uses flag 3 (notify + send to client).
    • setBlock

      public void setBlock(TestPos pos, net.minecraft.block.Block block, int meta)
      Place a block with metadata at the test-local position.
    • setBlock

      public void setBlock(String label, net.minecraft.block.Block block, int meta)
      Place a block with metadata at the named structure position.
    • setBlock

      public void setBlock(int x, int y, int z, net.minecraft.block.Block block)
    • setBlock

      public void setBlock(TestPos pos, net.minecraft.block.Block block)
      Place a block at the test-local position.
    • setBlock

      public void setBlock(String label, net.minecraft.block.Block block)
      Place a block at the named structure position.
    • destroyBlock

      public void destroyBlock(int x, int y, int z)
      Destroy the block at test-local position (replace with air). Drops are not spawned.
    • destroyBlock

      public void destroyBlock(TestPos pos)
      Destroy the block at the test-local position.
    • destroyBlock

      public void destroyBlock(String label)
      Destroy the block at the named structure position.
    • setTile

      public void setTile(int x, int y, int z, net.minecraft.nbt.NBTTagCompound nbt)
      Apply an NBT compound to the TileEntity at test-local position. The x/y/z keys in the compound are overwritten with the absolute position so the TE doesn't teleport.
    • setTile

      public void setTile(TestPos pos, net.minecraft.nbt.NBTTagCompound nbt)
      Apply an NBT compound to the TileEntity at the test-local position.
    • setTile

      public void setTile(String label, net.minecraft.nbt.NBTTagCompound nbt)
      Apply an NBT compound to the TileEntity at the named structure position.
    • pulseRedstone

      public void pulseRedstone(int x, int y, int z, int durationTicks)
      Place a redstone block at the given test-local position for durationTicks, then remove it. Uses a delayed sequence event on the test instance.
    • pulseRedstone

      public void pulseRedstone(TestPos pos, int durationTicks)
      Pulse a redstone block at the test-local position.
    • pulseRedstone

      public void pulseRedstone(String label, int durationTicks)
      Pulse a redstone block at the named structure position.
    • setRedstoneInput

      public void setRedstoneInput(int x, int y, int z, int strength)
      Set a redstone signal source (repeater-like) at test-local position by placing a redstone block (strength = 15) or air (strength = 0).
      Parameters:
      strength - 0 to clear, any positive value places a redstone block (full signal 15)
    • setRedstoneInput

      public void setRedstoneInput(TestPos pos, int strength)
      Set a redstone signal source at the test-local position.
    • setRedstoneInput

      public void setRedstoneInput(String label, int strength)
      Set a redstone signal source at the named structure position.
    • assertRedstonePower

      public void assertRedstonePower(int x, int y, int z, int minPower)
      Assert that the block at test-local position is receiving at least minPower redstone power.
    • assertRedstonePower

      public void assertRedstonePower(TestPos pos, int minPower)
      Assert the minimum redstone power at the test-local position.
    • assertRedstonePower

      public void assertRedstonePower(String label, int minPower)
      Assert the minimum redstone power at the named structure position.
    • disableRandomTicks

      public void disableRandomTicks()
      Disable random block ticks in this world (e.g. crop growth, leaf decay) for deterministic tests. The original randomTickSpeed value is automatically restored after the test.
    • fixWorldTime

      public void fixWorldTime(long ticks)
      Fix the world time to a specific value and disable the daylight cycle. The original time and doDaylightCycle value are automatically restored after the test.
    • setWeather

      public void setWeather(Weather weather)
      Apply a weather preset and lock it for the duration of the test. The original weather state is automatically restored after the test.
    • spawnFakePlayer

      public net.minecraftforge.common.util.FakePlayer spawnFakePlayer(String profileName)
      Spawn a fake player with the given profile name, positioned at the test's origin.
    • simulateRightClick

      public boolean simulateRightClick(int x, int y, int z, net.minecraftforge.common.util.FakePlayer player, net.minecraft.item.ItemStack heldItem)
      Simulate a right-click on the block at test-local position using the given player and held item. Returns true if the activation was handled.
    • simulateRightClick

      public boolean simulateRightClick(TestPos pos, net.minecraftforge.common.util.FakePlayer player, net.minecraft.item.ItemStack heldItem)
      Simulate a right-click on the block at the test-local position.
    • simulateRightClick

      public boolean simulateRightClick(String label, net.minecraftforge.common.util.FakePlayer player, net.minecraft.item.ItemStack heldItem)
      Simulate a right-click on the block at the named structure position.
    • simulateLeftClick

      public void simulateLeftClick(int x, int y, int z, net.minecraftforge.common.util.FakePlayer player)
      Simulate a left-click (block punch) at test-local position.
    • simulateLeftClick

      public void simulateLeftClick(TestPos pos, net.minecraftforge.common.util.FakePlayer player)
      Simulate a left-click on the block at the test-local position.
    • simulateLeftClick

      public void simulateLeftClick(String label, net.minecraftforge.common.util.FakePlayer player)
      Simulate a left-click on the block at the named structure position.
    • gtnh

      public GTNHGameTestHelper gtnh()
      Return the GTNH-specific helper that provides GregTech machine assertions, EU supply, time-warp, and fluid-hatch utilities. The helper is created lazily on first call and reused on subsequent calls within the same test instance.
      Throws:
      IllegalStateException - if GT5-Unofficial (mod ID gregtech) is not loaded