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,HeightLimitView,LunarWorldView,ModifiableTestableWorld,ModifiableWorld,ServerWorldAccess,StructureWorldAccess,TestableWorld,WorldAccess,WorldView
public class ServerWorld extends World implements StructureWorldAccess
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) classServerWorld.EntityLoader -
Field Summary
Fields Modifier and Type Field Description private ServerTickScheduler<Block>blockTickSchedulerprivate Int2ObjectMap<EnderDragonPart>dragonPartsstatic BlockPosEND_SPAWN_POSprivate EnderDragonFightenderDragonFightprivate EntityListentityListprivate Set<MobEntity>field_26932private class_5579<Entity>field_26935private floatfield_28286private ServerTickScheduler<Fluid>fluidTickSchedulerprivate intidleTimeoutprivate booleaninBlockTickprivate 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
blockEntityTickers, CODEC, END, isClient, lcgBlockSeed, NETHER, OVERWORLD, properties, rainGradient, rainGradientPrev, random, thunderGradient, thunderGradientPrev, 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
addBlockBreakParticles, addBlockEntity, addBlockEntityTicker, addDetailsToCrashReport, addFireworkParticle, addImportantParticle, addImportantParticle, addParticle, addParticle, breakBlock, calculateAmbientDarkness, canSetBlock, createExplosion, createExplosion, disconnect, getAmbientDarkness, getBiomeAccess, getBlockEntity, getBlockState, getChunk, getChunk, getDimension, getEmittedRedstonePower, getEntitiesByType, 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, isRaining, isReceivingRedstonePower, isThundering, isTopSolid, isValid, markDirty, method_32886, playSound, playSound, removeBlock, removeBlockEntity, scheduleBlockRerenderIfNeeded, sendPacket, 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.biome.source.BiomeAccess.Storage
method_31609Methods inherited from interface net.minecraft.world.BlockRenderView
getBaseLightLevel, getLightingProvider, getLightLevel, isSkyVisibleMethods inherited from interface net.minecraft.world.BlockView
getBlockEntity, getBlockState, getDismountHeight, getDismountHeight, getFluidState, getLuminance, getMaxLightLevel, getStatesInBox, raycast, raycast, raycastBlockMethods inherited from interface net.minecraft.class_5423
getBiomeKey, getEntityCollisions, getTopPosition, intersectsEntitiesMethods 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, getClosestPlayer, getClosestPlayer, getClosestPlayer, getClosestPlayer, getClosestPlayer, getClosestPlayer, getEntitiesByClass, getEntitiesByType, getNonSpectatingEntities, getOtherEntities, getOtherEntities, getPlayerByUuid, getPlayers, getTargets, isPlayerInRangeMethods inherited from interface net.minecraft.world.HeightLimitView
getSection, getSectionIndex, getSectionIndexFromSection, getTopHeightLimit, getTopSectionLimit, isOutOfHeightLimit, isOutOfHeightLimit, method_32890, method_32891Methods 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, emitGameEvent, emitGameEvent, getDifficulty, getLevelProperties, getLocalDifficulty, getLunarTime, getRandom, isChunkLoaded, playSound, syncWorldEventMethods inherited from interface net.minecraft.world.WorldView
containsFluid, getAmbientDarkness, getBiome, getBiomeAccess, getBiomeForNoiseGen, getBottomSectionLimit, getBrightness, getChunk, getChunk, getChunk, getChunk, getColor, getDimension, getExistingChunk, getLightLevel, getLightLevel, getSeaLevel, getSectionCount, getStrongRedstonePower, getTopY, isAir, isChunkLoaded, isClient, isRegionLoaded, isRegionLoaded, isSkyVisibleAllowingSea, isWater, method_29556
-
Field Details
-
END_SPAWN_POS
-
LOGGER
-
players
-
serverChunkManager
-
server
-
worldProperties
-
entityList
-
field_26935
-
savingDisabled
public boolean savingDisabled -
field_28286
private float field_28286 -
idleTimeout
private int idleTimeout -
portalForcer
-
blockTickScheduler
-
fluidTickScheduler
-
field_26932
-
raidManager
-
syncedBlockEventQueue
-
inBlockTick
private boolean inBlockTick -
spawners
-
enderDragonFight
-
dragonParts
-
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) -
method_31430
-
wakeSleepingPlayers
private void wakeSleepingPlayers() -
tickChunk
-
method_31418
-
getSurface
-
isInBlockTick
public boolean isInBlockTick() -
method_33144
public boolean method_33144() -
method_33143
private void method_33143() -
updateSleepingPlayers
public void updateSleepingPlayers() -
method_33142
private float method_33142(boolean bool) -
getScoreboard
- Specified by:
getScoreboardin classWorld
-
resetWeather
private void resetWeather() -
resetIdleTimeout
public void resetIdleTimeout() -
tickFluid
-
tickBlock
-
tickEntity
-
tickPassenger
-
canPlayerModifyAt
- Overrides:
canPlayerModifyAtin classWorld
-
save
-
saveLevel
private void saveLevel() -
getEntitiesByType
public <T extends Entity> List<? extends T> getEntitiesByType(class_5575<Entity,T> class_5575, Predicate<? super T> 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:
predicate- 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
-
shouldCreateNewEntityWithPassenger
-
unloadEntities
-
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
-
getHeightLimit
public int getHeightLimit() -
emitGameEvent
- Specified by:
emitGameEventin 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 behavior, double x, double y, double z, float power, boolean createFire, 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
-
method_32817
-
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
-
method_31424
Deprecated. -
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
-
method_31592
- Specified by:
method_31592in classWorld
-
method_31423
-
method_31426
-
close
- Specified by:
closein interfaceAutoCloseable- Overrides:
closein classWorld- Throws:
IOException
-
method_31419
-