public class ServerWorld extends World implements StructureWorldAccess
| Modifier and Type | Class and Description |
|---|---|
(package private) class |
ServerWorld.EntityLoader |
| Modifier and Type | Field and Description |
|---|---|
private boolean |
allPlayersSleeping |
private ServerTickScheduler<Block> |
blockTickScheduler |
private it.unimi.dsi.fastutil.ints.Int2ObjectMap<EnderDragonPart> |
dragonParts |
static BlockPos |
END_SPAWN_POS |
private EnderDragonFight |
enderDragonFight |
private EntityList |
entityList |
private Set<MobEntity> |
field_26932 |
private class_5579<Entity> |
field_26935 |
private ServerTickScheduler<Fluid> |
fluidTickScheduler |
private int |
idleTimeout |
private boolean |
inBlockTick |
private static Logger |
LOGGER |
private List<ServerPlayerEntity> |
players |
private PortalForcer |
portalForcer |
protected RaidManager |
raidManager |
boolean |
savingDisabled |
private MinecraftServer |
server |
private ServerChunkManager |
serverChunkManager |
private boolean |
shouldTickTime |
private List<Spawner> |
spawners |
private StructureAccessor |
structureAccessor |
private it.unimi.dsi.fastutil.objects.ObjectLinkedOpenHashSet<BlockEvent> |
syncedBlockEventQueue |
private ServerWorldProperties |
worldProperties |
blockEntityTickers, CODEC, END, isClient, lcgBlockSeed, NETHER, OVERWORLD, properties, rainGradient, rainGradientPrev, random, thunderGradient, thunderGradientPrev, unusedIncrement| Constructor and Description |
|---|
ServerWorld(MinecraftServer server,
Executor workerExecutor,
LevelStorage.Session session,
ServerWorldProperties properties,
RegistryKey<World> registryKey,
DimensionType dimensionType,
WorldGenerationProgressListener worldGenerationProgressListener,
ChunkGenerator chunkGenerator,
boolean debugWorld,
long long2,
List<Spawner> list,
boolean bool) |
addBlockBreakParticles, addBlockEntity, addBlockEntityTicker, addDetailsToCrashReport, addFireworkParticle, addImportantParticle, addImportantParticle, addParticle, addParticle, breakBlock, calculateAmbientDarkness, canSetBlock, createExplosion, createExplosion, disconnect, getAmbientDarkness, getBiomeAccess, getBlockEntity, getBlockState, getBottomSectionLimit, getChunk, getChunk, getDimension, getEmittedRedstonePower, getEntitiesByType, getExistingChunk, getFluidState, getGameRules, getLevelProperties, getLightingProvider, getLocalDifficulty, getOtherEntities, getProfiler, getProfilerSupplier, getRainGradient, getRandom, getRandomPosInChunk, getReceivedRedstonePower, getReceivedStrongRedstonePower, getRegistryKey, getSeaLevel, getSectionCount, getSkyAngleRadians, getThunderGradient, getTime, getTimeOfDay, getTopY, getWorldBorder, getWorldChunk, hasHighHumidity, hasRain, initWeatherGradients, isClient, isDay, isDebugWorld, isDirectionSolid, isEmittingRedstonePower, isInBuildLimit, isNight, isRaining, isReceivingRedstonePower, isThundering, isTopSolid, isValid, markDirty, playSound, playSound, removeBlock, removeBlockEntity, scheduleBlockRerenderIfNeeded, sendPacket, setBlockState, setBlockState, setBlockState, setLightningTicksLeft, setMobSpawnOptions, setRainGradient, setThunderGradient, testBlockState, tickBlockEntities, tickEntity, updateComparators, updateNeighbor, updateNeighborsAlways, updateNeighborsExceptclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitspawnEntityAndPassengersaddParticle, getDifficulty, getDimensionHeight, getLevelProperties, getLocalDifficulty, getLunarTime, getRandom, isChunkLoaded, playSound, syncWorldEventgetEntityCollisions, getTopPosition, intersectsEntities, method_31081getClosestEntity, getClosestEntity, getClosestPlayer, getClosestPlayer, getClosestPlayer, getClosestPlayer, getClosestPlayer, getClosestPlayer, getEntitiesByClass, getEntitiesByType, getNonSpectatingEntities, getOtherEntities, getOtherEntities, getPlayerByUuid, getPlayers, getTargets, isPlayerInRangetestBlockStatebreakBlock, breakBlock, breakBlock, removeBlock, setBlockState, setBlockStategetMoonPhase, getMoonSize, getSkyAnglecontainsFluid, getAmbientDarkness, getBiome, getBiomeAccess, getBiomeForNoiseGen, getBrightness, getChunk, getChunk, getChunk, getChunk, getColor, getDimension, getExistingChunk, getLightLevel, getLightLevel, getSeaLevel, getStrongRedstonePower, getTopY, isAir, isChunkLoaded, isClient, isRegionLoaded, isRegionLoaded, isSkyVisibleAllowingSea, isWater, method_29556getBaseLightLevel, getLightingProvider, getLightLevel, isSkyVisiblecanPlace, getBlockCollisions, getBlockCollisions, getCollisions, getWorldBorder, intersectsEntities, isBlockSpaceEmpty, isSpaceEmpty, isSpaceEmpty, isSpaceEmpty, isSpaceEmptygetBlockEntity, getBlockState, getDismountHeight, getDismountHeight, getFluidState, getLuminance, getMaxLightLevel, method_29546, raycast, raycast, raycastBlockgetBottomHeightLimit, getBottomSectionLimit, getHeight, getSection, getSectionCount, getSectionIndex, getSectionIndexFromSection, getTopHeightLimit, getTopSectionLimit, isOutOfHeightLimit, isOutOfHeightLimitmethod_31609public static final BlockPos END_SPAWN_POS
private static final Logger LOGGER
private final List<ServerPlayerEntity> players
private final ServerChunkManager serverChunkManager
private final MinecraftServer server
private final ServerWorldProperties worldProperties
private final EntityList entityList
private final class_5579<Entity> field_26935
public boolean savingDisabled
private boolean allPlayersSleeping
private int idleTimeout
private final PortalForcer portalForcer
private final ServerTickScheduler<Block> blockTickScheduler
private final ServerTickScheduler<Fluid> fluidTickScheduler
protected final RaidManager raidManager
private final it.unimi.dsi.fastutil.objects.ObjectLinkedOpenHashSet<BlockEvent> syncedBlockEventQueue
private boolean inBlockTick
@Nullable private final EnderDragonFight enderDragonFight
private final it.unimi.dsi.fastutil.ints.Int2ObjectMap<EnderDragonPart> dragonParts
private final StructureAccessor structureAccessor
private final boolean shouldTickTime
public ServerWorld(MinecraftServer server, Executor workerExecutor, LevelStorage.Session session, ServerWorldProperties properties, RegistryKey<World> registryKey, DimensionType dimensionType, WorldGenerationProgressListener worldGenerationProgressListener, ChunkGenerator chunkGenerator, boolean debugWorld, long long2, List<Spawner> list, boolean bool)
public void setWeather(int clearDuration,
int rainDuration,
boolean raining,
boolean thundering)
public Biome getGeneratorStoredBiome(int biomeX, int biomeY, int biomeZ)
getGeneratorStoredBiome in interface WorldViewpublic StructureAccessor getStructureAccessor()
public void tick(BooleanSupplier shouldKeepTicking)
protected void tickTime()
public void setTimeOfDay(long timeOfDay)
public void tickSpawners(boolean spawnMonsters,
boolean spawnAnimals)
private boolean method_31430(Entity entity)
private void wakeSleepingPlayers()
public void tickChunk(WorldChunk chunk, int randomTickSpeed)
public boolean isInBlockTick()
public void updateSleepingPlayers()
public ServerScoreboard getScoreboard()
getScoreboard in class Worldprivate void resetWeather()
public void resetIdleTimeout()
private void tickFluid(ScheduledTick<Fluid> tick)
private void tickBlock(ScheduledTick<Block> tick)
public void tickEntity(Entity entity)
public boolean canPlayerModifyAt(PlayerEntity player, BlockPos pos)
canPlayerModifyAt in class Worldpublic void save(@Nullable ProgressListener progressListener, boolean flush, boolean bool)
private void saveLevel()
public <T extends Entity> List<? extends T> getEntitiesByType(class_5575<Entity,T> class_5575, Predicate<? super T> predicate)
null is passed as the entity type filter, care should be
taken that the type argument T is set to Entity, otherwise heap pollution
in the returned list or ClassCastException can occur.predicate - a predicate which returned entities must satisfypublic List<? extends EnderDragonEntity> getAliveEnderDragons()
public List<ServerPlayerEntity> getPlayers(Predicate<? super ServerPlayerEntity> predicate)
@Nullable public ServerPlayerEntity getRandomAlivePlayer()
public boolean spawnEntity(Entity entity)
spawnEntity in interface ModifiableWorldpublic boolean tryLoadEntity(Entity entity)
public void onDimensionChanged(Entity entity)
public void onPlayerTeleport(ServerPlayerEntity player)
public void onPlayerChangeDimension(ServerPlayerEntity player)
public void onPlayerConnected(ServerPlayerEntity player)
public void onPlayerRespawned(ServerPlayerEntity player)
private void addPlayer(ServerPlayerEntity player)
private boolean addEntity(Entity entity)
public boolean shouldCreateNewEntityWithPassenger(Entity entity)
public void unloadEntities(WorldChunk chunk)
public void removePlayer(ServerPlayerEntity player, Entity.RemovalReason removalReason)
public void setBlockBreakingInfo(int entityId,
BlockPos pos,
int progress)
setBlockBreakingInfo in class Worldpublic void playSound(@Nullable PlayerEntity player, double x, double y, double z, SoundEvent sound, SoundCategory category, float volume, float pitch)
public void playSoundFromEntity(@Nullable PlayerEntity player, Entity entity, SoundEvent sound, SoundCategory category, float volume, float pitch)
playSoundFromEntity in class Worldpublic void syncGlobalEvent(int eventId,
BlockPos pos,
int data)
syncGlobalEvent in class Worldpublic void syncWorldEvent(@Nullable PlayerEntity player, int eventId, BlockPos pos, int data)
syncWorldEvent in interface WorldAccesspublic void updateListeners(BlockPos pos, BlockState oldState, BlockState newState, int flags)
updateListeners in class Worldpublic void sendEntityStatus(Entity entity, byte status)
sendEntityStatus in class Worldpublic ServerChunkManager getChunkManager()
getChunkManager in interface WorldAccesspublic Explosion createExplosion(@Nullable Entity entity, @Nullable DamageSource damageSource, @Nullable ExplosionBehavior explosionBehavior, double double2, double double3, double double4, float float2, boolean bool, Explosion.DestructionType destructionType)
createExplosion in class Worldpublic void addSyncedBlockEvent(BlockPos pos, Block block, int type, int data)
addSyncedBlockEvent in class Worldprivate void processSyncedBlockEvents()
private boolean processBlockEvent(BlockEvent event)
public ServerTickScheduler<Block> getBlockTickScheduler()
getBlockTickScheduler in interface WorldAccesspublic ServerTickScheduler<Fluid> getFluidTickScheduler()
getFluidTickScheduler in interface WorldAccess@Nonnull public MinecraftServer getServer()
public PortalForcer getPortalForcer()
public StructureManager getStructureManager()
public <T extends ParticleEffect> int spawnParticles(T particle, double x, double y, double z, int count, double deltaX, double deltaY, double deltaZ, double speed)
public <T extends ParticleEffect> boolean spawnParticles(ServerPlayerEntity viewer, T particle, boolean force, double x, double y, double z, int count, double deltaX, double deltaY, double deltaZ, double speed)
private boolean sendToPlayerIfNearby(ServerPlayerEntity player, boolean force, double x, double y, double z, Packet<?> packet)
@Nullable public Entity getEntityById(int id)
getEntityById in class World@Deprecated @Nullable public Entity method_31424(int int2)
@Nullable public BlockPos locateStructure(StructureFeature<?> feature, BlockPos pos, int radius, boolean skipExistingChunks)
public RecipeManager getRecipeManager()
getRecipeManager in class Worldpublic TagManager getTagManager()
getTagManager in class Worldpublic boolean isSavingDisabled()
isSavingDisabled in class Worldpublic DynamicRegistryManager getRegistryManager()
getRegistryManager in interface class_5423public PersistentStateManager getPersistentStateManager()
@Nullable public MapState getMapState(String id)
getMapState in class Worldpublic void putMapState(MapState mapState)
putMapState in class Worldpublic int getNextMapId()
getNextMapId in class Worldpublic void setSpawnPos(BlockPos pos, float angle)
public BlockPos getSpawnPos()
public float getSpawnAngle()
public it.unimi.dsi.fastutil.longs.LongSet getForcedChunks()
public boolean setChunkForced(int x,
int z,
boolean forced)
public List<ServerPlayerEntity> getPlayers()
getPlayers in interface EntityViewpublic void onBlockChanged(BlockPos pos, BlockState oldBlock, BlockState newBlock)
onBlockChanged in class Worldpublic PointOfInterestStorage getPointOfInterestStorage()
public boolean isNearOccupiedPointOfInterest(BlockPos pos)
public boolean isNearOccupiedPointOfInterest(ChunkSectionPos sectionPos)
public boolean isNearOccupiedPointOfInterest(BlockPos pos, int maxDistance)
public int getOccupiedPointOfInterestDistance(ChunkSectionPos pos)
public RaidManager getRaidManager()
public boolean hasRaidAt(BlockPos pos)
public void handleInteraction(EntityInteraction interaction, Entity entity, InteractionObserver observer)
public void dump(Path path) throws IOException
IOExceptionprivate void dumpBlockEntities(Writer writer) throws IOException
IOExceptionpublic void clearUpdatesInArea(BlockBox box)
public void updateNeighbors(BlockPos pos, Block block)
updateNeighbors in interface WorldAccess@Environment(value=CLIENT) public float getBrightness(Direction direction, boolean shaded)
getBrightness in interface BlockRenderViewpublic boolean isFlat()
public long getSeed()
getSeed in interface StructureWorldAccess@Nullable public EnderDragonFight getEnderDragonFight()
public Stream<? extends StructureStart<?>> getStructures(ChunkSectionPos pos, StructureFeature<?> feature)
getStructures in interface StructureWorldAccesspublic ServerWorld toServerWorld()
toServerWorld in interface ServerWorldAccesspublic String method_31268()
private static <T> String method_31270(Iterable<T> iterable, Function<T,String> function)
public static void createEndSpawnPlatform(ServerWorld world)
protected class_5577<Entity> method_31592()
method_31592 in class Worldpublic void close()
throws IOException
close in interface AutoCloseableclose in class WorldIOExceptionpublic String method_31419()