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) class
ServerWorld.EntityLoader
-
Field Summary
Fields Modifier and Type Field Description private ServerTickScheduler<Block>
blockTickScheduler
private 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 float
field_28286
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 ObjectLinkedOpenHashSet<BlockEvent>
syncedBlockEventQueue
private ServerWorldProperties
worldProperties
Fields 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, updateNeighborsExcept
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.world.biome.source.BiomeAccess.Storage
method_31609
Methods inherited from interface net.minecraft.world.BlockRenderView
getBaseLightLevel, getLightingProvider, getLightLevel, isSkyVisible
Methods inherited from interface net.minecraft.world.BlockView
getBlockEntity, getBlockState, getDismountHeight, getDismountHeight, getFluidState, getLuminance, getMaxLightLevel, getStatesInBox, raycast, raycast, raycastBlock
Methods inherited from interface net.minecraft.class_5423
getBiomeKey, getEntityCollisions, getTopPosition, intersectsEntities
Methods inherited from interface net.minecraft.world.CollisionView
canPlace, getBlockCollisions, getBlockCollisions, getCollisions, getEntityCollisions, getWorldBorder, intersectsEntities, intersectsEntities, isBlockSpaceEmpty, isSpaceEmpty, isSpaceEmpty, isSpaceEmpty, isSpaceEmpty
Methods inherited from interface net.minecraft.world.EntityView
getClosestEntity, getClosestEntity, getClosestPlayer, getClosestPlayer, getClosestPlayer, getClosestPlayer, getClosestPlayer, getClosestPlayer, getEntitiesByClass, getEntitiesByType, getNonSpectatingEntities, getOtherEntities, getOtherEntities, getPlayerByUuid, getPlayers, getTargets, isPlayerInRange
Methods inherited from interface net.minecraft.world.HeightLimitView
getSection, getSectionIndex, getSectionIndexFromSection, getTopHeightLimit, getTopSectionLimit, isOutOfHeightLimit, isOutOfHeightLimit, method_32890, method_32891
Methods inherited from interface net.minecraft.world.LunarWorldView
getMoonPhase, getMoonSize, getSkyAngle
Methods inherited from interface net.minecraft.world.ModifiableWorld
breakBlock, breakBlock, breakBlock, removeBlock, setBlockState, setBlockState
Methods inherited from interface net.minecraft.world.ServerWorldAccess
spawnEntityAndPassengers
Methods inherited from interface net.minecraft.world.TestableWorld
testBlockState
Methods inherited from interface net.minecraft.world.WorldAccess
addParticle, emitGameEvent, emitGameEvent, getDifficulty, getLevelProperties, getLocalDifficulty, getLunarTime, getRandom, isChunkLoaded, playSound, syncWorldEvent
Methods 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:
getGeneratorStoredBiome
in 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:
getScoreboard
in classWorld
-
resetWeather
private void resetWeather() -
resetIdleTimeout
public void resetIdleTimeout() -
tickFluid
-
tickBlock
-
tickEntity
-
tickPassenger
-
canPlayerModifyAt
- Overrides:
canPlayerModifyAt
in 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: Ifnull
is passed as the entity type filter, care should be taken that the type argumentT
is set toEntity
, otherwise heap pollution in the returned list orClassCastException
can 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:
spawnEntity
in interfaceModifiableWorld
-
tryLoadEntity
-
onDimensionChanged
-
onPlayerTeleport
-
onPlayerChangeDimension
-
onPlayerConnected
-
onPlayerRespawned
-
addPlayer
-
addEntity
-
shouldCreateNewEntityWithPassenger
-
unloadEntities
-
removePlayer
-
setBlockBreakingInfo
- Specified by:
setBlockBreakingInfo
in 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:
playSoundFromEntity
in classWorld
-
syncGlobalEvent
- Overrides:
syncGlobalEvent
in classWorld
-
syncWorldEvent
- Specified by:
syncWorldEvent
in interfaceWorldAccess
-
getHeightLimit
public int getHeightLimit() -
emitGameEvent
- Specified by:
emitGameEvent
in interfaceWorldAccess
-
updateListeners
- Specified by:
updateListeners
in classWorld
-
sendEntityStatus
- Overrides:
sendEntityStatus
in classWorld
-
getChunkManager
- Specified by:
getChunkManager
in 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:
createExplosion
in classWorld
-
addSyncedBlockEvent
- Overrides:
addSyncedBlockEvent
in classWorld
-
processSyncedBlockEvents
private void processSyncedBlockEvents() -
processBlockEvent
-
getBlockTickScheduler
- Specified by:
getBlockTickScheduler
in interfaceWorldAccess
-
getFluidTickScheduler
- Specified by:
getFluidTickScheduler
in 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:
getEntityById
in classWorld
-
method_31424
Deprecated. -
getEntity
-
locateStructure
@Nullable public BlockPos locateStructure(StructureFeature<?> feature, BlockPos pos, int radius, boolean skipExistingChunks) -
locateBiome
-
getRecipeManager
- Specified by:
getRecipeManager
in classWorld
-
getTagManager
- Specified by:
getTagManager
in classWorld
-
isSavingDisabled
public boolean isSavingDisabled()- Overrides:
isSavingDisabled
in classWorld
-
getRegistryManager
- Specified by:
getRegistryManager
in interfaceclass_5423
-
getPersistentStateManager
-
getMapState
- Specified by:
getMapState
in classWorld
-
putMapState
- Specified by:
putMapState
in classWorld
-
getNextMapId
public int getNextMapId()- Specified by:
getNextMapId
in classWorld
-
setSpawnPos
-
getSpawnPos
-
getSpawnAngle
public float getSpawnAngle() -
getForcedChunks
-
setChunkForced
public boolean setChunkForced(int x, int z, boolean forced) -
getPlayers
- Specified by:
getPlayers
in interfaceEntityView
-
onBlockChanged
- Overrides:
onBlockChanged
in 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:
updateNeighbors
in interfaceWorldAccess
-
getBrightness
- Specified by:
getBrightness
in interfaceBlockRenderView
-
iterateEntities
-
toString
-
isFlat
public boolean isFlat() -
getSeed
public long getSeed()- Specified by:
getSeed
in interfaceStructureWorldAccess
-
getEnderDragonFight
-
getStructures
public Stream<? extends StructureStart<?>> getStructures(ChunkSectionPos pos, StructureFeature<?> feature)- Specified by:
getStructures
in interfaceStructureWorldAccess
-
toServerWorld
- Specified by:
toServerWorld
in interfaceServerWorldAccess
-
method_31268
-
method_31270
-
createEndSpawnPlatform
-
method_31592
- Specified by:
method_31592
in classWorld
-
method_31423
-
method_31426
-
close
- Specified by:
close
in interfaceAutoCloseable
- Overrides:
close
in classWorld
- Throws:
IOException
-
method_31419
-