Package net.minecraft.server.level
Class ServerLevel
java.lang.Object
net.minecraftforge.common.capabilities.CapabilityProvider<Level>
net.minecraft.world.level.Level
net.minecraft.server.level.ServerLevel
- All Implemented Interfaces:
AutoCloseable
,BiomeManager.NoiseBiomeSource
,BlockAndTintGetter
,BlockGetter
,CollisionGetter
,CommonLevelAccessor
,EntityGetter
,LevelAccessor
,LevelHeightAccessor
,LevelReader
,LevelSimulatedReader
,LevelSimulatedRW
,LevelTimeAccess
,LevelWriter
,ServerLevelAccessor
,WorldGenLevel
,ICapabilityProvider
,IForgeLevel
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprivate it.unimi.dsi.fastutil.objects.ObjectLinkedOpenHashSet<BlockEventData>
private ServerTickList<Block>
private WorldCapabilityData
private ServerChunkCache
private List<CustomSpawner>
private EndDragonFight
(package private) it.unimi.dsi.fastutil.ints.Int2ObjectMap<PartEntity<?>>
private static int
private int
static BlockPos
private PersistentEntitySectionManager<Entity>
(package private) EntityTickList
private boolean
private ServerTickList<Fluid>
private static org.apache.logging.log4j.Logger
boolean
(package private) List<ServerPlayer>
private PortalForcer
protected Raids
private MinecraftServer
private ServerLevelData
private SleepStatus
private StructureFeatureManager
private boolean
Fields inherited from class net.minecraft.world.level.Level
addend, blockEntityTickers, captureBlockSnapshots, capturedBlockSnapshots, END, isClientSide, levelData, LONG_PARTICLE_CLIP_RANGE, MAX_BRIGHTNESS, MAX_ENTITY_SPAWN_Y, MAX_LEVEL_SIZE, MIN_ENTITY_SPAWN_Y, NETHER, oRainLevel, oThunderLevel, OVERWORLD, rainLevel, random, randValue, RESOURCE_KEY_CODEC, restoringBlockSnapshots, SHORT_PARTICLE_CLIP_RANGE, thunderLevel, TICKS_PER_DAY
-
Constructor Summary
ConstructorDescriptionServerLevel(MinecraftServer p_8571_, Executor p_8572_, LevelStorageSource.LevelStorageAccess p_8573_, ServerLevelData p_8574_, ResourceKey<Level> p_8575_, DimensionType p_8576_, ChunkProgressListener p_8577_, ChunkGenerator p_8578_, boolean p_8579_, long p_8580_, List<CustomSpawner> p_8581_, boolean p_8582_)
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addDuringCommandTeleport(ServerPlayer p_8623_)
void
addDuringPortalTeleport(ServerPlayer p_8818_)
void
addDuringTeleport(Entity p_143335_)
private boolean
boolean
addFreshEntity(Entity p_8837_)
void
addLegacyChunkEntities(Stream<Entity> p_143312_)
void
addNewPlayer(ServerPlayer p_8835_)
private void
addPlayer(ServerPlayer p_8854_)
void
addRespawnedPlayer(ServerPlayer p_8846_)
boolean
addWithUUID(Entity p_8848_)
void
addWorldGenChunkEntities(Stream<Entity> p_143328_)
private void
boolean
areEntitiesLoaded(long p_143320_)
void
blockEvent(BlockPos p_8746_, Block p_8747_, int p_8748_, int p_8749_)
void
blockUpdated(BlockPos p_8743_, Block p_8744_)
void
broadcastEntityEvent(Entity p_8650_, byte p_8651_)
boolean
void
clearBlockEvents(BoundingBox p_8723_)
void
close()
void
destroyBlockProgress(int p_8612_, BlockPos p_8613_, int p_8614_)
private boolean
doBlockEvent(BlockEventData p_8699_)
private void
dumpBlockEntityTickers(Writer p_143300_)
private static void
dumpEntities(Writer p_8782_, Iterable<Entity> p_8783_)
explode(Entity p_8653_, DamageSource p_8654_, ExplosionDamageCalculator p_8655_, double p_8656_, double p_8657_, double p_8658_, float p_8659_, boolean p_8660_, Explosion.BlockInteraction p_8661_)
findLightningRod(BlockPos p_143249_)
protected BlockPos
findLightningTargetAround(BlockPos p_143289_)
findNearestBiome(Biome p_8706_, BlockPos p_8707_, int p_8708_, int p_8709_)
findNearestMapFeature(StructureFeature<?> p_8718_, BlockPos p_8719_, int p_8720_, boolean p_8721_)
void
List<? extends EnderDragon>
getEntities(EntityTypeTest<Entity,T> p_143281_, Predicate<? super T> p_143282_)
getEntity(int p_8597_)
getEntityOrPart(int p_143318_)
Deprecated.it.unimi.dsi.fastutil.longs.LongSet
int
getLevel()
int
getMapData(String p_8785_)
getPlayers(Predicate<? super ServerPlayer> p_8796_)
getRaids()
long
getSeed()
float
float
private static <T> String
getTypeCount(Iterable<T> p_143302_, Function<T,String> p_143303_)
getUncachedNoiseBiome(int p_8599_, int p_8600_, int p_8601_)
void
globalLevelEvent(int p_8811_, BlockPos p_8812_, int p_8813_)
protected void
boolean
isCloseToVillage(BlockPos p_8737_, int p_8738_)
boolean
isFlat()
boolean
boolean
isPositionEntityTicking(BlockPos p_143341_)
boolean
isPositionEntityTicking(ChunkPos p_143276_)
boolean
isPositionTickingWithEntitiesLoaded(BlockPos p_143337_)
boolean
boolean
boolean
isVillage(SectionPos p_8763_)
void
levelEvent(Player p_8684_, int p_8685_, BlockPos p_8686_, int p_8687_)
static void
makeObsidianPlatform(ServerLevel p_8618_)
boolean
mayInteract(Player p_8696_, BlockPos p_8697_)
boolean
noSave()
void
onBlockStateChange(BlockPos p_8751_, BlockState p_8752_, BlockState p_8753_)
void
onReputationEvent(ReputationEventType p_8671_, Entity p_8672_, ReputationEventHandler p_8673_)
players()
void
playSound(Player p_8675_, double p_8676_, double p_8677_, double p_8678_, SoundEvent p_8679_, SoundSource p_8680_, float p_8681_, float p_8682_)
void
playSound(Player p_8689_, Entity p_8690_, SoundEvent p_8691_, SoundSource p_8692_, float p_8693_, float p_8694_)
void
removeEntity(Entity entity)
void
removeEntity(Entity p_8868_, boolean keepData)
void
removeEntityComplete(Entity p_8865_, boolean keepData)
void
removePlayer(ServerPlayer p_8850_, boolean keepData)
void
removePlayerImmediately(ServerPlayer p_143262_, Entity.RemovalReason p_143263_)
void
private void
void
save(ProgressListener p_8644_, boolean p_8645_, boolean p_8646_)
void
saveDebugReport(Path p_8787_)
private void
int
sectionsToVillage(SectionPos p_8829_)
void
sendBlockUpdated(BlockPos p_8755_, BlockState p_8756_, BlockState p_8757_, int p_8758_)
private boolean
sendParticles(ServerPlayer p_8637_, boolean p_8638_, double p_8639_, double p_8640_, double p_8641_, Packet<?> p_8642_)
<T extends ParticleOptions>
booleansendParticles(ServerPlayer p_8625_, T p_8626_, boolean p_8627_, double p_8628_, double p_8629_, double p_8630_, int p_8631_, double p_8632_, double p_8633_, double p_8634_, double p_8635_)
<T extends ParticleOptions>
intsendParticles(T p_8768_, double p_8769_, double p_8770_, double p_8771_, int p_8772_, double p_8773_, double p_8774_, double p_8775_, double p_8776_)
void
sendVibrationParticle(VibrationPath p_143284_)
boolean
setChunkForced(int p_8603_, int p_8604_, boolean p_8605_)
void
setDayTime(long p_8616_)
void
setDefaultSpawnPos(BlockPos p_8734_, float p_8735_)
void
setMapData(String p_143305_, MapItemSavedData p_143306_)
void
setWeatherParameters(int p_8607_, int p_8608_, boolean p_8609_, boolean p_8610_)
private boolean
shouldDiscardEntity(Entity p_143343_)
Stream<? extends StructureStart<?>>
startsForFeature(SectionPos p_8765_, StructureFeature<?> p_8766_)
private void
void
tick(BooleanSupplier p_8794_)
private void
tickBlock(TickNextTickData<Block> p_8822_)
void
tickChunk(LevelChunk p_8715_, int p_8716_)
void
tickCustomSpawners(boolean p_8800_, boolean p_8801_)
private void
tickLiquid(TickNextTickData<Fluid> p_8701_)
void
tickNonPassenger(Entity p_8648_)
private void
tickPassenger(Entity p_8663_, Entity p_8664_)
protected void
tickTime()
toString()
boolean
tryAddFreshEntityWithPassengers(Entity p_8861_)
void
unload(LevelChunk p_8713_)
void
private void
Methods inherited from class net.minecraft.world.level.Level
addAlwaysVisibleParticle, addAlwaysVisibleParticle, addBlockEntityTicker, addDestroyBlockEffect, addFreshBlockEntities, addParticle, addParticle, blockEntityChanged, createFireworks, destroyBlock, dimension, dimensionType, disconnect, explode, explode, fillReportDetails, getBestNeighborSignal, getBiomeManager, getBlockEntity, getBlockRandomPos, getBlockState, getChunk, getChunk, getChunkAt, getChunkForCollisions, getCurrentDifficultyAt, getDayTime, getDirectSignalTo, getEntities, getEntities, getFluidState, getGameRules, getGameTime, getHeight, getLevelData, getLightEngine, getMaxEntityRadius, getProfiler, getProfilerSupplier, getRainLevel, getRandom, getSeaLevel, getSignal, getSkyDarken, getSunAngle, getThunderLevel, getWorldBorder, guardEntityTick, hasNeighborSignal, hasSignal, increaseMaxEntityRadius, isClientSide, isDay, isDebug, isFluidAtPosition, isHumidAt, isInSpawnableBounds, isInWorldBounds, isLoaded, isNight, isRaining, isRainingAt, isStateAtPosition, isThundering, loadedAndEntityCanStandOn, loadedAndEntityCanStandOnFace, markAndNotifyBlock, neighborChanged, playLocalSound, playSound, postGameEventInRadius, prepareWeather, removeBlock, removeBlockEntity, sendPacketToServer, setBlock, setBlock, setBlockAndUpdate, setBlockEntity, setBlocksDirty, setRainLevel, setSkyFlashTime, setSpawnSettings, setThunderLevel, tickBlockEntities, updateNeighborsAt, updateNeighborsAtExceptFromFacing, updateNeighbourForOutputSignal, updateSkyBrightness
Methods inherited from class net.minecraftforge.common.capabilities.CapabilityProvider
areCapsCompatible, areCapsCompatible, deserializeCaps, gatherCapabilities, gatherCapabilities, gatherCapabilities, getCapabilities, getCapability, invalidateCaps, reviveCaps, serializeCaps
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.world.level.biome.BiomeManager.NoiseBiomeSource
getPrimaryBiome
Methods inherited from interface net.minecraft.world.level.BlockAndTintGetter
canSeeSky, getBrightness, getLightEngine, getRawBrightness
Methods inherited from interface net.minecraft.world.level.BlockGetter
clip, clipWithInteractionOverride, getBlockEntity, getBlockFloorHeight, getBlockFloorHeight, getBlockState, getBlockStates, getFluidState, getLightEmission, getMaxLightLevel, isBlockInLine
Methods inherited from interface net.minecraft.world.level.CollisionGetter
findFreePosition, getBlockCollisions, getBlockCollisions, getCollisions, getEntityCollisions, getWorldBorder, hasBlockCollision, isUnobstructed, isUnobstructed, isUnobstructed, noCollision, noCollision, noCollision, noCollision
Methods inherited from interface net.minecraft.world.level.CommonLevelAccessor
getBiomeName, getBlockEntity, getEntityCollisions, getHeightmapPos, isUnobstructed
Methods inherited from interface net.minecraft.world.level.EntityGetter
getEntities, getEntities, getEntities, getEntitiesOfClass, getEntitiesOfClass, getNearbyEntities, getNearbyPlayers, getNearestEntity, getNearestEntity, getNearestPlayer, getNearestPlayer, getNearestPlayer, getNearestPlayer, getNearestPlayer, getNearestPlayer, getPlayerByUUID, hasNearbyAlivePlayer
Methods inherited from interface net.minecraftforge.common.capabilities.ICapabilityProvider
getCapability, getCapability
Methods inherited from interface net.minecraft.world.level.LevelAccessor
addParticle, dayTime, gameEvent, gameEvent, gameEvent, getCurrentDifficultyAt, getDifficulty, getLevelData, getRandom, hasChunk, levelEvent, playSound
Methods inherited from interface net.minecraft.world.level.LevelHeightAccessor
getMaxBuildHeight, getMaxSection, getMinSection, getSectionIndex, getSectionIndexFromSectionY, getSectionsCount, getSectionYFromSectionIndex, isOutsideBuildHeight, isOutsideBuildHeight
Methods inherited from interface net.minecraft.world.level.LevelReader
canSeeSkyFromBelowWater, containsAnyLiquid, dimensionType, getBiome, getBiomeManager, getBlockStatesIfLoaded, getBlockTint, getBrightness, getChunk, getChunk, getChunk, getChunk, getChunkForCollisions, getDirectSignal, getHeight, getHeight, getMaxLocalRawBrightness, getMaxLocalRawBrightness, getMinBuildHeight, getNoiseBiome, getSeaLevel, getSkyDarken, hasChunkAt, hasChunkAt, hasChunksAt, hasChunksAt, hasChunksAt, isAreaLoaded, isClientSide, isEmptyBlock, isWaterAt
Methods inherited from interface net.minecraft.world.level.LevelSimulatedReader
isFluidAtPosition, isStateAtPosition
Methods inherited from interface net.minecraft.world.level.LevelTimeAccess
getMoonBrightness, getMoonPhase, getTimeOfDay
Methods inherited from interface net.minecraft.world.level.LevelWriter
destroyBlock, destroyBlock, destroyBlock, removeBlock, setBlock, setBlock
Methods inherited from interface net.minecraft.world.level.ServerLevelAccessor
addFreshEntityWithPassengers
Methods inherited from interface net.minecraft.world.level.WorldGenLevel
ensureCanWrite
-
Field Details
-
END_SPAWN_POINT
-
LOGGER
private static final org.apache.logging.log4j.Logger LOGGER -
EMPTY_TIME_NO_TICK
private static final int EMPTY_TIME_NO_TICK- See Also:
- Constant Field Values
-
players
-
chunkSource
-
server
-
serverLevelData
-
entityTickList
-
entityManager
-
noSave
public boolean noSave -
sleepStatus
-
emptyTime
private int emptyTime -
portalForcer
-
blockTicks
-
liquidTicks
-
raids
-
blockEvents
-
handlingTick
private boolean handlingTick -
customSpawners
-
dragonFight
-
dragonParts
-
structureFeatureManager
-
tickTime
private final boolean tickTime -
capabilityData
-
-
Constructor Details
-
ServerLevel
public ServerLevel(MinecraftServer p_8571_, Executor p_8572_, LevelStorageSource.LevelStorageAccess p_8573_, ServerLevelData p_8574_, ResourceKey<Level> p_8575_, DimensionType p_8576_, ChunkProgressListener p_8577_, ChunkGenerator p_8578_, boolean p_8579_, long p_8580_, List<CustomSpawner> p_8581_, boolean p_8582_)
-
-
Method Details
-
setWeatherParameters
public void setWeatherParameters(int p_8607_, int p_8608_, boolean p_8609_, boolean p_8610_) -
getUncachedNoiseBiome
- Specified by:
getUncachedNoiseBiome
in interfaceLevelReader
-
structureFeatureManager
-
tick
-
tickTime
protected void tickTime() -
setDayTime
public void setDayTime(long p_8616_) -
tickCustomSpawners
public void tickCustomSpawners(boolean p_8800_, boolean p_8801_) -
shouldDiscardEntity
-
wakeUpAllPlayers
private void wakeUpAllPlayers() -
tickChunk
-
findLightningRod
-
findLightningTargetAround
-
isHandlingTick
public boolean isHandlingTick() -
canSleepThroughNights
public boolean canSleepThroughNights() -
announceSleepStatus
private void announceSleepStatus() -
updateSleepingPlayerList
public void updateSleepingPlayerList() -
getScoreboard
- Specified by:
getScoreboard
in classLevel
-
stopWeather
private void stopWeather() -
resetEmptyTime
public void resetEmptyTime() -
tickLiquid
-
tickBlock
-
tickNonPassenger
-
tickPassenger
-
mayInteract
- Overrides:
mayInteract
in classLevel
-
save
-
saveLevelData
private void saveLevelData() -
getEntities
public <T extends Entity> List<? extends T> getEntities(EntityTypeTest<Entity,T> p_143281_, Predicate<? super T> p_143282_) -
getDragons
-
getPlayers
-
getRandomPlayer
-
addFreshEntity
- Specified by:
addFreshEntity
in interfaceLevelWriter
-
addWithUUID
-
addDuringTeleport
-
addDuringCommandTeleport
-
addDuringPortalTeleport
-
addNewPlayer
-
addRespawnedPlayer
-
removePlayer
-
removeEntityComplete
-
removeEntity
-
removeEntity
-
addPlayer
-
addEntity
-
tryAddFreshEntityWithPassengers
-
unload
-
removePlayerImmediately
-
destroyBlockProgress
- Specified by:
destroyBlockProgress
in classLevel
-
playSound
public void playSound(@Nullable Player p_8675_, double p_8676_, double p_8677_, double p_8678_, SoundEvent p_8679_, SoundSource p_8680_, float p_8681_, float p_8682_) -
playSound
public void playSound(@Nullable Player p_8689_, Entity p_8690_, SoundEvent p_8691_, SoundSource p_8692_, float p_8693_, float p_8694_) -
globalLevelEvent
- Overrides:
globalLevelEvent
in classLevel
-
levelEvent
- Specified by:
levelEvent
in interfaceLevelAccessor
-
getLogicalHeight
public int getLogicalHeight()- Specified by:
getLogicalHeight
in interfaceLevelAccessor
-
gameEvent
- Specified by:
gameEvent
in interfaceLevelAccessor
-
sendBlockUpdated
public void sendBlockUpdated(BlockPos p_8755_, BlockState p_8756_, BlockState p_8757_, int p_8758_)- Specified by:
sendBlockUpdated
in classLevel
-
broadcastEntityEvent
- Overrides:
broadcastEntityEvent
in classLevel
-
getChunkSource
- Specified by:
getChunkSource
in interfaceLevelAccessor
-
explode
public Explosion explode(@Nullable Entity p_8653_, @Nullable DamageSource p_8654_, @Nullable ExplosionDamageCalculator p_8655_, double p_8656_, double p_8657_, double p_8658_, float p_8659_, boolean p_8660_, Explosion.BlockInteraction p_8661_) -
blockEvent
- Overrides:
blockEvent
in classLevel
-
runBlockEvents
private void runBlockEvents() -
doBlockEvent
-
getBlockTicks
- Specified by:
getBlockTicks
in interfaceLevelAccessor
-
getLiquidTicks
- Specified by:
getLiquidTicks
in interfaceLevelAccessor
-
getServer
- Specified by:
getServer
in interfaceLevelAccessor
- Overrides:
getServer
in classLevel
-
getPortalForcer
-
getStructureManager
-
sendVibrationParticle
-
sendParticles
public <T extends ParticleOptions> int sendParticles(T p_8768_, double p_8769_, double p_8770_, double p_8771_, int p_8772_, double p_8773_, double p_8774_, double p_8775_, double p_8776_) -
sendParticles
public <T extends ParticleOptions> boolean sendParticles(ServerPlayer p_8625_, T p_8626_, boolean p_8627_, double p_8628_, double p_8629_, double p_8630_, int p_8631_, double p_8632_, double p_8633_, double p_8634_, double p_8635_) -
sendParticles
private boolean sendParticles(ServerPlayer p_8637_, boolean p_8638_, double p_8639_, double p_8640_, double p_8641_, Packet<?> p_8642_) -
getEntity
-
getEntityOrPart
Deprecated. -
getEntity
-
findNearestMapFeature
@Nullable public BlockPos findNearestMapFeature(StructureFeature<?> p_8718_, BlockPos p_8719_, int p_8720_, boolean p_8721_) -
findNearestBiome
-
getRecipeManager
- Specified by:
getRecipeManager
in classLevel
-
getTagManager
- Specified by:
getTagManager
in classLevel
-
noSave
public boolean noSave() -
registryAccess
- Specified by:
registryAccess
in interfaceCommonLevelAccessor
-
getDataStorage
-
getMapData
- Specified by:
getMapData
in classLevel
-
setMapData
- Specified by:
setMapData
in classLevel
-
getFreeMapId
public int getFreeMapId()- Specified by:
getFreeMapId
in classLevel
-
setDefaultSpawnPos
-
getForcedChunks
public it.unimi.dsi.fastutil.longs.LongSet getForcedChunks() -
setChunkForced
public boolean setChunkForced(int p_8603_, int p_8604_, boolean p_8605_) -
players
- Specified by:
players
in interfaceEntityGetter
-
onBlockStateChange
- Overrides:
onBlockStateChange
in classLevel
-
getPoiManager
-
isVillage
-
isVillage
-
isCloseToVillage
-
sectionsToVillage
-
getRaids
-
getRaidAt
-
isRaided
-
onReputationEvent
public void onReputationEvent(ReputationEventType p_8671_, Entity p_8672_, ReputationEventHandler p_8673_) -
saveDebugReport
- Throws:
IOException
-
dumpEntities
- Throws:
IOException
-
dumpBlockEntityTickers
- Throws:
IOException
-
clearBlockEvents
-
blockUpdated
- Specified by:
blockUpdated
in interfaceLevelAccessor
-
getShade
- Specified by:
getShade
in interfaceBlockAndTintGetter
-
getAllEntities
-
toString
-
isFlat
public boolean isFlat() -
getSeed
public long getSeed()- Specified by:
getSeed
in interfaceWorldGenLevel
-
dragonFight
-
startsForFeature
public Stream<? extends StructureStart<?>> startsForFeature(SectionPos p_8765_, StructureFeature<?> p_8766_)- Specified by:
startsForFeature
in interfaceWorldGenLevel
-
getLevel
- Specified by:
getLevel
in interfaceServerLevelAccessor
-
getWatchdogStats
-
getTypeCount
-
makeObsidianPlatform
-
initCapabilities
protected void initCapabilities() -
getEntities
- Specified by:
getEntities
in classLevel
-
addLegacyChunkEntities
-
addWorldGenChunkEntities
-
close
- Specified by:
close
in interfaceAutoCloseable
- Overrides:
close
in classLevel
- Throws:
IOException
-
gatherChunkSourceStats
- Specified by:
gatherChunkSourceStats
in classLevel
-
areEntitiesLoaded
public boolean areEntitiesLoaded(long p_143320_) -
isPositionTickingWithEntitiesLoaded
-
isPositionEntityTicking
-
isPositionEntityTicking
-