Package net.minecraft.server.world
Class ServerWorld
java.lang.Object
net.minecraft.world.World
net.minecraft.server.world.ServerWorld
- All Implemented Interfaces:
AutoCloseable,class_5423,BiomeAccess.Storage,BlockRenderView,BlockView,CollisionView,EntityView,LunarWorldView,ModifiableTestableWorld,ModifiableWorld,ServerWorldAccess,StructureWorldAccess,TestableWorld,WorldAccess,WorldView
public class ServerWorld extends World implements StructureWorldAccess
-
Field Summary
Fields Modifier and Type Field Description private booleanallPlayersSleepingprivate ServerTickScheduler<Block>blockTickSchedulerstatic BlockPosEND_SPAWN_POSprivate EnderDragonFightenderDragonFightprivate Int2ObjectMap<Entity>entitiesByIdprivate Map<UUID,Entity>entitiesByUuidprivate Queue<Entity>entitiesToLoadprivate Set<EntityNavigation>entityNavigationsprivate ServerTickScheduler<Fluid>fluidTickSchedulerprivate intidleTimeoutprivate booleaninBlockTick(package private) booleaninEntityTickprivate static LoggerLOGGERprivate List<ServerPlayerEntity>playersprivate PortalForcerportalForcerprotected RaidManagerraidManagerbooleansavingDisabledprivate MinecraftServerserverprivate ServerChunkManagerserverChunkManagerprivate booleanshouldTickTimeprivate List<Spawner>spawnersprivate StructureAccessorstructureAccessorprivate ObjectLinkedOpenHashSet<BlockEvent>syncedBlockEventQueueprivate ServerWorldPropertiesworldPropertiesFields inherited from class net.minecraft.world.World
blockEntities, CODEC, END, isClient, iteratingTickingBlockEntities, lcgBlockSeed, NETHER, OVERWORLD, pendingBlockEntities, properties, rainGradient, rainGradientPrev, random, thunderGradient, thunderGradientPrev, tickingBlockEntities, unloadedBlockEntities, unusedIncrement -
Constructor Summary
Constructors Constructor 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) -
Method Summary
Methods inherited from class net.minecraft.world.World
addBlockEntities, addBlockEntity, addDetailsToCrashReport, addFireworkParticle, addImportantParticle, addImportantParticle, addParticle, addParticle, breakBlock, calculateAmbientDarkness, canSetBlock, close, createExplosion, createExplosion, disconnect, getAmbientDarkness, getBiomeAccess, getBlockEntity, getBlockState, getChunk, getChunk, getDebugString, getDimension, getEmittedRedstonePower, getEntitiesByClass, getEntitiesByType, getEntitiesIncludingUngeneratedChunks, getExistingChunk, getFluidState, getGameRules, getLevelProperties, getLightingProvider, getLocalDifficulty, getOtherEntities, getProfiler, getProfilerSupplier, getRainGradient, getRandom, getRandomPosInChunk, getReceivedRedstonePower, getReceivedStrongRedstonePower, getRegistryKey, getSeaLevel, getSkyAngleRadians, getThunderGradient, getTime, getTimeOfDay, getTopY, getWorldBorder, getWorldChunk, hasHighHumidity, hasRain, initWeatherGradients, isClient, isDay, isDebugWorld, isDirectionSolid, isEmittingRedstonePower, isInBuildLimit, isNight, isOutOfBuildLimitVertically, isOutOfBuildLimitVertically, isRaining, isReceivingRedstonePower, isThundering, isTopSolid, isValid, markDirty, playSound, playSound, removeBlock, removeBlockEntity, scheduleBlockRerenderIfNeeded, sendPacket, setBlockEntity, setBlockState, setBlockState, setBlockState, setLightningTicksLeft, setMobSpawnOptions, setRainGradient, setThunderGradient, testBlockState, tickBlockEntities, tickEntity, updateComparators, updateNeighbor, updateNeighborsAlways, updateNeighborsExceptMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.world.BlockRenderView
getBaseLightLevel, getLightingProvider, getLightLevel, isSkyVisibleMethods inherited from interface net.minecraft.world.BlockView
getBlockEntity, getBlockState, getDismountHeight, getDismountHeight, getFluidState, getHeight, getLuminance, getMaxLightLevel, method_29546, raycast, raycastBlockMethods inherited from interface net.minecraft.class_5423
getEntityCollisions, getTopPosition, intersectsEntities, method_31081Methods inherited from interface net.minecraft.world.CollisionView
canPlace, getBlockCollisions, getBlockCollisions, getCollisions, getEntityCollisions, getWorldBorder, intersectsEntities, intersectsEntities, isBlockSpaceEmpty, isSpaceEmpty, isSpaceEmpty, isSpaceEmpty, isSpaceEmptyMethods inherited from interface net.minecraft.world.EntityView
getClosestEntity, getClosestEntity, getClosestEntityIncludingUngeneratedChunks, getClosestPlayer, getClosestPlayer, getClosestPlayer, getClosestPlayer, getClosestPlayer, getClosestPlayer, getEntitiesByClass, getEntitiesIncludingUngeneratedChunks, getEntitiesIncludingUngeneratedChunks, getNonSpectatingEntities, getOtherEntities, getOtherEntities, getPlayerByUuid, getPlayers, getTargets, isPlayerInRangeMethods inherited from interface net.minecraft.world.LunarWorldView
getMoonPhase, getMoonSize, getSkyAngleMethods inherited from interface net.minecraft.world.ModifiableWorld
breakBlock, breakBlock, breakBlock, removeBlock, setBlockState, setBlockStateMethods inherited from interface net.minecraft.world.ServerWorldAccess
spawnEntityAndPassengersMethods inherited from interface net.minecraft.world.TestableWorld
testBlockStateMethods inherited from interface net.minecraft.world.WorldAccess
addParticle, getDifficulty, getDimensionHeight, getLevelProperties, getLocalDifficulty, getLunarTime, getRandom, isChunkLoaded, playSound, syncWorldEventMethods inherited from interface net.minecraft.world.WorldView
containsFluid, 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_29556
-
Field Details
-
END_SPAWN_POS
-
LOGGER
-
entitiesById
-
entitiesByUuid
-
entitiesToLoad
-
players
-
serverChunkManager
-
inEntityTick
boolean inEntityTick -
server
-
worldProperties
-
savingDisabled
public boolean savingDisabled -
allPlayersSleeping
private boolean allPlayersSleeping -
idleTimeout
private int idleTimeout -
portalForcer
-
blockTickScheduler
-
fluidTickScheduler
-
raidManager
-
syncedBlockEventQueue
-
inBlockTick
private boolean inBlockTick -
spawners
-
enderDragonFight
-
structureAccessor
-
shouldTickTime
private final boolean shouldTickTime
-
-
Constructor Details
-
ServerWorld
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)
-
-
Method Details
-
setWeather
public void setWeather(int clearDuration, int rainDuration, boolean raining, boolean thundering) -
getGeneratorStoredBiome
- Specified by:
getGeneratorStoredBiomein interfaceWorldView
-
getStructureAccessor
-
tick
-
tickTime
protected void tickTime() -
setTimeOfDay
public void setTimeOfDay(long timeOfDay) -
tickSpawners
public void tickSpawners(boolean spawnMonsters, boolean spawnAnimals) -
wakeSleepingPlayers
private void wakeSleepingPlayers() -
tickChunk
-
getSurface
-
isInBlockTick
public boolean isInBlockTick() -
updateSleepingPlayers
public void updateSleepingPlayers() -
getScoreboard
- Specified by:
getScoreboardin classWorld
-
resetWeather
private void resetWeather() -
resetIdleTimeout
public void resetIdleTimeout() -
tickFluid
-
tickBlock
-
tickEntity
-
tickPassenger
-
checkEntityChunkPos
Validates if an entity's current position matches its chunk position. If the entity's chunk position and actual position don't match, then the entity will be moved to its new chunk. -
canPlayerModifyAt
- Overrides:
canPlayerModifyAtin classWorld
-
save
-
saveLevel
private void saveLevel() -
getEntitiesByType
public List<Entity> getEntitiesByType(@Nullable EntityType<?> type, Predicate<? super Entity> predicate)Computes a list of entities of the given type. Warning: Ifnullis passed as the entity type filter, care should be taken that the type argumentTis set toEntity, otherwise heap pollution in the returned list orClassCastExceptioncan occur.- Parameters:
type- the entity type of the returned entities, ornullfor any type of entitypredicate- a predicate which returned entities must satisfy- Returns:
- a list of entities of the given type
-
getAliveEnderDragons
-
getPlayers
-
getRandomAlivePlayer
-
spawnEntity
- Specified by:
spawnEntityin interfaceModifiableWorld
-
tryLoadEntity
-
onDimensionChanged
-
onPlayerTeleport
-
onPlayerChangeDimension
-
onPlayerConnected
-
onPlayerRespawned
-
addPlayer
-
addEntity
-
loadEntity
-
checkUuid
-
checkIfUuidExists
-
shouldCreateNewEntityWithPassenger
-
unloadEntities
-
unloadEntity
-
loadEntityUnchecked
-
removeEntity
-
removeEntityFromChunk
-
removePlayer
-
setBlockBreakingInfo
- Specified by:
setBlockBreakingInfoin classWorld
-
playSound
public void playSound(@Nullable PlayerEntity player, double x, double y, double z, SoundEvent sound, SoundCategory category, float volume, float pitch) -
playSoundFromEntity
public void playSoundFromEntity(@Nullable PlayerEntity player, Entity entity, SoundEvent sound, SoundCategory category, float volume, float pitch)- Specified by:
playSoundFromEntityin classWorld
-
syncGlobalEvent
- Overrides:
syncGlobalEventin classWorld
-
syncWorldEvent
- Specified by:
syncWorldEventin interfaceWorldAccess
-
updateListeners
- Specified by:
updateListenersin classWorld
-
sendEntityStatus
- Overrides:
sendEntityStatusin classWorld
-
getChunkManager
- Specified by:
getChunkManagerin interfaceWorldAccess
-
createExplosion
public Explosion createExplosion(@Nullable Entity entity, @Nullable DamageSource damageSource, @Nullable ExplosionBehavior explosionBehavior, double double2, double double3, double double4, float float2, boolean bool, Explosion.DestructionType destructionType)- Overrides:
createExplosionin classWorld
-
addSyncedBlockEvent
- Overrides:
addSyncedBlockEventin classWorld
-
processSyncedBlockEvents
private void processSyncedBlockEvents() -
processBlockEvent
-
getBlockTickScheduler
- Specified by:
getBlockTickSchedulerin interfaceWorldAccess
-
getFluidTickScheduler
- Specified by:
getFluidTickSchedulerin interfaceWorldAccess
-
getServer
-
getPortalForcer
-
getStructureManager
-
spawnParticles
public <T extends ParticleEffect> int spawnParticles(T particle, double x, double y, double z, int count, double deltaX, double deltaY, double deltaZ, double speed) -
spawnParticles
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) -
sendToPlayerIfNearby
private boolean sendToPlayerIfNearby(ServerPlayerEntity player, boolean force, double x, double y, double z, Packet<?> packet) -
getEntityById
- Specified by:
getEntityByIdin classWorld
-
getEntity
-
locateStructure
@Nullable public BlockPos locateStructure(StructureFeature<?> feature, BlockPos pos, int radius, boolean skipExistingChunks) -
locateBiome
-
getRecipeManager
- Specified by:
getRecipeManagerin classWorld
-
getTagManager
- Specified by:
getTagManagerin classWorld
-
isSavingDisabled
public boolean isSavingDisabled()- Overrides:
isSavingDisabledin classWorld
-
getRegistryManager
- Specified by:
getRegistryManagerin interfaceclass_5423
-
getPersistentStateManager
-
getMapState
- Specified by:
getMapStatein classWorld
-
putMapState
- Specified by:
putMapStatein classWorld
-
getNextMapId
public int getNextMapId()- Specified by:
getNextMapIdin classWorld
-
setSpawnPos
-
getSpawnPos
-
getSpawnAngle
public float getSpawnAngle() -
getForcedChunks
-
setChunkForced
public boolean setChunkForced(int x, int z, boolean forced) -
getPlayers
- Specified by:
getPlayersin interfaceEntityView
-
onBlockChanged
- Overrides:
onBlockChangedin classWorld
-
getPointOfInterestStorage
-
isNearOccupiedPointOfInterest
-
isNearOccupiedPointOfInterest
-
isNearOccupiedPointOfInterest
-
getOccupiedPointOfInterestDistance
-
getRaidManager
-
getRaidAt
-
hasRaidAt
-
handleInteraction
public void handleInteraction(EntityInteraction interaction, Entity entity, InteractionObserver observer) -
dump
- Throws:
IOException
-
dumpEntities
-
dumpBlockEntities
- Throws:
IOException
-
clearUpdatesInArea
-
updateNeighbors
- Specified by:
updateNeighborsin interfaceWorldAccess
-
getBrightness
- Specified by:
getBrightnessin interfaceBlockRenderView
-
iterateEntities
-
toString
-
isFlat
public boolean isFlat() -
getSeed
public long getSeed()- Specified by:
getSeedin interfaceStructureWorldAccess
-
getEnderDragonFight
-
getStructures
public Stream<? extends StructureStart<?>> getStructures(ChunkSectionPos pos, StructureFeature<?> feature)- Specified by:
getStructuresin interfaceStructureWorldAccess
-
toServerWorld
- Specified by:
toServerWorldin interfaceServerWorldAccess
-
method_31268
-
method_31270
-
createEndSpawnPlatform
-