Class GST
java.lang.Object
com.binaris.wizardry.core.gametest.GST
Why this is called GST...?
General GameTest utility methods.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidassertEmpty(net.minecraft.gametest.framework.GameTestHelper helper, String message, net.minecraft.world.item.ItemStack stack) Asserts that the given ItemStack is empty, failing the test with the given message if it is not.static <T> voidassertEquals(net.minecraft.gametest.framework.GameTestHelper helper, String message, T expected, T actual) Asserts that the expected and actual values are equal, failing the test with the given message if they are not.static voidassertFalse(net.minecraft.gametest.framework.GameTestHelper helper, String message, boolean condition) Asserts that the given condition is false, failing the test with the given message if it is true.static voidassertIndexEquals(net.minecraft.gametest.framework.GameTestHelper helper, net.minecraft.world.item.ItemStack wand, int expected, String action) Asserts that the currently selected spell index in the given wand is equal to the expected index, failing the test with a message that includes the given action description if they are not.static voidassertNotEmpty(net.minecraft.gametest.framework.GameTestHelper helper, String message, net.minecraft.world.item.ItemStack stack) Asserts that the given ItemStack is not empty, failing the test with the given message if it is.static voidassertNotNull(net.minecraft.gametest.framework.GameTestHelper helper, String message, Object object) Asserts that the given object is not null, failing the test with the given message if it is.static voidassertNull(net.minecraft.gametest.framework.GameTestHelper helper, String message, Object object) Asserts that the given object is null, failing the test with the given message if it is not.static voidassertSpellEquals(net.minecraft.gametest.framework.GameTestHelper helper, net.minecraft.world.item.ItemStack wand, Spell expected, String action) Asserts that the currently selected spell in the given wand is equal to the expected spell, failing the test with a message that includes the given action description if they are not.static voidassertTrue(net.minecraft.gametest.framework.GameTestHelper helper, String message, boolean condition) Asserts that the given condition is true, failing the test with the given message if it is false.static net.minecraft.world.damagesource.DamageSourcecreateDamageSource(net.minecraft.world.entity.player.Player player, net.minecraft.resources.ResourceKey<net.minecraft.world.damagesource.DamageType> key) Creates a DamageSource with the given player as the source and the given damage type.static net.minecraft.world.entity.EntitymockEntity(net.minecraft.gametest.framework.GameTestHelper helper, net.minecraft.world.phys.Vec3 playerPos, net.minecraft.world.entity.EntityType<?> type) Spawns an entity of the given type at the given position in the GameTest world.static net.minecraft.world.entity.player.PlayermockPlayer(net.minecraft.gametest.framework.GameTestHelper helper, net.minecraft.world.phys.Vec3 position) static net.minecraft.world.entity.player.PlayermockPlayerWithArmor(net.minecraft.gametest.framework.GameTestHelper helper, net.minecraft.world.phys.Vec3 position, Element element, WizardArmorType type) static voidplaceBlock(net.minecraft.gametest.framework.GameTestHelper helper, net.minecraft.world.phys.Vec3 blockPos, net.minecraft.world.level.block.Block block) Places a block at the given position in the GameTest world.
-
Method Details
-
mockPlayer
public static net.minecraft.world.entity.player.Player mockPlayer(net.minecraft.gametest.framework.GameTestHelper helper, net.minecraft.world.phys.Vec3 position) -
mockPlayerWithArmor
public static net.minecraft.world.entity.player.Player mockPlayerWithArmor(net.minecraft.gametest.framework.GameTestHelper helper, net.minecraft.world.phys.Vec3 position, Element element, WizardArmorType type) -
assertTrue
public static void assertTrue(net.minecraft.gametest.framework.GameTestHelper helper, String message, boolean condition) Asserts that the given condition is true, failing the test with the given message if it is false. -
assertFalse
public static void assertFalse(net.minecraft.gametest.framework.GameTestHelper helper, String message, boolean condition) Asserts that the given condition is false, failing the test with the given message if it is true. -
assertNotNull
public static void assertNotNull(net.minecraft.gametest.framework.GameTestHelper helper, String message, Object object) Asserts that the given object is not null, failing the test with the given message if it is. -
assertNull
public static void assertNull(net.minecraft.gametest.framework.GameTestHelper helper, String message, Object object) Asserts that the given object is null, failing the test with the given message if it is not. -
assertEquals
public static <T> void assertEquals(net.minecraft.gametest.framework.GameTestHelper helper, String message, T expected, T actual) Asserts that the expected and actual values are equal, failing the test with the given message if they are not. -
assertEmpty
public static void assertEmpty(net.minecraft.gametest.framework.GameTestHelper helper, String message, net.minecraft.world.item.ItemStack stack) Asserts that the given ItemStack is empty, failing the test with the given message if it is not. -
assertNotEmpty
public static void assertNotEmpty(net.minecraft.gametest.framework.GameTestHelper helper, String message, net.minecraft.world.item.ItemStack stack) Asserts that the given ItemStack is not empty, failing the test with the given message if it is. -
placeBlock
public static void placeBlock(net.minecraft.gametest.framework.GameTestHelper helper, net.minecraft.world.phys.Vec3 blockPos, net.minecraft.world.level.block.Block block) Places a block at the given position in the GameTest world. -
mockEntity
public static net.minecraft.world.entity.Entity mockEntity(net.minecraft.gametest.framework.GameTestHelper helper, net.minecraft.world.phys.Vec3 playerPos, net.minecraft.world.entity.EntityType<?> type) Spawns an entity of the given type at the given position in the GameTest world. -
createDamageSource
public static net.minecraft.world.damagesource.DamageSource createDamageSource(net.minecraft.world.entity.player.Player player, net.minecraft.resources.ResourceKey<net.minecraft.world.damagesource.DamageType> key) Creates a DamageSource with the given player as the source and the given damage type. -
assertSpellEquals
public static void assertSpellEquals(net.minecraft.gametest.framework.GameTestHelper helper, net.minecraft.world.item.ItemStack wand, Spell expected, String action) Asserts that the currently selected spell in the given wand is equal to the expected spell, failing the test with a message that includes the given action description if they are not. -
assertIndexEquals
public static void assertIndexEquals(net.minecraft.gametest.framework.GameTestHelper helper, net.minecraft.world.item.ItemStack wand, int expected, String action) Asserts that the currently selected spell index in the given wand is equal to the expected index, failing the test with a message that includes the given action description if they are not.
-