Record Class GameTestOptions
java.lang.Object
java.lang.Record
net.ixdarklord.coolcatcore.api.gametest.GameTestOptions
- Record Components:
structure- the structure the test is built in, from a data pack (data/<ns>/structure/...);PLATFORMis an empty 8 × 6 × 8 space on a stone floormaxTicks- how long the test may run before it failssetupTicks- ticks to wait after building the structure, before the test startsrequired- whether its failing fails the run (an optional test's failure is only reported)rotation- how the structure, and the test's positions with it, are turnedmanualOnly- only run when asked for by name (/test run), not with all the othersmaxAttempts- how many times it may be triedrequiredSuccesses- how many of those tries must passskyAccess- whether the structure is built with open sky above it rather than in a closed spacepadding- extra space left around the structure, 0 to 128 blocks; on this version the game lays tests out on its own grid, so this changes nothingbatch- the batch the test runs in, with the tests of the same batch, or null for its mod's (the namespace of its id)
public record GameTestOptions(net.minecraft.resources.ResourceLocation structure, int maxTicks, int setupTicks, boolean required, net.minecraft.world.level.block.Rotation rotation, boolean manualOnly, int maxAttempts, int requiredSuccesses, boolean skyAccess, int padding, @Nullable String batch)
extends Record
How a game test runs.
DEFAULT is what most tests want; change what you need with the with methods:
GameTestOptions.DEFAULT.withStructure(MyMod.id("gametest/furnace_room")).withMaxTicks(200)
There are no test environments on this version (newer versions have an environment option, for game rules,
weather and time); set those up in the test itself. Tests run in batches instead, one per mod unless
withBatch(String) says otherwise.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final GameTestOptionsstatic final net.minecraft.resources.ResourceLocationCoolCatLib's own test structure: an empty 8 × 6 × 8 space on a stone floor. -
Constructor Summary
ConstructorsConstructorDescriptionGameTestOptions(net.minecraft.resources.ResourceLocation structure, int maxTicks, int setupTicks, boolean required, net.minecraft.world.level.block.Rotation rotation, boolean manualOnly, int maxAttempts, int requiredSuccesses, boolean skyAccess, int padding, @Nullable String batch) Creates an instance of aGameTestOptionsrecord class. -
Method Summary
Modifier and TypeMethodDescription@Nullable Stringbatch()Returns the value of thebatchrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns the value of themanualOnlyrecord component.intReturns the value of themaxAttemptsrecord component.intmaxTicks()Returns the value of themaxTicksrecord component.static GameTestOptionsThe options an annotated method asks for.optional()intpadding()Returns the value of thepaddingrecord component.booleanrequired()Returns the value of therequiredrecord component.intReturns the value of therequiredSuccessesrecord component.net.minecraft.world.level.block.Rotationrotation()Returns the value of therotationrecord component.intReturns the value of thesetupTicksrecord component.booleanReturns the value of theskyAccessrecord component.net.minecraft.resources.ResourceLocationReturns the value of thestructurerecord component.final StringtoString()Returns a string representation of this record class.withAttempts(int maxAttempts, int requiredSuccesses) Tried up tomaxAttemptstimes; passes oncerequiredSuccessestries have.Runs in this batch, with the other tests of the same batch.withMaxTicks(int maxTicks) withPadding(int padding) withRotation(net.minecraft.world.level.block.Rotation rotation) withSetupTicks(int setupTicks) withStructure(net.minecraft.resources.ResourceLocation structure)
-
Field Details
-
PLATFORM
public static final net.minecraft.resources.ResourceLocation PLATFORMCoolCatLib's own test structure: an empty 8 × 6 × 8 space on a stone floor. -
DEFAULT
-
-
Constructor Details
-
GameTestOptions
public GameTestOptions(net.minecraft.resources.ResourceLocation structure, int maxTicks, int setupTicks, boolean required, net.minecraft.world.level.block.Rotation rotation, boolean manualOnly, int maxAttempts, int requiredSuccesses, boolean skyAccess, int padding, @Nullable @Nullable String batch) Creates an instance of aGameTestOptionsrecord class.- Parameters:
structure- the value for thestructurerecord componentmaxTicks- the value for themaxTicksrecord componentsetupTicks- the value for thesetupTicksrecord componentrequired- the value for therequiredrecord componentrotation- the value for therotationrecord componentmanualOnly- the value for themanualOnlyrecord componentmaxAttempts- the value for themaxAttemptsrecord componentrequiredSuccesses- the value for therequiredSuccessesrecord componentskyAccess- the value for theskyAccessrecord componentpadding- the value for thepaddingrecord componentbatch- the value for thebatchrecord component
-
-
Method Details
-
withStructure
-
withMaxTicks
-
withSetupTicks
-
optional
-
withRotation
-
asManualOnly
-
withAttempts
Tried up tomaxAttemptstimes; passes oncerequiredSuccessestries have. For flaky tests. -
withSkyAccess
-
withPadding
-
withBatch
Runs in this batch, with the other tests of the same batch. The tests of a batch are built and run together, and a batch starts once the one before it has finished. -
of
The options an annotated method asks for. -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
structure
public net.minecraft.resources.ResourceLocation structure()Returns the value of thestructurerecord component.- Returns:
- the value of the
structurerecord component
-
maxTicks
public int maxTicks()Returns the value of themaxTicksrecord component.- Returns:
- the value of the
maxTicksrecord component
-
setupTicks
public int setupTicks()Returns the value of thesetupTicksrecord component.- Returns:
- the value of the
setupTicksrecord component
-
required
public boolean required()Returns the value of therequiredrecord component.- Returns:
- the value of the
requiredrecord component
-
rotation
public net.minecraft.world.level.block.Rotation rotation()Returns the value of therotationrecord component.- Returns:
- the value of the
rotationrecord component
-
manualOnly
public boolean manualOnly()Returns the value of themanualOnlyrecord component.- Returns:
- the value of the
manualOnlyrecord component
-
maxAttempts
public int maxAttempts()Returns the value of themaxAttemptsrecord component.- Returns:
- the value of the
maxAttemptsrecord component
-
requiredSuccesses
public int requiredSuccesses()Returns the value of therequiredSuccessesrecord component.- Returns:
- the value of the
requiredSuccessesrecord component
-
skyAccess
public boolean skyAccess()Returns the value of theskyAccessrecord component.- Returns:
- the value of the
skyAccessrecord component
-
padding
public int padding()Returns the value of thepaddingrecord component.- Returns:
- the value of the
paddingrecord component
-
batch
Returns the value of thebatchrecord component.- Returns:
- the value of the
batchrecord component
-