package net.minecraft.gametest.framework; import java.util.function.Consumer; import net.minecraft.world.level.block.Rotation; public record TestFunction( String batchName, String testName, String structureName, Rotation rotation, int maxTicks, long setupTicks, boolean required, boolean manualOnly, int maxAttempts, int requiredSuccesses, boolean skyAccess, Consumer function ) { public TestFunction( String batchName, String testName, String structureName, int maxTicks, long setupTicks, boolean required, Consumer function ) { this(batchName, testName, structureName, Rotation.NONE, maxTicks, setupTicks, required, false, 1, 1, false, function); } public TestFunction( String batchName, String testName, String structureName, Rotation rotation, int maxTicks, long setupTicks, boolean required, Consumer function ) { this(batchName, testName, structureName, rotation, maxTicks, setupTicks, required, false, 1, 1, false, function); } public void run(GameTestHelper gameTestHelper) { this.function.accept(gameTestHelper); } public String toString() { return this.testName; } public boolean isFlaky() { return this.maxAttempts > 1; } }