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 final org.slf4j.Logger
(package private) static final int
private static final int
static final int
static final int
private static final 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_220437_, StructureManager p_220438_, ChunkGenerator p_220439_, MobCategory p_220440_, MobSpawnSettings.SpawnerData p_220441_, BlockPos p_220442_) static NaturalSpawner.SpawnState
createState
(int p_186525_, Iterable<Entity> p_186526_, NaturalSpawner.ChunkGetter p_186527_, LocalMobCapCalculator p_186528_) 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_220430_, StructureManager p_220431_, ChunkGenerator p_220432_, MobCategory p_220433_, RandomSource p_220434_, BlockPos p_220435_) (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_) static boolean
isInNetherFortressBounds
(BlockPos p_220456_, ServerLevel p_220457_, MobCategory p_220458_, StructureManager p_220459_) 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_220422_, MobCategory p_220423_, StructureManager p_220424_, ChunkGenerator p_220425_, MobSpawnSettings.SpawnerData p_220426_, BlockPos.MutableBlockPos p_220427_, double p_220428_) private static WeightedRandomList<MobSpawnSettings.SpawnerData>
mobsAt
(ServerLevel p_220444_, StructureManager p_220445_, ChunkGenerator p_220446_, MobCategory p_220447_, BlockPos p_220448_, Holder<Biome> p_220449_) 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_220451_, Holder<Biome> p_220452_, ChunkPos p_220453_, RandomSource p_220454_)
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
MIN_SPAWN_DISTANCE
private static final int MIN_SPAWN_DISTANCE- See Also:
-
SPAWN_DISTANCE_CHUNK
public static final int SPAWN_DISTANCE_CHUNK- See Also:
-
SPAWN_DISTANCE_BLOCK
public static final int SPAWN_DISTANCE_BLOCK- See Also:
-
MAGIC_NUMBER
static final int MAGIC_NUMBER -
SPAWNING_CATEGORIES
-
-
Constructor Details
-
NaturalSpawner
private NaturalSpawner()
-
-
Method Details
-
createState
public static NaturalSpawner.SpawnState createState(int p_186525_, Iterable<Entity> p_186526_, NaturalSpawner.ChunkGetter p_186527_, LocalMobCapCalculator p_186528_) -
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_220422_, MobCategory p_220423_, StructureManager p_220424_, ChunkGenerator p_220425_, MobSpawnSettings.SpawnerData p_220426_, BlockPos.MutableBlockPos p_220427_, double p_220428_) -
getMobForSpawn
-
isValidPositionForMob
-
getRandomSpawnMobAt
private static Optional<MobSpawnSettings.SpawnerData> getRandomSpawnMobAt(ServerLevel p_220430_, StructureManager p_220431_, ChunkGenerator p_220432_, MobCategory p_220433_, RandomSource p_220434_, BlockPos p_220435_) -
canSpawnMobAt
private static boolean canSpawnMobAt(ServerLevel p_220437_, StructureManager p_220438_, ChunkGenerator p_220439_, MobCategory p_220440_, MobSpawnSettings.SpawnerData p_220441_, BlockPos p_220442_) -
mobsAt
private static WeightedRandomList<MobSpawnSettings.SpawnerData> mobsAt(ServerLevel p_220444_, StructureManager p_220445_, ChunkGenerator p_220446_, MobCategory p_220447_, BlockPos p_220448_, @Nullable Holder<Biome> p_220449_) -
isInNetherFortressBounds
public static boolean isInNetherFortressBounds(BlockPos p_220456_, ServerLevel p_220457_, MobCategory p_220458_, StructureManager p_220459_) -
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_220451_, Holder<Biome> p_220452_, ChunkPos p_220453_, RandomSource p_220454_) -
getTopNonCollidingPos
private static BlockPos getTopNonCollidingPos(LevelReader p_47066_, EntityType<?> p_47067_, int p_47068_, int p_47069_)
-