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.ClientLevelData

    Nested classes/interfaces inherited from class net.minecraft.world.level.Level

    net.minecraft.world.level.Level.ExplosionInteraction

    Nested classes/interfaces inherited from class net.neoforged.neoforge.attachment.AttachmentHolder

    net.neoforged.neoforge.attachment.AttachmentHolder.AsField
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final net.minecraft.resources.ResourceLocation
     

    Fields inherited from class net.minecraft.client.multiplayer.ClientLevel

    chunkSource

    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.neoforged.neoforge.common.extensions.ILevelExtension

    TRANSLATION_PREFIX

    Fields inherited from interface net.minecraft.world.level.SignalGetter

    DIRECTIONS
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a scene level from server-built battle scene data.
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    void
    addSceneEntity(net.minecraft.world.entity.Entity entity)
    Adds an entity to the scene render list without recording a world-to-scene position mapping.
    void
    Clears 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)
     
    int
    getBrightness(net.minecraft.world.level.LightLayer lightType, net.minecraft.core.BlockPos blockPos)
     
    long
     
    net.minecraft.world.entity.Entity
    getEntity(int id)
     
    net.minecraft.core.Holder<net.minecraft.world.level.biome.Biome>
    getNoiseBiome(int x, int y, int z)
     
    float
    getRainLevel(float partialTick)
     
    int
    getRawBrightness(net.minecraft.core.BlockPos blockPos, int amount)
     
    float
    getShade(float normalX, float normalY, float normalZ, boolean shade)
     
    float
    getShade(net.minecraft.core.Direction direction, boolean shade)
     
    net.minecraft.world.phys.Vec3
    getSkyColor(net.minecraft.world.phys.Vec3 pos, float partialTick)
     
    float
    getThunderLevel(float partialTick)
     
    boolean
     
    boolean
     
    marker(String type)
    Finds the first marker of a type in this scene.
    marker(String type, String id)
    Finds the first marker matching both type and id in this scene.
     
    Finds markers of a type in this scene.
    Optional<net.minecraft.world.phys.Vec3>
    Finds the original world position for a scene-positioned entity.
    net.minecraft.core.BlockPos
     
     
    net.minecraft.resources.ResourceLocation
     
    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.
    Optional<net.minecraft.world.phys.Vec3>
    Finds the scene position for a scene-positioned entity.
    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.

    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, unload

    Methods 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, updateSkyBrightness

    Methods inherited from class net.neoforged.neoforge.attachment.AttachmentHolder

    deserializeAttachments, getData, getExistingDataOrNull, 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

    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, getExistingData, getExistingData, getExistingDataOrNull, hasData, removeData, setData, syncData, syncData

    Methods inherited from interface net.neoforged.neoforge.common.extensions.IBlockGetterExtension

    getAuxLightManager, getAuxLightManager

    Methods inherited from interface net.neoforged.neoforge.common.extensions.ILevelExtension

    getCapability, getCapability, getCapability, getCapability, getDescription, getDescriptionKey, invalidateCapabilities, invalidateCapabilities

    Methods inherited from interface net.neoforged.neoforge.common.extensions.ILevelReaderExtension

    holder, holderOrThrow, isAreaLoaded

    Methods inherited from interface net.minecraft.world.level.LevelAccessor

    blockUpdated, dayTime, gameEvent, 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, getBlockStatesIfLoaded, getChunk, getChunk, getHeight, getLightLevelDependentMagicValue, getMaxLocalRawBrightness, getMaxLocalRawBrightness, getMinBuildHeight, getPathfindingCostFromLightLevels, hasChunkAt, hasChunkAt, hasChunksAt, hasChunksAt, hasChunksAt, holderLookup, 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

    • DEBUG_SCENE

      public static final net.minecraft.resources.ResourceLocation DEBUG_SCENE
  • Constructor Details

    • BattleSceneClientLevel

      public BattleSceneClientLevel(BattleSceneData sceneData)
      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

      public BattleSceneRenderSettings 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_pos marker is anchored
    • markers

      public List<BattleSceneMarker> markers()
      Returns:
      all parsed markers in this scene
    • markers

      public List<BattleSceneMarker> markers(String type)
      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

      public Optional<BattleSceneMarker> marker(String type)
      Finds the first marker of a type in this scene.
      Parameters:
      type - the marker type to match
      Returns:
      the first matching marker
    • marker

      public Optional<BattleSceneMarker> marker(String type, String id)
      Finds the first marker matching both type and id in this scene.
      Parameters:
      type - the marker type to match
      id - 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 position
      state - 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 scene
      originalPosition - the entity position in the real client world
      scenePosition - the entity position in the battle scene
    • originalEntityPosition

      public Optional<net.minecraft.world.phys.Vec3> originalEntityPosition(UUID entityUUID)
      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

      public Optional<net.minecraft.world.phys.Vec3> sceneEntityPosition(UUID entityUUID)
      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 position
      offset - 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

      public Iterable<net.minecraft.world.entity.Entity> entitiesForRendering()
      Overrides:
      entitiesForRendering in class net.minecraft.client.multiplayer.ClientLevel
    • getEntity

      public net.minecraft.world.entity.Entity getEntity(int id)
      Overrides:
      getEntity in class net.minecraft.client.multiplayer.ClientLevel
    • getSkyColor

      public net.minecraft.world.phys.Vec3 getSkyColor(net.minecraft.world.phys.Vec3 pos, float partialTick)
      Overrides:
      getSkyColor in class net.minecraft.client.multiplayer.ClientLevel
    • getDayTime

      public long getDayTime()
      Overrides:
      getDayTime in class net.minecraft.world.level.Level
    • getRainLevel

      public float getRainLevel(float partialTick)
      Overrides:
      getRainLevel in class net.minecraft.world.level.Level
    • getThunderLevel

      public float getThunderLevel(float partialTick)
      Overrides:
      getThunderLevel in class net.minecraft.world.level.Level
    • isRaining

      public boolean isRaining()
      Overrides:
      isRaining in class net.minecraft.world.level.Level
    • isThundering

      public boolean isThundering()
      Overrides:
      isThundering in class net.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:
      getShade in interface net.minecraft.world.level.BlockAndTintGetter
      Overrides:
      getShade in class net.minecraft.client.multiplayer.ClientLevel
    • getShade

      public float getShade(float normalX, float normalY, float normalZ, boolean shade)
      Specified by:
      getShade in interface net.neoforged.neoforge.common.extensions.IBlockAndTintGetterExtension
      Overrides:
      getShade in class net.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)