Package net.minecraft.world
Class SpawnHelper
java.lang.Object
net.minecraft.world.SpawnHelper
public final class SpawnHelper extends Object
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceSpawnHelper.Checkerstatic interfaceSpawnHelper.ChunkSourcestatic classSpawnHelper.Infostatic interfaceSpawnHelper.Runner -
Field Summary
Fields Modifier and Type Field Description private static intCHUNK_AREAprivate static LoggerLOGGERprivate static SpawnGroup[]SPAWNABLE_GROUPS -
Constructor Summary
Constructors Constructor Description SpawnHelper() -
Method Summary
Modifier and Type Method Description static booleancanSpawn(SpawnRestriction.Location location, WorldView world, BlockPos pos, EntityType<?> entityType)private static booleancanSpawn(ServerWorld world, SpawnGroup group, StructureAccessor structureAccessor, ChunkGenerator chunkGenerator, SpawnSettings.SpawnEntry spawnEntry, BlockPos.Mutable pos, double squaredDistance)private static booleancontainsSpawnEntry(ServerWorld serverWorld, StructureAccessor structureAccessor, ChunkGenerator chunkGenerator, SpawnGroup spawnGroup, SpawnSettings.SpawnEntry spawnEntry, BlockPos blockPos)private static MobEntitycreateMob(ServerWorld world, EntityType<?> type)private static BiomegetBiomeDirectly(BlockPos pos, Chunk chunk)private static BlockPosgetEntitySpawnPos(WorldView world, EntityType<?> entityType, int x, int z)private static BlockPosgetSpawnPos(World world, WorldChunk chunk)private static booleanisAcceptableSpawnPosition(ServerWorld world, Chunk chunk, BlockPos.Mutable pos, double squaredDistance)static booleanisClearForSpawn(BlockView blockView, BlockPos pos, BlockState state, FluidState fluidState, EntityType<?> entityType)private static booleanisValidSpawn(ServerWorld world, MobEntity entity, double squaredDistance)private static List<SpawnSettings.SpawnEntry>method_29950(ServerWorld serverWorld, StructureAccessor structureAccessor, ChunkGenerator chunkGenerator, SpawnGroup spawnGroup, BlockPos blockPos, Biome biome)private static SpawnSettings.SpawnEntrypickRandomSpawnEntry(ServerWorld serverWorld, StructureAccessor structureAccessor, ChunkGenerator chunkGenerator, SpawnGroup spawnGroup, Random random, BlockPos blockPos)static voidpopulateEntities(ServerWorldAccess serverWorldAccess, Biome biome, int chunkX, int chunkZ, Random random)static SpawnHelper.InfosetupSpawn(int spawningChunkCount, Iterable<Entity> entities, SpawnHelper.ChunkSource chunkSource)static voidspawn(ServerWorld world, WorldChunk chunk, SpawnHelper.Info info, boolean spawnAnimals, boolean spawnMonsters, boolean shouldSpawnAnimals)static voidspawnEntitiesInChunk(SpawnGroup group, ServerWorld world, Chunk chunk, BlockPos pos, SpawnHelper.Checker checker, SpawnHelper.Runner runner)static voidspawnEntitiesInChunk(SpawnGroup group, ServerWorld world, WorldChunk chunk, SpawnHelper.Checker checker, SpawnHelper.Runner runner)
-
Field Details
-
LOGGER
-
CHUNK_AREA
private static final int CHUNK_AREA -
SPAWNABLE_GROUPS
-
-
Constructor Details
-
SpawnHelper
public SpawnHelper()
-
-
Method Details
-
setupSpawn
public static SpawnHelper.Info setupSpawn(int spawningChunkCount, Iterable<Entity> entities, SpawnHelper.ChunkSource chunkSource) -
getBiomeDirectly
-
spawn
public static void spawn(ServerWorld world, WorldChunk chunk, SpawnHelper.Info info, boolean spawnAnimals, boolean spawnMonsters, boolean shouldSpawnAnimals) -
spawnEntitiesInChunk
public static void spawnEntitiesInChunk(SpawnGroup group, ServerWorld world, WorldChunk chunk, SpawnHelper.Checker checker, SpawnHelper.Runner runner) -
spawnEntitiesInChunk
public static void spawnEntitiesInChunk(SpawnGroup group, ServerWorld world, Chunk chunk, BlockPos pos, SpawnHelper.Checker checker, SpawnHelper.Runner runner) -
isAcceptableSpawnPosition
private static boolean isAcceptableSpawnPosition(ServerWorld world, Chunk chunk, BlockPos.Mutable pos, double squaredDistance) -
canSpawn
private static boolean canSpawn(ServerWorld world, SpawnGroup group, StructureAccessor structureAccessor, ChunkGenerator chunkGenerator, SpawnSettings.SpawnEntry spawnEntry, BlockPos.Mutable pos, double squaredDistance) -
createMob
-
isValidSpawn
-
pickRandomSpawnEntry
@Nullable private static SpawnSettings.SpawnEntry pickRandomSpawnEntry(ServerWorld serverWorld, StructureAccessor structureAccessor, ChunkGenerator chunkGenerator, SpawnGroup spawnGroup, Random random, BlockPos blockPos) -
containsSpawnEntry
private static boolean containsSpawnEntry(ServerWorld serverWorld, StructureAccessor structureAccessor, ChunkGenerator chunkGenerator, SpawnGroup spawnGroup, SpawnSettings.SpawnEntry spawnEntry, BlockPos blockPos) -
method_29950
private static List<SpawnSettings.SpawnEntry> method_29950(ServerWorld serverWorld, StructureAccessor structureAccessor, ChunkGenerator chunkGenerator, SpawnGroup spawnGroup, BlockPos blockPos, @Nullable Biome biome) -
getSpawnPos
-
isClearForSpawn
public static boolean isClearForSpawn(BlockView blockView, BlockPos pos, BlockState state, FluidState fluidState, EntityType<?> entityType) -
canSpawn
public static boolean canSpawn(SpawnRestriction.Location location, WorldView world, BlockPos pos, @Nullable EntityType<?> entityType) -
populateEntities
public static void populateEntities(ServerWorldAccess serverWorldAccess, Biome biome, int chunkX, int chunkZ, Random random) -
getEntitySpawnPos
-