Package net.minecraft.gametest.framework
Class GameTestHelper
java.lang.Object
net.minecraft.gametest.framework.GameTestHelper
- Direct Known Subclasses:
ExtendedGameTestHelper
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabsolutePos
(BlockPos p_177450_) absoluteVec
(Vec3 p_177228_) void
assertAtTickTimeContainerContains
(long p_177124_, BlockPos p_177125_, Item p_177126_) void
assertAtTickTimeContainerEmpty
(long p_177121_, BlockPos p_177122_) void
assertBlock
(BlockPos p_177272_, Predicate<Block> p_177273_, String p_177274_) void
<T extends BlockEntity>
voidassertBlockEntityData
(BlockPos p_348547_, Predicate<T> p_348669_, Supplier<String> p_348486_) void
assertBlockNotPresent
(Block p_177337_, int p_177338_, int p_177339_, int p_177340_) void
assertBlockNotPresent
(Block p_177342_, BlockPos p_177343_) void
assertBlockPresent
(Block p_177204_, int p_177205_, int p_177206_, int p_177207_) void
assertBlockPresent
(Block p_177209_, BlockPos p_177210_) <T extends Comparable<T>>
voidassertBlockProperty
(BlockPos p_177260_, Property<T> p_177261_, Predicate<T> p_177262_, String p_177263_) <T extends Comparable<T>>
voidassertBlockProperty
(BlockPos p_177256_, Property<T> p_177257_, T p_177258_) void
assertBlockState
(BlockPos p_177358_, Predicate<BlockState> p_177359_, Supplier<String> p_177360_) void
assertContainerContains
(BlockPos p_177243_, Item p_177244_) void
assertContainerEmpty
(BlockPos p_177441_) void
assertEntitiesPresent
(EntityType<?> p_312835_, int p_312735_) void
assertEntitiesPresent
(EntityType<?> p_239372_, BlockPos p_239373_, int p_239374_, double p_239375_) <E extends Entity,
T>
voidassertEntityData
(BlockPos p_177238_, EntityType<E> p_177239_, Function<? super E, T> p_177240_, T p_177241_) void
assertEntityInstancePresent
(Entity p_177133_, int p_177134_, int p_177135_, int p_177136_) void
assertEntityInstancePresent
(Entity p_177141_, BlockPos p_177142_) <E extends Entity & InventoryCarrier>
voidassertEntityInventoryContains
(BlockPos p_263495_, EntityType<E> p_263521_, Item p_263502_) <E extends LivingEntity>
voidassertEntityIsHolding
(BlockPos p_263501_, EntityType<E> p_263510_, Item p_263517_) void
assertEntityNotPresent
(EntityType<?> p_177310_) void
assertEntityNotPresent
(EntityType<?> p_177398_, int p_177399_, int p_177400_, int p_177401_) void
assertEntityNotPresent
(EntityType<?> p_177403_, BlockPos p_177404_) void
assertEntityNotPresent
(EntityType<?> p_341944_, Vec3 p_341926_, Vec3 p_341919_) void
assertEntityNotTouching
(EntityType<?> p_177312_, double p_177313_, double p_177314_, double p_177315_) void
assertEntityPosition
(Entity p_353077_, AABB p_353054_, String p_353075_) void
assertEntityPresent
(EntityType<?> p_177157_) void
assertEntityPresent
(EntityType<?> p_177370_, int p_177371_, int p_177372_, int p_177373_) void
assertEntityPresent
(EntityType<?> p_177375_, BlockPos p_177376_) void
assertEntityPresent
(EntityType<?> p_177180_, BlockPos p_177181_, double p_177182_) void
assertEntityPresent
(EntityType<?> p_252010_, Vec3 p_249488_, Vec3 p_251186_) <E extends Entity,
T>
voidassertEntityProperty
(E p_177148_, Function<E, T> p_177149_, String p_177150_, T p_177151_) <E extends Entity>
voidassertEntityProperty
(E p_177153_, Predicate<E> p_177154_, String p_177155_) void
assertEntityTouching
(EntityType<?> p_177159_, double p_177160_, double p_177161_, double p_177162_) void
assertFalse
(boolean p_277974_, String p_277933_) void
assertItemEntityCountIs
(Item p_177199_, BlockPos p_177200_, double p_177201_, int p_177202_) void
assertItemEntityNotPresent
(Item p_304474_) void
assertItemEntityNotPresent
(Item p_236779_, BlockPos p_236780_, double p_236781_) void
assertItemEntityPresent
(Item p_304857_) void
assertItemEntityPresent
(Item p_177195_, BlockPos p_177196_, double p_177197_) void
assertLivingEntityHasMobEffect
(LivingEntity p_296040_, Holder<MobEffect> p_316528_, int p_294266_) void
assertRedstoneSignal
(BlockPos p_289644_, Direction p_289642_, IntPredicate p_289645_, Supplier<String> p_289684_) void
assertSameBlockState
(BlockPos p_177269_, BlockPos p_177270_) void
assertSameBlockStates
(BoundingBox p_177225_, BlockPos p_177226_) void
assertTrue
(boolean p_249380_, String p_248720_) <N> void
assertValueEqual
(N p_324013_, N p_323869_, String p_321732_) void
destroyBlock
(BlockPos p_177435_) private void
void
void
void
void
void
failIfEver
(Runnable p_177411_) <E extends Entity>
EfindClosestEntity
(EntityType<E> p_320915_, int p_320152_, int p_319868_, int p_319912_, double p_320874_) findEntities
(EntityType<E> p_320065_, int p_320533_, int p_320279_, int p_320721_, double p_320280_) findEntities
(EntityType<E> p_320878_, Vec3 p_320734_, double p_320825_) <E extends Entity>
EfindOneEntity
(EntityType<E> p_320756_) void
forEveryBlockInStructure
(Consumer<BlockPos> p_177293_) <T extends BlockEntity>
TgetBlockEntity
(BlockPos p_177348_) getBlockState
(BlockPos p_177233_) getEntities
(EntityType<T> p_320029_) getEntities
(EntityType<T> p_238400_, BlockPos p_238401_, double p_238402_) int
getHeight
(Heightmap.Types p_236775_, int p_236776_, int p_236777_) getLevel()
private AABB
long
getTick()
void
void
killAllEntitiesOfClass
(Class p_289538_) makeAboutToDrown
(LivingEntity p_177184_) makeMockPlayer
(GameType p_323908_) Deprecated, for removal: This API element is subject to removal in a future version.void
void
onEachTick
(Runnable p_177424_) void
void
pressButton
(int p_177104_, int p_177105_, int p_177106_) void
pressButton
(BlockPos p_177386_) void
pullLever
(int p_177303_, int p_177304_, int p_177305_) void
void
pulseRedstone
(BlockPos p_177235_, long p_177236_) void
randomTick
(BlockPos p_177447_) relativePos
(BlockPos p_177453_) relativeVec
(Vec3 p_251543_) void
runAfterDelay
(long p_177307_, Runnable p_177308_) void
runAtTickTime
(long p_177128_, Runnable p_177129_) void
setBiome
(ResourceKey<Biome> p_313921_) void
void
setBlock
(int p_177113_, int p_177114_, int p_177115_, BlockState p_177116_) void
void
setBlock
(BlockPos p_177253_, BlockState p_177254_) void
setDayTime
(int p_177102_) void
setNight()
<E extends Entity>
Espawn
(EntityType<E> p_177164_, float p_177165_, float p_177166_, float p_177167_) <E extends Entity>
Espawn
(EntityType<E> p_177169_, int p_177170_, int p_177171_, int p_177172_) <E extends Entity>
Espawn
(EntityType<E> p_177177_, BlockPos p_177178_) <E extends Entity>
Espawn
(EntityType<E> p_177174_, Vec3 p_177175_) <E extends Mob>
EspawnWithNoFreeWill
(EntityType<E> p_177317_, float p_177318_, float p_177319_, float p_177320_) <E extends Mob>
EspawnWithNoFreeWill
(EntityType<E> p_177322_, int p_177323_, int p_177324_, int p_177325_) <E extends Mob>
EspawnWithNoFreeWill
(EntityType<E> p_177330_, BlockPos p_177331_) <E extends Mob>
EspawnWithNoFreeWill
(EntityType<E> p_177327_, Vec3 p_177328_) void
succeed()
void
void
succeedOnTickWhen
(int p_177118_, Runnable p_177119_) void
succeedWhen
(Runnable p_177362_) void
succeedWhenBlockPresent
(Block p_177378_, int p_177379_, int p_177380_, int p_177381_) void
succeedWhenBlockPresent
(Block p_177383_, BlockPos p_177384_) <E extends Entity,
T>
voidsucceedWhenEntityData
(BlockPos p_177350_, EntityType<E> p_177351_, Function<E, T> p_177352_, T p_177353_) void
succeedWhenEntityNotPresent
(EntityType<?> p_177427_, int p_177428_, int p_177429_, int p_177430_) void
succeedWhenEntityNotPresent
(EntityType<?> p_177432_, BlockPos p_177433_) void
succeedWhenEntityPresent
(EntityType<?> p_177414_, int p_177415_, int p_177416_, int p_177417_) void
succeedWhenEntityPresent
(EntityType<?> p_177419_, BlockPos p_177420_) void
void
tickPrecipitation
(BlockPos p_313817_) void
void
void
useBlock
(BlockPos p_262023_, Player p_261901_, BlockHitResult p_262040_) withLowHealth
(LivingEntity p_286794_)
-
Field Details
-
testInfo
-
finalCheckAdded
private boolean finalCheckAdded
-
-
Constructor Details
-
GameTestHelper
-
-
Method Details
-
getLevel
-
getBlockState
-
getBlockEntity
-
killAllEntities
public void killAllEntities() -
killAllEntitiesOfClass
-
spawnItem
-
spawnItem
-
spawnItem
-
spawn
-
spawn
-
findOneEntity
-
findClosestEntity
public <E extends Entity> E findClosestEntity(EntityType<E> p_320915_, int p_320152_, int p_319868_, int p_319912_, double p_320874_) -
findEntities
public <E extends Entity> List<E> findEntities(EntityType<E> p_320065_, int p_320533_, int p_320279_, int p_320721_, double p_320280_) -
findEntities
public <E extends Entity> List<E> findEntities(EntityType<E> p_320878_, Vec3 p_320734_, double p_320825_) -
spawn
public <E extends Entity> E spawn(EntityType<E> p_177169_, int p_177170_, int p_177171_, int p_177172_) -
spawn
public <E extends Entity> E spawn(EntityType<E> p_177164_, float p_177165_, float p_177166_, float p_177167_) -
spawnWithNoFreeWill
-
spawnWithNoFreeWill
public <E extends Mob> E spawnWithNoFreeWill(EntityType<E> p_177322_, int p_177323_, int p_177324_, int p_177325_) -
spawnWithNoFreeWill
-
spawnWithNoFreeWill
public <E extends Mob> E spawnWithNoFreeWill(EntityType<E> p_177317_, float p_177318_, float p_177319_, float p_177320_) -
moveTo
-
walkTo
-
pressButton
public void pressButton(int p_177104_, int p_177105_, int p_177106_) -
pressButton
-
useBlock
-
useBlock
-
useBlock
-
makeAboutToDrown
-
withLowHealth
-
makeMockPlayer
-
makeMockServerPlayerInLevel
Deprecated, for removal: This API element is subject to removal in a future version. -
pullLever
public void pullLever(int p_177303_, int p_177304_, int p_177305_) -
pullLever
-
pulseRedstone
-
destroyBlock
-
setBlock
-
setBlock
-
setBlock
-
setBlock
-
setNight
public void setNight() -
setDayTime
public void setDayTime(int p_177102_) -
assertBlockPresent
-
assertBlockPresent
-
assertBlockNotPresent
-
assertBlockNotPresent
-
succeedWhenBlockPresent
-
succeedWhenBlockPresent
-
assertBlock
-
assertBlock
-
assertBlockProperty
public <T extends Comparable<T>> void assertBlockProperty(BlockPos p_177256_, Property<T> p_177257_, T p_177258_) -
assertBlockProperty
public <T extends Comparable<T>> void assertBlockProperty(BlockPos p_177260_, Property<T> p_177261_, Predicate<T> p_177262_, String p_177263_) -
assertBlockState
public void assertBlockState(BlockPos p_177358_, Predicate<BlockState> p_177359_, Supplier<String> p_177360_) -
assertBlockEntityData
public <T extends BlockEntity> void assertBlockEntityData(BlockPos p_348547_, Predicate<T> p_348669_, Supplier<String> p_348486_) -
assertRedstoneSignal
public void assertRedstoneSignal(BlockPos p_289644_, Direction p_289642_, IntPredicate p_289645_, Supplier<String> p_289684_) -
assertEntityPresent
-
assertEntityPresent
public void assertEntityPresent(EntityType<?> p_177370_, int p_177371_, int p_177372_, int p_177373_) -
assertEntityPresent
-
assertEntityPresent
-
assertEntitiesPresent
-
assertEntitiesPresent
public void assertEntitiesPresent(EntityType<?> p_239372_, BlockPos p_239373_, int p_239374_, double p_239375_) -
assertEntityPresent
-
getEntities
public <T extends Entity> List<T> getEntities(EntityType<T> p_238400_, BlockPos p_238401_, double p_238402_) -
getEntities
-
assertEntityInstancePresent
public void assertEntityInstancePresent(Entity p_177133_, int p_177134_, int p_177135_, int p_177136_) -
assertEntityInstancePresent
-
assertItemEntityCountIs
-
assertItemEntityPresent
-
assertItemEntityNotPresent
-
assertItemEntityPresent
-
assertItemEntityNotPresent
-
assertEntityNotPresent
-
assertEntityNotPresent
public void assertEntityNotPresent(EntityType<?> p_177398_, int p_177399_, int p_177400_, int p_177401_) -
assertEntityNotPresent
-
assertEntityNotPresent
-
assertEntityTouching
public void assertEntityTouching(EntityType<?> p_177159_, double p_177160_, double p_177161_, double p_177162_) -
assertEntityNotTouching
public void assertEntityNotTouching(EntityType<?> p_177312_, double p_177313_, double p_177314_, double p_177315_) -
assertEntityData
public <E extends Entity,T> void assertEntityData(BlockPos p_177238_, EntityType<E> p_177239_, Function<? super E, T> p_177240_, @Nullable T p_177241_) -
assertEntityIsHolding
public <E extends LivingEntity> void assertEntityIsHolding(BlockPos p_263501_, EntityType<E> p_263510_, Item p_263517_) -
assertEntityInventoryContains
public <E extends Entity & InventoryCarrier> void assertEntityInventoryContains(BlockPos p_263495_, EntityType<E> p_263521_, Item p_263502_) -
assertContainerEmpty
-
assertContainerContains
-
assertSameBlockStates
-
assertSameBlockState
-
assertAtTickTimeContainerContains
-
assertAtTickTimeContainerEmpty
-
succeedWhenEntityData
public <E extends Entity,T> void succeedWhenEntityData(BlockPos p_177350_, EntityType<E> p_177351_, Function<E, T> p_177352_, T p_177353_) -
assertEntityPosition
-
assertEntityProperty
-
assertEntityProperty
-
assertLivingEntityHasMobEffect
public void assertLivingEntityHasMobEffect(LivingEntity p_296040_, Holder<MobEffect> p_316528_, int p_294266_) -
succeedWhenEntityPresent
public void succeedWhenEntityPresent(EntityType<?> p_177414_, int p_177415_, int p_177416_, int p_177417_) -
succeedWhenEntityPresent
-
succeedWhenEntityNotPresent
public void succeedWhenEntityNotPresent(EntityType<?> p_177427_, int p_177428_, int p_177429_, int p_177430_) -
succeedWhenEntityNotPresent
-
succeed
public void succeed() -
ensureSingleFinalCheck
private void ensureSingleFinalCheck() -
succeedIf
-
succeedWhen
-
succeedOnTickWhen
-
runAtTickTime
-
runAfterDelay
-
randomTick
-
tickPrecipitation
-
tickPrecipitation
public void tickPrecipitation() -
getHeight
-
fail
-
fail
-
fail
-
failIf
-
failIfEver
-
startSequence
-
absolutePos
-
relativePos
-
absoluteVec
-
relativeVec
-
getTestRotation
-
assertTrue
-
assertValueEqual
-
assertFalse
-
getTick
public long getTick() -
getBounds
-
getRelativeBounds
-
forEveryBlockInStructure
-
onEachTick
-
placeAt
-
setBiome
-