Package net.minecraft.world.level
Class NaturalSpawner
java.lang.Object
net.minecraft.world.level.NaturalSpawner
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
static interface
static interface
static class
-
Field Summary
Modifier and TypeFieldDescriptionprivate static org.apache.logging.log4j.Logger
(package private) static int
private static int
static int
static int
private static MobCategory[]
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
canSpawnAtBody(SpawnPlacements.Type p_47052_, LevelReader p_47053_, BlockPos p_47054_, EntityType<?> p_47055_)
private static boolean
canSpawnMobAt(ServerLevel p_47004_, StructureFeatureManager p_47005_, ChunkGenerator p_47006_, MobCategory p_47007_, MobSpawnSettings.SpawnerData p_47008_, BlockPos p_47009_)
static NaturalSpawner.SpawnState
createState(int p_46985_, Iterable<Entity> p_46986_, NaturalSpawner.ChunkGetter p_46987_)
private static Mob
getMobForSpawn(ServerLevel p_46989_, EntityType<?> p_46990_)
private static BlockPos
getRandomPosWithin(Level p_47063_, LevelChunk p_47064_)
private static Optional<MobSpawnSettings.SpawnerData>
getRandomSpawnMobAt(ServerLevel p_151599_, StructureFeatureManager p_151600_, ChunkGenerator p_151601_, MobCategory p_151602_, Random p_151603_, BlockPos p_151604_)
(package private) static Biome
getRoughBiome(BlockPos p_47096_, ChunkAccess p_47097_)
private static BlockPos
getTopNonCollidingPos(LevelReader p_47066_, EntityType<?> p_47067_, int p_47068_, int p_47069_)
private static boolean
isRightDistanceToPlayerAndSpawnPoint(ServerLevel p_47025_, ChunkAccess p_47026_, BlockPos.MutableBlockPos p_47027_, double p_47028_)
static boolean
isSpawnPositionOk(SpawnPlacements.Type p_47052_, LevelReader p_47053_, BlockPos p_47054_, EntityType<?> p_47055_)
static boolean
isValidEmptySpawnBlock(BlockGetter p_47057_, BlockPos p_47058_, BlockState p_47059_, FluidState p_47060_, EntityType<?> p_47061_)
private static boolean
isValidPositionForMob(ServerLevel p_46992_, Mob p_46993_, double p_46994_)
private static boolean
isValidSpawnPostitionForType(ServerLevel p_46996_, MobCategory p_46997_, StructureFeatureManager p_46998_, ChunkGenerator p_46999_, MobSpawnSettings.SpawnerData p_47000_, BlockPos.MutableBlockPos p_47001_, double p_47002_)
private static WeightedRandomList<MobSpawnSettings.SpawnerData>
mobsAt(ServerLevel p_151592_, StructureFeatureManager p_151593_, ChunkGenerator p_151594_, MobCategory p_151595_, BlockPos p_151596_, Biome p_151597_)
static void
spawnCategoryForChunk(MobCategory p_47046_, ServerLevel p_47047_, LevelChunk p_47048_, NaturalSpawner.SpawnPredicate p_47049_, NaturalSpawner.AfterSpawnCallback p_47050_)
static void
spawnCategoryForPosition(MobCategory p_151613_, ServerLevel p_151614_, BlockPos p_151615_)
static void
spawnCategoryForPosition(MobCategory p_47039_, ServerLevel p_47040_, ChunkAccess p_47041_, BlockPos p_47042_, NaturalSpawner.SpawnPredicate p_47043_, NaturalSpawner.AfterSpawnCallback p_47044_)
static void
spawnForChunk(ServerLevel p_47030_, LevelChunk p_47031_, NaturalSpawner.SpawnState p_47032_, boolean p_47033_, boolean p_47034_, boolean p_47035_)
static void
spawnMobsForChunkGeneration(ServerLevelAccessor p_151617_, Biome p_151618_, ChunkPos p_151619_, Random p_151620_)
-
Field Details
-
LOGGER
private static final org.apache.logging.log4j.Logger LOGGER -
MIN_SPAWN_DISTANCE
private static final int MIN_SPAWN_DISTANCE- See Also:
- Constant Field Values
-
SPAWN_DISTANCE_CHUNK
public static final int SPAWN_DISTANCE_CHUNK- See Also:
- Constant Field Values
-
SPAWN_DISTANCE_BLOCK
public static final int SPAWN_DISTANCE_BLOCK- See Also:
- Constant Field Values
-
MAGIC_NUMBER
static final int MAGIC_NUMBER -
SPAWNING_CATEGORIES
-
-
Constructor Details
-
NaturalSpawner
private NaturalSpawner()
-
-
Method Details
-
createState
public static NaturalSpawner.SpawnState createState(int p_46985_, Iterable<Entity> p_46986_, NaturalSpawner.ChunkGetter p_46987_) -
getRoughBiome
-
spawnForChunk
public static void spawnForChunk(ServerLevel p_47030_, LevelChunk p_47031_, NaturalSpawner.SpawnState p_47032_, boolean p_47033_, boolean p_47034_, boolean p_47035_) -
spawnCategoryForChunk
public static void spawnCategoryForChunk(MobCategory p_47046_, ServerLevel p_47047_, LevelChunk p_47048_, NaturalSpawner.SpawnPredicate p_47049_, NaturalSpawner.AfterSpawnCallback p_47050_) -
spawnCategoryForPosition
public static void spawnCategoryForPosition(MobCategory p_151613_, ServerLevel p_151614_, BlockPos p_151615_) -
spawnCategoryForPosition
public static void spawnCategoryForPosition(MobCategory p_47039_, ServerLevel p_47040_, ChunkAccess p_47041_, BlockPos p_47042_, NaturalSpawner.SpawnPredicate p_47043_, NaturalSpawner.AfterSpawnCallback p_47044_) -
isRightDistanceToPlayerAndSpawnPoint
private static boolean isRightDistanceToPlayerAndSpawnPoint(ServerLevel p_47025_, ChunkAccess p_47026_, BlockPos.MutableBlockPos p_47027_, double p_47028_) -
isValidSpawnPostitionForType
private static boolean isValidSpawnPostitionForType(ServerLevel p_46996_, MobCategory p_46997_, StructureFeatureManager p_46998_, ChunkGenerator p_46999_, MobSpawnSettings.SpawnerData p_47000_, BlockPos.MutableBlockPos p_47001_, double p_47002_) -
getMobForSpawn
-
isValidPositionForMob
-
getRandomSpawnMobAt
private static Optional<MobSpawnSettings.SpawnerData> getRandomSpawnMobAt(ServerLevel p_151599_, StructureFeatureManager p_151600_, ChunkGenerator p_151601_, MobCategory p_151602_, Random p_151603_, BlockPos p_151604_) -
canSpawnMobAt
private static boolean canSpawnMobAt(ServerLevel p_47004_, StructureFeatureManager p_47005_, ChunkGenerator p_47006_, MobCategory p_47007_, MobSpawnSettings.SpawnerData p_47008_, BlockPos p_47009_) -
mobsAt
private static WeightedRandomList<MobSpawnSettings.SpawnerData> mobsAt(ServerLevel p_151592_, StructureFeatureManager p_151593_, ChunkGenerator p_151594_, MobCategory p_151595_, BlockPos p_151596_, @Nullable Biome p_151597_) -
getRandomPosWithin
-
isValidEmptySpawnBlock
public static boolean isValidEmptySpawnBlock(BlockGetter p_47057_, BlockPos p_47058_, BlockState p_47059_, FluidState p_47060_, EntityType<?> p_47061_) -
isSpawnPositionOk
public static boolean isSpawnPositionOk(SpawnPlacements.Type p_47052_, LevelReader p_47053_, BlockPos p_47054_, @Nullable EntityType<?> p_47055_) -
canSpawnAtBody
public static boolean canSpawnAtBody(SpawnPlacements.Type p_47052_, LevelReader p_47053_, BlockPos p_47054_, @Nullable EntityType<?> p_47055_) -
spawnMobsForChunkGeneration
public static void spawnMobsForChunkGeneration(ServerLevelAccessor p_151617_, Biome p_151618_, ChunkPos p_151619_, Random p_151620_) -
getTopNonCollidingPos
private static BlockPos getTopNonCollidingPos(LevelReader p_47066_, EntityType<?> p_47067_, int p_47068_, int p_47069_)
-