public final class SpawnHelper extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
SpawnHelper.Checker |
static interface |
SpawnHelper.ChunkSource |
static class |
SpawnHelper.Info |
static interface |
SpawnHelper.Runner |
Modifier and Type | Field and Description |
---|---|
private static int |
CHUNK_AREA |
private static Logger |
LOGGER |
private static SpawnGroup[] |
SPAWNABLE_GROUPS |
Constructor and Description |
---|
SpawnHelper() |
Modifier and Type | Method and Description |
---|---|
private static boolean |
canSpawn(ServerWorld world,
SpawnGroup group,
StructureAccessor structureAccessor,
ChunkGenerator chunkGenerator,
SpawnSettings.SpawnEntry spawnEntry,
BlockPos.Mutable pos,
double squaredDistance) |
static boolean |
canSpawn(SpawnRestriction.Location location,
WorldView world,
BlockPos pos,
EntityType<?> entityType) |
private static boolean |
containsSpawnEntry(ServerWorld serverWorld,
StructureAccessor structureAccessor,
ChunkGenerator chunkGenerator,
SpawnGroup spawnGroup,
SpawnSettings.SpawnEntry spawnEntry,
BlockPos blockPos) |
private static MobEntity |
createMob(ServerWorld world,
EntityType<?> type) |
private static Biome |
getBiomeDirectly(BlockPos pos,
Chunk chunk) |
private static BlockPos |
getEntitySpawnPos(WorldView world,
EntityType<?> entityType,
int x,
int z) |
private static BlockPos |
getSpawnPos(World world,
WorldChunk chunk) |
private static boolean |
isAcceptableSpawnPosition(ServerWorld world,
Chunk chunk,
BlockPos.Mutable pos,
double squaredDistance) |
static boolean |
isClearForSpawn(BlockView blockView,
BlockPos pos,
BlockState state,
FluidState fluidState,
EntityType<?> entityType) |
private static boolean |
isValidSpawn(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.SpawnEntry |
pickRandomSpawnEntry(ServerWorld serverWorld,
StructureAccessor structureAccessor,
ChunkGenerator chunkGenerator,
SpawnGroup spawnGroup,
Random random,
BlockPos blockPos) |
static void |
populateEntities(ServerWorldAccess serverWorldAccess,
Biome biome,
int chunkX,
int chunkZ,
Random random) |
static SpawnHelper.Info |
setupSpawn(int spawningChunkCount,
Iterable<Entity> entities,
SpawnHelper.ChunkSource chunkSource) |
static void |
spawn(ServerWorld world,
WorldChunk chunk,
SpawnHelper.Info info,
boolean spawnAnimals,
boolean spawnMonsters,
boolean shouldSpawnAnimals) |
static void |
spawnEntitiesInChunk(SpawnGroup group,
ServerWorld world,
Chunk chunk,
BlockPos pos,
SpawnHelper.Checker checker,
SpawnHelper.Runner runner) |
static void |
spawnEntitiesInChunk(SpawnGroup group,
ServerWorld world,
WorldChunk chunk,
SpawnHelper.Checker checker,
SpawnHelper.Runner runner) |
private static final Logger LOGGER
private static final int CHUNK_AREA
private static final SpawnGroup[] SPAWNABLE_GROUPS
public static SpawnHelper.Info setupSpawn(int spawningChunkCount, Iterable<Entity> entities, SpawnHelper.ChunkSource chunkSource)
public static void spawn(ServerWorld world, WorldChunk chunk, SpawnHelper.Info info, boolean spawnAnimals, boolean spawnMonsters, boolean shouldSpawnAnimals)
public static void spawnEntitiesInChunk(SpawnGroup group, ServerWorld world, WorldChunk chunk, SpawnHelper.Checker checker, SpawnHelper.Runner runner)
public static void spawnEntitiesInChunk(SpawnGroup group, ServerWorld world, Chunk chunk, BlockPos pos, SpawnHelper.Checker checker, SpawnHelper.Runner runner)
private static boolean isAcceptableSpawnPosition(ServerWorld world, Chunk chunk, BlockPos.Mutable pos, double squaredDistance)
private static boolean canSpawn(ServerWorld world, SpawnGroup group, StructureAccessor structureAccessor, ChunkGenerator chunkGenerator, SpawnSettings.SpawnEntry spawnEntry, BlockPos.Mutable pos, double squaredDistance)
@Nullable private static MobEntity createMob(ServerWorld world, EntityType<?> type)
private static boolean isValidSpawn(ServerWorld world, MobEntity entity, double squaredDistance)
@Nullable private static SpawnSettings.SpawnEntry pickRandomSpawnEntry(ServerWorld serverWorld, StructureAccessor structureAccessor, ChunkGenerator chunkGenerator, SpawnGroup spawnGroup, Random random, BlockPos blockPos)
private static boolean containsSpawnEntry(ServerWorld serverWorld, StructureAccessor structureAccessor, ChunkGenerator chunkGenerator, SpawnGroup spawnGroup, SpawnSettings.SpawnEntry spawnEntry, BlockPos blockPos)
private static List<SpawnSettings.SpawnEntry> method_29950(ServerWorld serverWorld, StructureAccessor structureAccessor, ChunkGenerator chunkGenerator, SpawnGroup spawnGroup, BlockPos blockPos, @Nullable Biome biome)
private static BlockPos getSpawnPos(World world, WorldChunk chunk)
public static boolean isClearForSpawn(BlockView blockView, BlockPos pos, BlockState state, FluidState fluidState, EntityType<?> entityType)
public static boolean canSpawn(SpawnRestriction.Location location, WorldView world, BlockPos pos, @Nullable EntityType<?> entityType)
public static void populateEntities(ServerWorldAccess serverWorldAccess, Biome biome, int chunkX, int chunkZ, Random random)
private static BlockPos getEntitySpawnPos(WorldView world, EntityType<?> entityType, int x, int z)