Class BattleSceneClientLevel
java.lang.Object
net.neoforged.neoforge.attachment.AttachmentHolder
net.minecraft.world.level.Level
net.minecraft.client.multiplayer.ClientLevel
com.pixelmonmod.pixelmon.client.render.battle.BattleSceneClientLevel
- All Implemented Interfaces:
AutoCloseable,net.minecraft.world.level.biome.BiomeManager.NoiseBiomeSource,net.minecraft.world.level.BlockAndTintGetter,net.minecraft.world.level.BlockGetter,net.minecraft.world.level.CollisionGetter,net.minecraft.world.level.CommonLevelAccessor,net.minecraft.world.level.EntityGetter,net.minecraft.world.level.LevelAccessor,net.minecraft.world.level.LevelHeightAccessor,net.minecraft.world.level.LevelReader,net.minecraft.world.level.LevelSimulatedReader,net.minecraft.world.level.LevelSimulatedRW,net.minecraft.world.level.LevelTimeAccess,net.minecraft.world.level.LevelWriter,net.minecraft.world.level.SignalGetter,net.neoforged.neoforge.attachment.IAttachmentHolder,net.neoforged.neoforge.common.extensions.IBlockAndTintGetterExtension,net.neoforged.neoforge.common.extensions.IBlockGetterExtension,net.neoforged.neoforge.common.extensions.ILevelExtension,net.neoforged.neoforge.common.extensions.ILevelReaderExtension
public class BattleSceneClientLevel
extends net.minecraft.client.multiplayer.ClientLevel
Client-only level used to render a battle scene instead of the player's current world.
The level is populated from BattleSceneData sent by the server, keeping multiplayer clients independent
from server-only structure data.
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.client.multiplayer.ClientLevel
net.minecraft.client.multiplayer.ClientLevel.ClientLevelDataNested classes/interfaces inherited from class net.minecraft.world.level.Level
net.minecraft.world.level.Level.ExplosionInteractionNested classes/interfaces inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
net.neoforged.neoforge.attachment.AttachmentHolder.AsField -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final net.minecraft.resources.ResourceLocationFields inherited from class net.minecraft.client.multiplayer.ClientLevel
chunkSourceFields 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_DAYFields inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
ATTACHMENTS_NBT_KEYFields inherited from interface net.neoforged.neoforge.common.extensions.ILevelExtension
TRANSLATION_PREFIXFields inherited from interface net.minecraft.world.level.SignalGetter
DIRECTIONS -
Constructor Summary
ConstructorsConstructorDescriptionBattleSceneClientLevel(BattleSceneData sceneData) Creates a scene level from server-built battle scene data. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPositionedSceneEntity(net.minecraft.world.entity.Entity entity, net.minecraft.world.phys.Vec3 originalPosition, net.minecraft.world.phys.Vec3 scenePosition) Adds an entity to the scene render list and records how it was moved from the real world into the scene.voidaddSceneEntity(net.minecraft.world.entity.Entity entity) Adds an entity to the scene render list without recording a world-to-scene position mapping.voidClears transient scene entities and their recorded world-to-scene position mappings.Iterable<net.minecraft.world.entity.Entity> net.minecraft.core.Holder<net.minecraft.world.level.biome.Biome> getBiome(net.minecraft.core.BlockPos pos) intgetBrightness(net.minecraft.world.level.LightLayer lightType, net.minecraft.core.BlockPos blockPos) longnet.minecraft.world.entity.EntitygetEntity(int id) net.minecraft.core.Holder<net.minecraft.world.level.biome.Biome> getNoiseBiome(int x, int y, int z) floatgetRainLevel(float partialTick) intgetRawBrightness(net.minecraft.core.BlockPos blockPos, int amount) floatgetShade(float normalX, float normalY, float normalZ, boolean shade) floatgetShade(net.minecraft.core.Direction direction, boolean shade) net.minecraft.world.phys.Vec3getSkyColor(net.minecraft.world.phys.Vec3 pos, float partialTick) floatgetThunderLevel(float partialTick) booleanbooleanFinds the first marker of a type in this scene.Finds the first marker matching both type and id in this scene.markers()Finds markers of a type in this scene.Optional<net.minecraft.world.phys.Vec3> originalEntityPosition(UUID entityUUID) Finds the original world position for a scene-positioned entity.net.minecraft.core.BlockPosnet.minecraft.resources.ResourceLocationscene()net.minecraft.world.phys.Vec3sceneAnimationPosition(net.minecraft.world.entity.Entity entity, net.minecraft.world.phys.Vec3 offset) Applies the same world-to-scene offset to an animation entity while preserving its own movement.Optional<net.minecraft.world.phys.Vec3> sceneEntityPosition(UUID entityUUID) Finds the scene position for a scene-positioned entity.net.minecraft.world.level.block.state.BlockStatesetTemporaryBlock(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state) Applies a transient scene block change and returns the previous scene block state.Methods inherited from class net.minecraft.client.multiplayer.ClientLevel
addAlwaysVisibleParticle, addAlwaysVisibleParticle, addDestroyBlockEffect, addEntity, addMapData, addParticle, addParticle, animateTick, calculateBlockTint, clearTintCaches, createFireworks, destroyBlockProgress, disconnect, doAnimateTick, effects, enabledFeatures, fillReportDetails, gameEvent, gatherChunkSourceStats, getAllMapData, getBlockTicks, getBlockTint, getChunkSource, getCloudColor, getDayTimeFraction, getDayTimePerTick, getEntities, getEntityCount, getFluidTicks, getFreeMapId, getLevelData, getMapData, getModelData, getModelDataManager, getPartEntities, getRecipeManager, getScoreboard, getServerSimulationDistance, getSkyDarken, getSkyFlashTime, getStarBrightness, getUncachedNoiseBiome, globalLevelEvent, handleBlockChangedAck, hasChunk, isLightUpdateQueueEmpty, levelEvent, onChunkLoaded, overrideMapData, players, playLocalSound, playLocalSound, playSeededSound, playSeededSound, pollLightUpdates, potionBrewing, queueLightUpdate, removeEntity, sendBlockUpdated, sendPacketToServer, setBlock, setBlocksDirty, setDayTime, setDayTimeFraction, setDayTimePerTick, setDefaultSpawnPos, setGameTime, setMapData, setSectionDirtyWithNeighbors, setServerSimulationDistance, setServerVerifiedBlockState, setSkyFlashTime, shouldTickDeath, syncBlockState, tick, tickEntities, tickNonPassenger, tickRateManager, toString, unloadMethods inherited from class net.minecraft.world.level.Level
addBlockEntityTicker, addFreshBlockEntities, advanceDaytime, blockEntityChanged, blockEvent, broadcastDamageEvent, broadcastEntityEvent, close, damageSources, destroyBlock, dimension, dimensionType, dimensionTypeRegistration, explode, explode, explode, explode, explode, explode, getBiomeManager, getBlockEntity, getBlockRandomPos, getBlockState, getChunk, getChunk, getChunkAt, getChunkForCollisions, getCurrentDifficultyAt, getEntities, getEntities, getEntities, getEntities, getFluidState, getGameRules, getGameTime, getHeight, getLightEngine, getMaxEntityRadius, getProfiler, getProfilerSupplier, getRandom, getSeaLevel, getServer, getSharedSpawnAngle, getSharedSpawnPos, getSkyDarken, getSunAngle, getWorldBorder, guardEntityTick, increaseMaxEntityRadius, isClientSide, isDay, isDebug, isFluidAtPosition, isInSpawnableBounds, isInWorldBounds, isLoaded, isNight, isRainingAt, isStateAtPosition, loadedAndEntityCanStandOn, loadedAndEntityCanStandOnFace, markAndNotifyBlock, mayInteract, neighborChanged, neighborChanged, neighborShapeChanged, nextSubTickCount, noSave, onBlockStateChange, playLocalSound, playSeededSound, playSound, playSound, playSound, playSound, playSound, playSound, prepareWeather, registryAccess, removeBlock, removeBlockEntity, setBlock, setBlockAndUpdate, setBlockEntity, setRainLevel, setSpawnSettings, setThunderLevel, shouldTickBlocksAt, shouldTickBlocksAt, tickBlockEntities, updateNeighborsAt, updateNeighborsAtExceptFromFacing, updateNeighbourForOutputSignal, updateSkyBrightnessMethods inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
deserializeAttachments, getData, getExistingDataOrNull, hasAttachments, hasData, removeData, serializeAttachments, setDataMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.world.level.BlockAndTintGetter
canSeeSkyMethods inherited from interface net.minecraft.world.level.BlockGetter
clip, clipWithInteractionOverride, getBlockFloorHeight, getBlockFloorHeight, getBlockStates, getLightEmission, getMaxLightLevel, isBlockInLineMethods inherited from interface net.minecraft.world.level.CollisionGetter
collidesWithSuffocatingBlock, findFreePosition, findSupportingBlock, getBlockCollisions, getCollisions, getEntityCollisions, isUnobstructed, isUnobstructed, isUnobstructed, noBlockCollision, noCollision, noCollision, noCollisionMethods inherited from interface net.minecraft.world.level.CommonLevelAccessor
getBlockEntity, getEntityCollisions, getHeightmapPos, isUnobstructedMethods inherited from interface net.minecraft.world.level.EntityGetter
getEntities, getEntitiesOfClass, getEntitiesOfClass, getNearbyEntities, getNearbyPlayers, getNearestEntity, getNearestEntity, getNearestPlayer, getNearestPlayer, getNearestPlayer, getNearestPlayer, getNearestPlayer, getNearestPlayer, getPlayerByUUID, hasNearbyAlivePlayerMethods inherited from interface net.neoforged.neoforge.attachment.IAttachmentHolder
getData, getExistingData, getExistingData, getExistingDataOrNull, hasData, removeData, setData, syncData, syncDataMethods inherited from interface net.neoforged.neoforge.common.extensions.IBlockGetterExtension
getAuxLightManager, getAuxLightManagerMethods inherited from interface net.neoforged.neoforge.common.extensions.ILevelExtension
getCapability, getCapability, getCapability, getCapability, getDescription, getDescriptionKey, invalidateCapabilities, invalidateCapabilitiesMethods inherited from interface net.neoforged.neoforge.common.extensions.ILevelReaderExtension
holder, holderOrThrow, isAreaLoadedMethods inherited from interface net.minecraft.world.level.LevelAccessor
blockUpdated, dayTime, gameEvent, gameEvent, gameEvent, gameEvent, getDifficulty, levelEvent, playSound, scheduleTick, scheduleTick, scheduleTick, scheduleTickMethods inherited from interface net.minecraft.world.level.LevelHeightAccessor
getMaxBuildHeight, getMaxSection, getMinSection, getSectionIndex, getSectionIndexFromSectionY, getSectionsCount, getSectionYFromSectionIndex, isOutsideBuildHeight, isOutsideBuildHeightMethods inherited from interface net.minecraft.world.level.LevelReader
canSeeSkyFromBelowWater, containsAnyLiquid, getBlockStatesIfLoaded, getChunk, getChunk, getHeight, getLightLevelDependentMagicValue, getMaxLocalRawBrightness, getMaxLocalRawBrightness, getMinBuildHeight, getPathfindingCostFromLightLevels, hasChunkAt, hasChunkAt, hasChunksAt, hasChunksAt, hasChunksAt, holderLookup, isEmptyBlock, isWaterAtMethods inherited from interface net.minecraft.world.level.LevelTimeAccess
getMoonBrightness, getMoonPhase, getTimeOfDayMethods inherited from interface net.minecraft.world.level.LevelWriter
addFreshEntity, destroyBlock, destroyBlockMethods inherited from interface net.minecraft.world.level.SignalGetter
getBestNeighborSignal, getControlInputSignal, getDirectSignal, getDirectSignalTo, getSignal, hasNeighborSignal, hasSignal
-
Field Details
-
DEBUG_SCENE
public static final net.minecraft.resources.ResourceLocation DEBUG_SCENE
-
-
Constructor Details
-
BattleSceneClientLevel
Creates a scene level from server-built battle scene data.- Parameters:
sceneData- the blocks, markers, and render settings to expose through this client level
-
-
Method Details
-
scene
public net.minecraft.resources.ResourceLocation scene()- Returns:
- the active battle scene definition id
-
renderSettings
- Returns:
- render settings resolved from the server-side scene definition
-
playerAnchor
public net.minecraft.core.BlockPos playerAnchor()- Returns:
- the world position where the scene's
player_posmarker is anchored
-
markers
- Returns:
- all parsed markers in this scene
-
markers
Finds markers of a type in this scene.- Parameters:
type- the marker type to match- Returns:
- matching markers, or an empty list when none exist
-
marker
Finds the first marker of a type in this scene.- Parameters:
type- the marker type to match- Returns:
- the first matching marker
-
marker
Finds the first marker matching both type and id in this scene.- Parameters:
type- the marker type to matchid- the marker id to match- Returns:
- the first matching marker
-
setTemporaryBlock
public net.minecraft.world.level.block.state.BlockState setTemporaryBlock(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state) Applies a transient scene block change and returns the previous scene block state.- Parameters:
pos- the scene-local block positionstate- the state to render at the position- Returns:
- the previous state at the position
-
addSceneEntity
public void addSceneEntity(net.minecraft.world.entity.Entity entity) Adds an entity to the scene render list without recording a world-to-scene position mapping.- Parameters:
entity- the entity to render in the battle scene
-
addPositionedSceneEntity
public void addPositionedSceneEntity(net.minecraft.world.entity.Entity entity, net.minecraft.world.phys.Vec3 originalPosition, net.minecraft.world.phys.Vec3 scenePosition) Adds an entity to the scene render list and records how it was moved from the real world into the scene.- Parameters:
entity- the entity to render in the battle sceneoriginalPosition- the entity position in the real client worldscenePosition- the entity position in the battle scene
-
originalEntityPosition
Finds the original world position for a scene-positioned entity.- Parameters:
entityUUID- the entity uuid to look up- Returns:
- the recorded original world position
-
sceneEntityPosition
Finds the scene position for a scene-positioned entity.- Parameters:
entityUUID- the entity uuid to look up- Returns:
- the recorded scene position
-
sceneAnimationPosition
public net.minecraft.world.phys.Vec3 sceneAnimationPosition(net.minecraft.world.entity.Entity entity, net.minecraft.world.phys.Vec3 offset) Applies the same world-to-scene offset to an animation entity while preserving its own movement.- Parameters:
entity- the animation entity to positionoffset- the offset from the source entity's original world position to its scene position- Returns:
- the animation entity's updated scene position
-
clearSceneEntities
public void clearSceneEntities()Clears transient scene entities and their recorded world-to-scene position mappings. -
entitiesForRendering
- Overrides:
entitiesForRenderingin classnet.minecraft.client.multiplayer.ClientLevel
-
getEntity
public net.minecraft.world.entity.Entity getEntity(int id) - Overrides:
getEntityin classnet.minecraft.client.multiplayer.ClientLevel
-
getSkyColor
public net.minecraft.world.phys.Vec3 getSkyColor(net.minecraft.world.phys.Vec3 pos, float partialTick) - Overrides:
getSkyColorin classnet.minecraft.client.multiplayer.ClientLevel
-
getDayTime
public long getDayTime()- Overrides:
getDayTimein classnet.minecraft.world.level.Level
-
getRainLevel
public float getRainLevel(float partialTick) - Overrides:
getRainLevelin classnet.minecraft.world.level.Level
-
getThunderLevel
public float getThunderLevel(float partialTick) - Overrides:
getThunderLevelin classnet.minecraft.world.level.Level
-
isRaining
public boolean isRaining()- Overrides:
isRainingin classnet.minecraft.world.level.Level
-
isThundering
public boolean isThundering()- Overrides:
isThunderingin classnet.minecraft.world.level.Level
-
getNoiseBiome
public net.minecraft.core.Holder<net.minecraft.world.level.biome.Biome> getNoiseBiome(int x, int y, int z) -
getBiome
public net.minecraft.core.Holder<net.minecraft.world.level.biome.Biome> getBiome(net.minecraft.core.BlockPos pos) -
getShade
public float getShade(net.minecraft.core.Direction direction, boolean shade) - Specified by:
getShadein interfacenet.minecraft.world.level.BlockAndTintGetter- Overrides:
getShadein classnet.minecraft.client.multiplayer.ClientLevel
-
getShade
public float getShade(float normalX, float normalY, float normalZ, boolean shade) - Specified by:
getShadein interfacenet.neoforged.neoforge.common.extensions.IBlockAndTintGetterExtension- Overrides:
getShadein classnet.minecraft.client.multiplayer.ClientLevel
-
getBrightness
public int getBrightness(net.minecraft.world.level.LightLayer lightType, net.minecraft.core.BlockPos blockPos) -
getRawBrightness
public int getRawBrightness(net.minecraft.core.BlockPos blockPos, int amount)
-