Package net.minecraft.client.world
Class ClientWorld
java.lang.Object
net.minecraft.world.World
net.minecraft.client.world.ClientWorld
- All Implemented Interfaces:
AutoCloseable,class_5423,BiomeAccess.Storage,BlockRenderView,BlockView,CollisionView,EntityView,LunarWorldView,ModifiableTestableWorld,ModifiableWorld,TestableWorld,WorldAccess,WorldView
@Environment(CLIENT) public class ClientWorld extends World
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classClientWorld.Properties -
Field Summary
Fields Modifier and Type Field Description private ClientChunkManagerchunkManagerprivate MinecraftClientclientprivate ClientWorld.PropertiesclientWorldPropertiesprivate Object2ObjectArrayMap<ColorResolver,BiomeColorCache>colorCacheprivate intlightningTicksLeftprivate Map<String,MapState>mapStatesprivate ClientPlayNetworkHandlernetHandlerprivate List<AbstractClientPlayerEntity>playersprivate Int2ObjectMap<Entity>regularEntitiesprivate Scoreboardscoreboardprivate SkyPropertiesskyPropertiesprivate WorldRendererworldRendererFields inherited from class net.minecraft.world.World
blockEntities, CODEC, END, isClient, iteratingTickingBlockEntities, lcgBlockSeed, LOGGER, NETHER, OVERWORLD, pendingBlockEntities, properties, rainGradient, rainGradientPrev, random, thunderGradient, thunderGradientPrev, tickingBlockEntities, unloadedBlockEntities, unusedIncrement -
Constructor Summary
Constructors Constructor Description ClientWorld(ClientPlayNetworkHandler networkHandler, ClientWorld.Properties properties, RegistryKey<World> registryRef, DimensionType dimensionType, int loadDistance, Supplier<Profiler> profiler, WorldRenderer worldRenderer, boolean debugWorld, long seed) -
Method Summary
Modifier and Type Method Description CrashReportSectionaddDetailsToCrashReport(CrashReport report)voidaddEntitiesToChunk(WorldChunk chunk)voidaddEntity(int id, Entity entity)private voidaddEntityPrivate(int id, Entity entity)voidaddFireworkParticle(double x, double y, double z, double velocityX, double velocityY, double velocityZ, CompoundTag tag)voidaddImportantParticle(ParticleEffect parameters, boolean alwaysSpawn, double x, double y, double z, double velocityX, double velocityY, double velocityZ)voidaddImportantParticle(ParticleEffect parameters, double x, double y, double z, double velocityX, double velocityY, double velocityZ)private voidaddParticle(double minX, double maxX, double minZ, double maxZ, double y, ParticleEffect parameters)voidaddParticle(ParticleEffect parameters, boolean alwaysSpawn, double x, double y, double z, double velocityX, double velocityY, double velocityZ)voidaddParticle(ParticleEffect parameters, double x, double y, double z, double velocityX, double velocityY, double velocityZ)private voidaddParticle(BlockPos pos, BlockState state, ParticleEffect parameters, boolean bool)private voidaddParticle(BlockPos pos, ParticleEffect parameters, VoxelShape shape, double y)voidaddPlayer(int id, AbstractClientPlayerEntity player)intcalculateColor(BlockPos pos, ColorResolver colorResolver)private voidcheckEntityChunkPos(Entity entity)Validates if an entity's current position matches its chunk position.voiddisconnect()voiddoRandomBlockDisplayTicks(int xCenter, int yCenter, int zCenter)voidfinishRemovingEntities()private voidfinishRemovingEntity(Entity entity)TickScheduler<Block>getBlockTickScheduler()floatgetBrightness(Direction direction, boolean shaded)ClientChunkManagergetChunkManager()Vec3dgetCloudsColor(float tickDelta)intgetColor(BlockPos pos, ColorResolver colorResolver)Iterable<Entity>getEntities()EntitygetEntityById(int id)TickScheduler<Fluid>getFluidTickScheduler()BiomegetGeneratorStoredBiome(int biomeX, int biomeY, int biomeZ)ClientWorld.PropertiesgetLevelProperties()intgetLightningTicksLeft()MapStategetMapState(String id)intgetNextMapId()List<AbstractClientPlayerEntity>getPlayers()RecipeManagergetRecipeManager()DynamicRegistryManagergetRegistryManager()intgetRegularEntityCount()ScoreboardgetScoreboard()SkyPropertiesgetSkyProperties()BlockPosgetSpawnPos()TagManagergetTagManager()booleanisChunkLoaded(int chunkX, int chunkZ)Vec3dmethod_23777(BlockPos blockPos, float float2)floatmethod_23783(float float2)floatmethod_23787(float float2)voidmethod_29089(long long2)floatmethod_30671()voidplaySound(double x, double y, double z, SoundEvent sound, SoundCategory category, float volume, float pitch, boolean bool)voidplaySound(PlayerEntity player, double x, double y, double z, SoundEvent sound, SoundCategory category, float volume, float pitch)voidplaySound(BlockPos pos, SoundEvent sound, SoundCategory category, float volume, float pitch, boolean useDistance)voidplaySoundFromEntity(PlayerEntity player, Entity entity, SoundEvent sound, SoundCategory category, float volume, float pitch)voidputMapState(MapState mapState)voidrandomBlockDisplayTick(int xCenter, int yCenter, int zCenter, int radius, Random random, boolean spawnBarrierParticles, BlockPos.Mutable pos)voidreloadColor()voidremoveEntity(int entityId)voidresetChunkColor(int int2, int int3)voidscheduleBlockRenders(int x, int y, int z)voidscheduleBlockRerenderIfNeeded(BlockPos pos, BlockState old, BlockState updated)voidsendPacket(Packet<?> packet)voidsetBlockBreakingInfo(int entityId, BlockPos pos, int progress)voidsetBlockStateWithoutNeighborUpdates(BlockPos pos, BlockState state)voidsetLightningTicksLeft(int lightningTicksLeft)voidsetScoreboard(Scoreboard scoreboard)voidsetSpawnPos(BlockPos pos, float angle)voidsetTimeOfDay(long long2)voidsyncGlobalEvent(int eventId, BlockPos pos, int data)voidsyncWorldEvent(PlayerEntity player, int eventId, BlockPos pos, int data)voidtick(BooleanSupplier shouldKeepTicking)voidtickEntities()voidtickEntity(Entity entity)voidtickPassenger(Entity entity, Entity passenger)private voidtickTime()StringtoString()voidunloadBlockEntities(WorldChunk chunk)voidupdateListeners(BlockPos pos, BlockState oldState, BlockState newState, int flags)Methods inherited from class net.minecraft.world.World
addBlockEntities, addBlockEntity, addSyncedBlockEvent, breakBlock, calculateAmbientDarkness, canPlayerModifyAt, canSetBlock, close, createExplosion, createExplosion, createExplosion, getAmbientDarkness, getBiomeAccess, getBlockEntity, getBlockState, getChunk, getChunk, getDebugString, getDimension, getEmittedRedstonePower, getEntitiesByClass, getEntitiesByType, getEntitiesIncludingUngeneratedChunks, getExistingChunk, getFluidState, getGameRules, getLightingProvider, getLocalDifficulty, getOtherEntities, getProfiler, getProfilerSupplier, getRainGradient, getRandom, getRandomPosInChunk, getReceivedRedstonePower, getReceivedStrongRedstonePower, getRegistryKey, getSeaLevel, getServer, getSkyAngleRadians, getThunderGradient, getTime, getTimeOfDay, getTopY, getWorldBorder, getWorldChunk, hasHighHumidity, hasRain, initWeatherGradients, isClient, isDay, isDebugWorld, isDirectionSolid, isEmittingRedstonePower, isInBuildLimit, isNight, isOutOfBuildLimitVertically, isOutOfBuildLimitVertically, isRaining, isReceivingRedstonePower, isSavingDisabled, isThundering, isTopSolid, isValid, markDirty, onBlockChanged, playSound, removeBlock, removeBlockEntity, sendEntityStatus, setBlockEntity, setBlockState, setBlockState, setBlockState, 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, getLightLevel, isSkyVisibleMethods inherited from interface net.minecraft.world.BlockView
getDismountHeight, getDismountHeight, 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, intersectsEntities, intersectsEntities, isBlockSpaceEmpty, isSpaceEmpty, isSpaceEmpty, isSpaceEmpty, isSpaceEmptyMethods inherited from interface net.minecraft.world.EntityView
getClosestEntity, getClosestEntity, getClosestEntityIncludingUngeneratedChunks, getClosestPlayer, getClosestPlayer, getClosestPlayer, getClosestPlayer, getClosestPlayer, getClosestPlayer, getEntitiesIncludingUngeneratedChunks, getNonSpectatingEntities, getOtherEntities, getPlayerByUuid, getPlayers, getTargets, isPlayerInRangeMethods inherited from interface net.minecraft.world.LunarWorldView
getMoonPhase, getMoonSize, getSkyAngleMethods inherited from interface net.minecraft.world.ModifiableWorld
breakBlock, breakBlock, spawnEntityMethods inherited from interface net.minecraft.world.WorldAccess
getDifficulty, getDimensionHeight, getLunarTime, syncWorldEvent, updateNeighborsMethods inherited from interface net.minecraft.world.WorldView
containsFluid, getBiome, getBiomeForNoiseGen, getBrightness, getChunk, getChunk, getLightLevel, getLightLevel, getStrongRedstonePower, isAir, isChunkLoaded, isRegionLoaded, isRegionLoaded, isSkyVisibleAllowingSea, isWater, method_29556
-
Field Details
-
regularEntities
-
netHandler
-
worldRenderer
-
clientWorldProperties
-
skyProperties
-
client
-
players
-
scoreboard
-
mapStates
-
lightningTicksLeft
private int lightningTicksLeft -
colorCache
-
chunkManager
-
-
Constructor Details
-
ClientWorld
public ClientWorld(ClientPlayNetworkHandler networkHandler, ClientWorld.Properties properties, RegistryKey<World> registryRef, DimensionType dimensionType, int loadDistance, Supplier<Profiler> profiler, WorldRenderer worldRenderer, boolean debugWorld, long seed)
-
-
Method Details
-
getSkyProperties
-
tick
-
tickTime
private void tickTime() -
method_29089
public void method_29089(long long2) -
setTimeOfDay
public void setTimeOfDay(long long2) -
getEntities
-
tickEntities
public void tickEntities() -
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. -
unloadBlockEntities
-
resetChunkColor
public void resetChunkColor(int int2, int int3) -
reloadColor
public void reloadColor() -
isChunkLoaded
public boolean isChunkLoaded(int chunkX, int chunkZ) -
getRegularEntityCount
public int getRegularEntityCount() -
addPlayer
-
addEntity
-
addEntityPrivate
-
removeEntity
public void removeEntity(int entityId) -
finishRemovingEntity
-
addEntitiesToChunk
-
getEntityById
- Specified by:
getEntityByIdin classWorld
-
setBlockStateWithoutNeighborUpdates
-
disconnect
public void disconnect()- Overrides:
disconnectin classWorld
-
doRandomBlockDisplayTicks
public void doRandomBlockDisplayTicks(int xCenter, int yCenter, int zCenter) -
randomBlockDisplayTick
public void randomBlockDisplayTick(int xCenter, int yCenter, int zCenter, int radius, Random random, boolean spawnBarrierParticles, BlockPos.Mutable pos) -
addParticle
-
addParticle
-
addParticle
private void addParticle(double minX, double maxX, double minZ, double maxZ, double y, ParticleEffect parameters) -
finishRemovingEntities
public void finishRemovingEntities() -
addDetailsToCrashReport
- Overrides:
addDetailsToCrashReportin 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
-
playSound
public void playSound(BlockPos pos, SoundEvent sound, SoundCategory category, float volume, float pitch, boolean useDistance) -
playSound
public void playSound(double x, double y, double z, SoundEvent sound, SoundCategory category, float volume, float pitch, boolean bool) -
addFireworkParticle
public void addFireworkParticle(double x, double y, double z, double velocityX, double velocityY, double velocityZ, @Nullable CompoundTag tag)- Overrides:
addFireworkParticlein classWorld
-
sendPacket
- Overrides:
sendPacketin classWorld
-
getRecipeManager
- Specified by:
getRecipeManagerin classWorld
-
setScoreboard
-
getBlockTickScheduler
-
getFluidTickScheduler
-
getChunkManager
-
getMapState
- Specified by:
getMapStatein classWorld
-
putMapState
- Specified by:
putMapStatein classWorld
-
getNextMapId
public int getNextMapId()- Specified by:
getNextMapIdin classWorld
-
getScoreboard
- Specified by:
getScoreboardin classWorld
-
getTagManager
- Specified by:
getTagManagerin classWorld
-
getRegistryManager
-
updateListeners
- Specified by:
updateListenersin classWorld
-
scheduleBlockRerenderIfNeeded
- Overrides:
scheduleBlockRerenderIfNeededin classWorld
-
scheduleBlockRenders
public void scheduleBlockRenders(int x, int y, int z) -
setBlockBreakingInfo
- Specified by:
setBlockBreakingInfoin classWorld
-
syncGlobalEvent
- Overrides:
syncGlobalEventin classWorld
-
syncWorldEvent
-
addParticle
public void addParticle(ParticleEffect parameters, double x, double y, double z, double velocityX, double velocityY, double velocityZ)- Specified by:
addParticlein interfaceWorldAccess- Overrides:
addParticlein classWorld
-
addParticle
public void addParticle(ParticleEffect parameters, boolean alwaysSpawn, double x, double y, double z, double velocityX, double velocityY, double velocityZ)- Overrides:
addParticlein classWorld
-
addImportantParticle
public void addImportantParticle(ParticleEffect parameters, double x, double y, double z, double velocityX, double velocityY, double velocityZ)- Overrides:
addImportantParticlein classWorld
-
addImportantParticle
public void addImportantParticle(ParticleEffect parameters, boolean alwaysSpawn, double x, double y, double z, double velocityX, double velocityY, double velocityZ)- Overrides:
addImportantParticlein classWorld
-
getPlayers
-
getGeneratorStoredBiome
-
method_23783
public float method_23783(float float2) -
method_23777
-
getCloudsColor
-
method_23787
public float method_23787(float float2) -
getLightningTicksLeft
public int getLightningTicksLeft() -
setLightningTicksLeft
public void setLightningTicksLeft(int lightningTicksLeft)- Overrides:
setLightningTicksLeftin classWorld
-
getBrightness
-
getColor
-
calculateColor
-
getSpawnPos
-
method_30671
public float method_30671() -
setSpawnPos
-
toString
-
getLevelProperties
- Specified by:
getLevelPropertiesin interfaceWorldAccess- Overrides:
getLevelPropertiesin classWorld
-