Package net.minecraft.client.multiplayer
Class ClientLevel
java.lang.Object
net.neoforged.neoforge.attachment.AttachmentHolder
net.minecraft.world.level.Level
net.minecraft.client.multiplayer.ClientLevel
- All Implemented Interfaces:
AutoCloseable
,BiomeManager.NoiseBiomeSource
,BlockAndTintGetter
,BlockGetter
,CollisionGetter
,CommonLevelAccessor
,EntityGetter
,LevelAccessor
,LevelHeightAccessor
,LevelReader
,LevelSimulatedReader
,LevelSimulatedRW
,LevelTimeAccess
,LevelWriter
,SignalGetter
,IAttachmentHolder
,IBlockAndTintGetterExtension
,IBlockGetterExtension
,ILevelExtension
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
(package private) final class
Nested classes/interfaces inherited from class net.minecraft.world.level.Level
Level.ExplosionInteraction
Nested classes/interfaces inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
AttachmentHolder.AsField
-
Field Summary
Modifier and TypeFieldDescriptionprivate final BlockStatePredictionHandler
private final ClientChunkCache
private final ClientLevel.ClientLevelData
private static final long
private final ClientPacketListener
private final DimensionSpecialEffects
private final TransientEntitySectionManager<Entity>
private static final double
private final LevelRenderer
private static final int
private static final org.slf4j.Logger
private final Map<String,
MapItemSavedData> private final Minecraft
private final ModelDataManager.Active
private static final int
private final it.unimi.dsi.fastutil.ints.Int2ObjectMap<PartEntity<?>>
(package private) final List<AbstractClientPlayer>
private Scoreboard
private int
private int
(package private) final EntityTickList
private final TickRateManager
private final it.unimi.dsi.fastutil.objects.Object2ObjectArrayMap<ColorResolver,
BlockTintCache> 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, neighborUpdater, NETHER, oRainLevel, oThunderLevel, OVERWORLD, rainLevel, random, randValue, RESOURCE_KEY_CODEC, restoringBlockSnapshots, SHORT_PARTICLE_CLIP_RANGE, thunderLevel, TICKS_PER_DAY
Fields inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
ATTACHMENTS_NBT_KEY
Fields inherited from interface net.minecraft.world.level.SignalGetter
DIRECTIONS
-
Constructor Summary
ConstructorDescriptionClientLevel
(ClientPacketListener p_205505_, ClientLevel.ClientLevelData p_205506_, ResourceKey<Level> p_205507_, Holder<DimensionType> p_205508_, int p_205509_, int p_205510_, Supplier<ProfilerFiller> p_205511_, LevelRenderer p_205512_, boolean p_205513_, long p_205514_) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAlwaysVisibleParticle
(ParticleOptions p_104774_, boolean p_104775_, double p_104776_, double p_104777_, double p_104778_, double p_104779_, double p_104780_, double p_104781_) void
addAlwaysVisibleParticle
(ParticleOptions p_104766_, double p_104767_, double p_104768_, double p_104769_, double p_104770_, double p_104771_, double p_104772_) void
addDestroyBlockEffect
(BlockPos p_171667_, BlockState p_171668_) void
protected void
addMapData
(Map<String, MapItemSavedData> p_171673_) void
addParticle
(ParticleOptions p_104714_, boolean p_104715_, double p_104716_, double p_104717_, double p_104718_, double p_104719_, double p_104720_, double p_104721_) void
addParticle
(ParticleOptions p_104706_, double p_104707_, double p_104708_, double p_104709_, double p_104710_, double p_104711_, double p_104712_) void
animateTick
(int p_104785_, int p_104786_, int p_104787_) int
calculateBlockTint
(BlockPos p_104763_, ColorResolver p_104764_) void
void
createFireworks
(double p_104585_, double p_104586_, double p_104587_, double p_104588_, double p_104589_, double p_104590_, CompoundTag p_104591_) void
destroyBlockProgress
(int p_104634_, BlockPos p_104635_, int p_104636_) void
void
doAnimateTick
(int p_233613_, int p_233614_, int p_233615_, int p_233616_, RandomSource p_233617_, Block p_233618_, BlockPos.MutableBlockPos p_233619_) effects()
fillReportDetails
(CrashReport p_104729_) void
gameEvent
(GameEvent p_233639_, Vec3 p_233640_, GameEvent.Context p_233641_) protected Map<String,
MapItemSavedData> (package private) BlockStatePredictionHandler
int
getBlockTint
(BlockPos p_104700_, ColorResolver p_104701_) getCloudColor
(float p_104809_) protected LevelEntityGetter<Entity>
getEntity
(int p_104609_) int
int
getMapData
(String p_104725_) private Block
Retrieves the model data manager for this level.Collection<PartEntity<?>>
All part entities in this world.int
float
getShade
(float normalX, float normalY, float normalZ, boolean shade) Computes the shade for a given normal.float
getSkyColor
(Vec3 p_171661_, float p_171662_) float
getSkyDarken
(float p_104806_) int
float
getStarBrightness
(float p_104812_) getUncachedNoiseBiome
(int p_205516_, int p_205517_, int p_205518_) void
globalLevelEvent
(int p_104743_, BlockPos p_104744_, int p_104745_) void
handleBlockChangedAck
(int p_233652_) boolean
hasChunk
(int p_104737_, int p_104738_) boolean
void
levelEvent
(Player p_104654_, int p_104655_, BlockPos p_104656_, int p_104657_) void
onChunkLoaded
(ChunkPos p_171650_) void
overrideMapData
(String p_259652_, MapItemSavedData p_259308_) players()
void
playLocalSound
(double p_104600_, double p_104601_, double p_104602_, SoundEvent p_104603_, SoundSource p_104604_, float p_104605_, float p_104606_, boolean p_104607_) void
playLocalSound
(Entity p_312749_, SoundEvent p_312635_, SoundSource p_312007_, float p_312298_, float p_312772_) void
playSeededSound
(Player p_263381_, double p_263372_, double p_263404_, double p_263365_, Holder<SoundEvent> p_263335_, SoundSource p_263417_, float p_263416_, float p_263349_, long p_263408_) void
playSeededSound
(Player p_263514_, Entity p_263536_, Holder<SoundEvent> p_263518_, SoundSource p_263487_, float p_263538_, float p_263524_, long p_263509_) private void
playSound
(double p_233603_, double p_233604_, double p_233605_, SoundEvent p_233606_, SoundSource p_233607_, float p_233608_, float p_233609_, boolean p_233610_, long p_233611_) void
void
queueLightUpdate
(Runnable p_194172_) void
removeEntity
(int p_171643_, Entity.RemovalReason p_171644_) void
sendBlockUpdated
(BlockPos p_104685_, BlockState p_104686_, BlockState p_104687_, int p_104688_) void
sendPacketToServer
(Packet<?> p_104734_) boolean
setBlock
(BlockPos p_233643_, BlockState p_233644_, int p_233645_, int p_233646_) void
setBlocksDirty
(BlockPos p_104759_, BlockState p_104760_, BlockState p_104761_) void
setDayTime
(long p_104747_) void
setDefaultSpawnPos
(BlockPos p_104753_, float p_104754_) void
setGameTime
(long p_104638_) void
setMapData
(String p_171670_, MapItemSavedData p_171671_) void
setScoreboard
(Scoreboard p_104670_) void
setSectionDirtyWithNeighbors
(int p_104794_, int p_104795_, int p_104796_) void
setServerSimulationDistance
(int p_194175_) void
setServerVerifiedBlockState
(BlockPos p_233654_, BlockState p_233655_, int p_233656_) void
setSkyFlashTime
(int p_104783_) boolean
shouldTickDeath
(Entity p_194185_) private void
spawnFluidParticle
(double p_104593_, double p_104594_, double p_104595_, double p_104596_, double p_104597_, ParticleOptions p_104598_) private void
spawnParticle
(BlockPos p_104695_, ParticleOptions p_104696_, VoxelShape p_104697_, double p_104698_) void
syncBlockState
(BlockPos p_233648_, BlockState p_233649_, Vec3 p_233650_) void
tick
(BooleanSupplier p_104727_) void
void
tickNonPassenger
(Entity p_104640_) private void
tickPassenger
(Entity p_104642_, Entity p_104643_) private void
tickTime()
toString()
private void
trySpawnDripParticles
(BlockPos p_104690_, BlockState p_104691_, ParticleOptions p_104692_, boolean p_104693_) void
unload
(LevelChunk p_104666_) Methods inherited from class net.minecraft.world.level.Level
addBlockEntityTicker, addFreshBlockEntities, blockEntityChanged, blockEvent, broadcastDamageEvent, broadcastEntityEvent, close, damageSources, destroyBlock, dimension, dimensionType, dimensionTypeId, dimensionTypeRegistration, explode, explode, explode, explode, explode, explode, getBiomeManager, getBlockEntity, getBlockRandomPos, getBlockState, getChunk, getChunk, getChunkAt, getChunkForCollisions, getCurrentDifficultyAt, getDayTime, getEntities, getEntities, getEntities, getEntities, getFluidState, getGameRules, getGameTime, getHeight, getLightEngine, getMaxEntityRadius, getProfiler, getProfilerSupplier, getRainLevel, getRandom, getSeaLevel, getServer, getSharedSpawnAngle, getSharedSpawnPos, getSkyDarken, getSunAngle, getThunderLevel, getWorldBorder, guardEntityTick, increaseMaxEntityRadius, isClientSide, isDay, isDebug, isFluidAtPosition, isInSpawnableBounds, isInWorldBounds, isLoaded, isNight, isRaining, isRainingAt, isStateAtPosition, isThundering, loadedAndEntityCanStandOn, loadedAndEntityCanStandOnFace, markAndNotifyBlock, mayInteract, neighborChanged, neighborChanged, neighborShapeChanged, nextSubTickCount, noSave, onBlockStateChange, playLocalSound, playSeededSound, playSound, playSound, playSound, playSound, playSound, prepareWeather, registryAccess, removeBlock, removeBlockEntity, setBlock, setBlockAndUpdate, setBlockEntity, setRainLevel, setSpawnSettings, setThunderLevel, shouldTickBlocksAt, shouldTickBlocksAt, tickBlockEntities, updateNeighborsAt, updateNeighborsAtExceptFromFacing, updateNeighbourForOutputSignal, updateSkyBrightness
Methods inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
areAttachmentsCompatible, deserializeAttachments, getData, hasAttachments, hasData, removeData, serializeAttachments, setData
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.BlockAndTintGetter
canSeeSky, getBrightness, getRawBrightness
Methods inherited from interface net.minecraft.world.level.BlockGetter
clip, clipWithInteractionOverride, getBlockFloorHeight, getBlockFloorHeight, getBlockStates, getLightEmission, getMaxLightLevel, isBlockInLine
Methods inherited from interface net.minecraft.world.level.CollisionGetter
collidesWithSuffocatingBlock, findFreePosition, findSupportingBlock, getBlockCollisions, getCollisions, getEntityCollisions, isUnobstructed, isUnobstructed, isUnobstructed, noBlockCollision, noCollision, noCollision, noCollision
Methods inherited from interface net.minecraft.world.level.CommonLevelAccessor
getBlockEntity, getEntityCollisions, getHeightmapPos, isUnobstructed
Methods inherited from interface net.minecraft.world.level.EntityGetter
getEntities, getEntitiesOfClass, getEntitiesOfClass, getNearbyEntities, getNearbyPlayers, getNearestEntity, getNearestEntity, getNearestPlayer, getNearestPlayer, getNearestPlayer, getNearestPlayer, getNearestPlayer, getNearestPlayer, getPlayerByUUID, hasNearbyAlivePlayer
Methods inherited from interface net.neoforged.neoforge.attachment.IAttachmentHolder
getData, hasData, removeData, setData
Methods inherited from interface net.neoforged.neoforge.common.extensions.IBlockGetterExtension
getAuxLightManager, getAuxLightManager
Methods inherited from interface net.neoforged.neoforge.common.extensions.ILevelExtension
getCapability, getCapability, invalidateCapabilities, invalidateCapabilities
Methods inherited from interface net.minecraft.world.level.LevelAccessor
blockUpdated, dayTime, gameEvent, gameEvent, gameEvent, getDifficulty, levelEvent, playSound, scheduleTick, scheduleTick, scheduleTick, scheduleTick
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, getBiome, getBlockStatesIfLoaded, getChunk, getChunk, getHeight, getLightLevelDependentMagicValue, getMaxLocalRawBrightness, getMaxLocalRawBrightness, getMinBuildHeight, getNoiseBiome, getPathfindingCostFromLightLevels, hasChunkAt, hasChunkAt, hasChunksAt, hasChunksAt, hasChunksAt, holderLookup, isAreaLoaded, isEmptyBlock, isWaterAt
Methods inherited from interface net.minecraft.world.level.LevelTimeAccess
getMoonBrightness, getMoonPhase, getTimeOfDay
Methods inherited from interface net.minecraft.world.level.LevelWriter
addFreshEntity, destroyBlock, destroyBlock
Methods inherited from interface net.minecraft.world.level.SignalGetter
getBestNeighborSignal, getControlInputSignal, getDirectSignal, getDirectSignalTo, getSignal, hasNeighborSignal, hasSignal
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
FLUID_PARTICLE_SPAWN_OFFSET
private static final double FLUID_PARTICLE_SPAWN_OFFSET- See Also:
-
NORMAL_LIGHT_UPDATES_PER_FRAME
private static final int NORMAL_LIGHT_UPDATES_PER_FRAME- See Also:
-
LIGHT_UPDATE_QUEUE_SIZE_THRESHOLD
private static final int LIGHT_UPDATE_QUEUE_SIZE_THRESHOLD- See Also:
-
tickingEntities
-
entityStorage
-
connection
-
levelRenderer
-
clientLevelData
-
effects
-
tickRateManager
-
minecraft
-
players
-
scoreboard
-
mapData
-
CLOUD_COLOR
private static final long CLOUD_COLOR- See Also:
-
skyFlashTime
private int skyFlashTime -
tintCaches
private final it.unimi.dsi.fastutil.objects.Object2ObjectArrayMap<ColorResolver,BlockTintCache> tintCaches -
chunkSource
-
lightUpdateQueue
-
serverSimulationDistance
private int serverSimulationDistance -
blockStatePredictionHandler
-
MARKER_PARTICLE_ITEMS
-
partEntities
-
modelDataManager
-
-
Constructor Details
-
ClientLevel
public ClientLevel(ClientPacketListener p_205505_, ClientLevel.ClientLevelData p_205506_, ResourceKey<Level> p_205507_, Holder<DimensionType> p_205508_, int p_205509_, int p_205510_, Supplier<ProfilerFiller> p_205511_, LevelRenderer p_205512_, boolean p_205513_, long p_205514_)
-
-
Method Details
-
handleBlockChangedAck
public void handleBlockChangedAck(int p_233652_) -
setServerVerifiedBlockState
-
syncBlockState
-
getBlockStatePredictionHandler
BlockStatePredictionHandler getBlockStatePredictionHandler() -
setBlock
- Specified by:
setBlock
in interfaceLevelWriter
- Overrides:
setBlock
in classLevel
-
queueLightUpdate
-
pollLightUpdates
public void pollLightUpdates() -
isLightUpdateQueueEmpty
public boolean isLightUpdateQueueEmpty() -
effects
-
tick
-
tickTime
private void tickTime() -
setGameTime
public void setGameTime(long p_104638_) -
setDayTime
public void setDayTime(long p_104747_) -
entitiesForRendering
-
tickEntities
public void tickEntities() -
shouldTickDeath
- Overrides:
shouldTickDeath
in classLevel
-
tickNonPassenger
-
tickPassenger
-
unload
-
onChunkLoaded
-
clearTintCaches
public void clearTintCaches() -
hasChunk
public boolean hasChunk(int p_104737_, int p_104738_) -
getEntityCount
public int getEntityCount() -
addEntity
-
removeEntity
-
getEntity
-
disconnect
public void disconnect()- Overrides:
disconnect
in classLevel
-
animateTick
public void animateTick(int p_104785_, int p_104786_, int p_104787_) -
getMarkerParticleTarget
-
doAnimateTick
public void doAnimateTick(int p_233613_, int p_233614_, int p_233615_, int p_233616_, RandomSource p_233617_, @Nullable Block p_233618_, BlockPos.MutableBlockPos p_233619_) -
trySpawnDripParticles
private void trySpawnDripParticles(BlockPos p_104690_, BlockState p_104691_, ParticleOptions p_104692_, boolean p_104693_) -
spawnParticle
private void spawnParticle(BlockPos p_104695_, ParticleOptions p_104696_, VoxelShape p_104697_, double p_104698_) -
spawnFluidParticle
private void spawnFluidParticle(double p_104593_, double p_104594_, double p_104595_, double p_104596_, double p_104597_, ParticleOptions p_104598_) -
fillReportDetails
- Overrides:
fillReportDetails
in classLevel
-
playSeededSound
public void playSeededSound(@Nullable Player p_263381_, double p_263372_, double p_263404_, double p_263365_, Holder<SoundEvent> p_263335_, SoundSource p_263417_, float p_263416_, float p_263349_, long p_263408_) - Specified by:
playSeededSound
in classLevel
-
playSeededSound
public void playSeededSound(@Nullable Player p_263514_, Entity p_263536_, Holder<SoundEvent> p_263518_, SoundSource p_263487_, float p_263538_, float p_263524_, long p_263509_) - Specified by:
playSeededSound
in classLevel
-
playLocalSound
public void playLocalSound(Entity p_312749_, SoundEvent p_312635_, SoundSource p_312007_, float p_312298_, float p_312772_) - Overrides:
playLocalSound
in classLevel
-
playLocalSound
public void playLocalSound(double p_104600_, double p_104601_, double p_104602_, SoundEvent p_104603_, SoundSource p_104604_, float p_104605_, float p_104606_, boolean p_104607_) - Overrides:
playLocalSound
in classLevel
-
playSound
private void playSound(double p_233603_, double p_233604_, double p_233605_, SoundEvent p_233606_, SoundSource p_233607_, float p_233608_, float p_233609_, boolean p_233610_, long p_233611_) -
createFireworks
public void createFireworks(double p_104585_, double p_104586_, double p_104587_, double p_104588_, double p_104589_, double p_104590_, @Nullable CompoundTag p_104591_) - Overrides:
createFireworks
in classLevel
-
sendPacketToServer
- Overrides:
sendPacketToServer
in classLevel
-
getRecipeManager
- Specified by:
getRecipeManager
in classLevel
-
tickRateManager
- Specified by:
tickRateManager
in classLevel
-
setScoreboard
-
getBlockTicks
-
getFluidTicks
-
getChunkSource
-
getMapData
- Specified by:
getMapData
in classLevel
-
overrideMapData
-
setMapData
- Specified by:
setMapData
in classLevel
-
getFreeMapId
public int getFreeMapId()- Specified by:
getFreeMapId
in classLevel
-
getScoreboard
- Specified by:
getScoreboard
in classLevel
-
sendBlockUpdated
public void sendBlockUpdated(BlockPos p_104685_, BlockState p_104686_, BlockState p_104687_, int p_104688_) - Specified by:
sendBlockUpdated
in classLevel
-
setBlocksDirty
- Overrides:
setBlocksDirty
in classLevel
-
setSectionDirtyWithNeighbors
public void setSectionDirtyWithNeighbors(int p_104794_, int p_104795_, int p_104796_) -
destroyBlockProgress
- Specified by:
destroyBlockProgress
in classLevel
-
globalLevelEvent
- Overrides:
globalLevelEvent
in classLevel
-
levelEvent
-
addParticle
public void addParticle(ParticleOptions p_104706_, double p_104707_, double p_104708_, double p_104709_, double p_104710_, double p_104711_, double p_104712_) - Specified by:
addParticle
in interfaceLevelAccessor
- Overrides:
addParticle
in classLevel
-
addParticle
public void addParticle(ParticleOptions p_104714_, boolean p_104715_, double p_104716_, double p_104717_, double p_104718_, double p_104719_, double p_104720_, double p_104721_) - Overrides:
addParticle
in classLevel
-
addAlwaysVisibleParticle
public void addAlwaysVisibleParticle(ParticleOptions p_104766_, double p_104767_, double p_104768_, double p_104769_, double p_104770_, double p_104771_, double p_104772_) - Overrides:
addAlwaysVisibleParticle
in classLevel
-
addAlwaysVisibleParticle
public void addAlwaysVisibleParticle(ParticleOptions p_104774_, boolean p_104775_, double p_104776_, double p_104777_, double p_104778_, double p_104779_, double p_104780_, double p_104781_) - Overrides:
addAlwaysVisibleParticle
in classLevel
-
players
-
getUncachedNoiseBiome
-
getSkyDarken
public float getSkyDarken(float p_104806_) -
getSkyColor
-
getCloudColor
-
getStarBrightness
public float getStarBrightness(float p_104812_) -
getSkyFlashTime
public int getSkyFlashTime() -
setSkyFlashTime
public void setSkyFlashTime(int p_104783_) - Overrides:
setSkyFlashTime
in classLevel
-
getShade
-
getBlockTint
-
calculateBlockTint
-
setDefaultSpawnPos
-
toString
-
getLevelData
- Specified by:
getLevelData
in interfaceLevelAccessor
- Overrides:
getLevelData
in classLevel
-
gameEvent
-
getAllMapData
-
addMapData
-
getEntities
- Specified by:
getEntities
in classLevel
-
gatherChunkSourceStats
- Specified by:
gatherChunkSourceStats
in classLevel
-
addDestroyBlockEffect
- Overrides:
addDestroyBlockEffect
in classLevel
-
setServerSimulationDistance
public void setServerSimulationDistance(int p_194175_) -
getServerSimulationDistance
public int getServerSimulationDistance() -
enabledFeatures
-
getPartEntities
Description copied from interface:ILevelExtension
All part entities in this world. Used when collecting entities in an AABB to fix parts being ignored whose parent entity is in a chunk that does not intersect with the AABB. -
getModelDataManager
Description copied from interface:IBlockGetterExtension
Retrieves the model data manager for this level. This will benull
on a server level.- Specified by:
getModelDataManager
in interfaceIBlockGetterExtension
- Overrides:
getModelDataManager
in classLevel
-
getShade
public float getShade(float normalX, float normalY, float normalZ, boolean shade) Description copied from interface:IBlockAndTintGetterExtension
Computes the shade for a given normal. Alternate version of the vanilla method taking in aDirection
.
-