Class Multiblock
Create with GTNHGameTestHelper.multiblock(TestPos). Mod-specific controllers that keep hatches off the
standard
MTEMultiBlockBase lists are not covered.
-
Method Summary
Modifier and TypeMethodDescriptionvoidAsserts the controller is fully formed.voidNegative invariant helper for invalid templates.voidassertNeverForms(String message) Negative invariant helper for invalid templates.voidFails if the controller block is no longer a GregTech tile entity.voidForces a structure check and fails if the controller reports formed afterward.voidassertNotFormed(String message) Forces a structure check and fails withmessageif the controller reports formed afterward.booleancheckStructure(boolean forceReset) Runs the controller's structure check and returns whether it reports formed afterward.energyHatch(int index) Energy hatch by index inMTEMultiBlockBase.mEnergyHatches.voidMTEMultiBlockBase.fixAllIssues()thenMTEMultiBlockBase.enableWorking().booleanForces the controller to runMTEMultiBlockBase.checkStructure(boolean, IGregTechTileEntity)withforceReset = true, then returns whether it reports formed.intinputBus(int index) Input bus by index inMTEMultiBlockBase.mInputBusses.inputHatch(int index) Fluid input hatch by index inMTEMultiBlockBase.mInputHatches.inputs()All input buses fromMTEMultiBlockBase.mInputBusses, skipping invalid tiles andMTEHatchCraftingInputME.booleanisFormed()Whether the controller reports a formed structure.booleanWhether the controller is in the middle of a recipe cycle.outputBus(int index) Output bus by index inMTEMultiBlockBase.mOutputBusses.outputHatch(int index) Fluid output hatch by index in the multiblock's canonical output-hatch ordering.outputs()All output buses fromMTEMultiBlockBase.mOutputBussesthat are valid.intprogress()Current progress ticks for the active recipe, or zero when idle.voidMTEMultiBlockBase.enableWorking()then time-warps until the machine starts processing and becomes idle again, with a default tick bound.voidrunRecipe(int maxTicks) MTEMultiBlockBase.enableWorking()then time-warps until the machine starts processing and becomes idle again, or untilmaxTickssimulated ticks have elapsed.
-
Method Details
-
assertFormed
public void assertFormed()Asserts the controller is fully formed. RunsMTEMultiBlockBase.checkStructure(boolean, IGregTechTileEntity)withforceReset = trueonce if the structure is not yet valid, then fails if still unformed.Sets
mStartUpCheck = -1on success, disabling the controller's periodic structure-re-check loop for the remainder of the test. This is intentional: a mid-test re-check could silently un-form the structure and invalidate subsequent assertions. -
forceStructureCheck
public boolean forceStructureCheck()Forces the controller to runMTEMultiBlockBase.checkStructure(boolean, IGregTechTileEntity)withforceReset = true, then returns whether it reports formed.Use this after mutating a placed template when you need to invalidate a stale
mMachine=trueflag. -
checkStructure
public boolean checkStructure(boolean forceReset) Runs the controller's structure check and returns whether it reports formed afterward.Passing
forceReset = trueclears and rebuilds hatch lists even when the controller currently reports formed. Passingfalsemirrors GregTech's normal "only if changed" behavior. -
assertNotFormed
public void assertNotFormed()Forces a structure check and fails if the controller reports formed afterward. -
assertNotFormed
Forces a structure check and fails withmessageif the controller reports formed afterward. -
assertNeverForms
public void assertNeverForms()Negative invariant helper for invalid templates. Asserts unformed immediately, then on every game-test tick, and marks the test successful at timeout.Pair this with a finite
@GameTest(timeoutTicks = ...). -
assertNeverForms
Negative invariant helper for invalid templates. Asserts unformed immediately, then on every game-test tick, and marks the test successful at timeout.Pair this with a finite
@GameTest(timeoutTicks = ...). -
isFormed
public boolean isFormed()Whether the controller reports a formed structure. -
fixMaintenance
public void fixMaintenance()MTEMultiBlockBase.fixAllIssues()thenMTEMultiBlockBase.enableWorking(). -
inputBus
Input bus by index inMTEMultiBlockBase.mInputBusses.- Throws:
IndexOutOfBoundsException- ifindexis not in rangeGameTestAssertException- if the resolved hatch is anMTEHatchCraftingInputME(ME crafting buffer); useinputs()to iterate non-ME input buses instead
-
outputBus
Output bus by index inMTEMultiBlockBase.mOutputBusses.- Throws:
IndexOutOfBoundsException- ifindexis not in range
-
inputs
All input buses fromMTEMultiBlockBase.mInputBusses, skipping invalid tiles andMTEHatchCraftingInputME. -
outputs
All output buses fromMTEMultiBlockBase.mOutputBussesthat are valid. -
energyHatch
Energy hatch by index inMTEMultiBlockBase.mEnergyHatches. Controllers that route power only through other hatch lists needGTNHGameTestHelper.supplyEU(com.gtnewhorizons.horizonqa.api.TestPos, long, long, int)at known coordinates instead.- Throws:
IndexOutOfBoundsException- ifindexis not in range
-
inputHatch
Fluid input hatch by index inMTEMultiBlockBase.mInputHatches. SupportsMTEHatchMultiInput(multi-slot hatches).- Throws:
IndexOutOfBoundsException- ifindexis not in rangeGameTestAssertException- if the resolved hatch is anMTEHatchInputME(virtual ME fluid hatch) orMTEHatchInputDebug; neither is fillable in the normal sense. ME fluid hatches are not supported in v0.1.
-
outputHatch
Fluid output hatch by index in the multiblock's canonical output-hatch ordering. For most multiblocks this isMTEMultiBlockBase.mOutputHatches; the Distillation Tower routes through its per-layer list instead (thei-th call returns a hatch on layeri, matching recipe output slot order). Detection happens in the adapter.- Throws:
GameTestAssertException- ifindexis out of range or the hatch slot is empty
-
runRecipe
public void runRecipe()MTEMultiBlockBase.enableWorking()then time-warps until the machine starts processing and becomes idle again, with a default tick bound. -
runRecipe
public void runRecipe(int maxTicks) MTEMultiBlockBase.enableWorking()then time-warps until the machine starts processing and becomes idle again, or untilmaxTickssimulated ticks have elapsed.Uses a two-phase stop condition: first waits for the machine to become active (recipe found and started), then waits for it to return to idle (recipe completed). This avoids the false-idle problem where the machine hasn't yet picked up a recipe on the first tick.
- Throws:
GameTestAssertException- if the machine never starts processing withinmaxTicks, or if it is still active at timeout
-
assertNoExplosion
public void assertNoExplosion()Fails if the controller block is no longer a GregTech tile entity. -
progress
public int progress()Current progress ticks for the active recipe, or zero when idle. -
isProcessing
public boolean isProcessing()Whether the controller is in the middle of a recipe cycle. -
getEfficiency
public int getEfficiency()- Returns:
- Current cleanness of this cleanroom. Max at 10,000
-