Record Class BattleScene

java.lang.Object
java.lang.Record
com.pixelmonmod.pixelmon.api.battles.scene.BattleScene
Record Components:
structure - the server-side structure template to use for the scene
structureRotation - the grid-aligned rotation applied to structure blocks around the player_pos marker
markerYawOffset - an arbitrary yaw offset applied to all parsed markers after structure rotation
renderSettings - rendering values and world-state behavior for the client scene

public record BattleScene(net.minecraft.resources.ResourceLocation structure, net.minecraft.world.level.block.Rotation structureRotation, float markerYawOffset, BattleSceneRenderSettings renderSettings) extends Record
Datapack definition for a battle scene.

The battle context references entries in this registry. The server resolves the definition, loads the configured structure, and sends the client the resolved blocks, markers, and render settings.

  • Field Details

    • REGISTRY

      public static final net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<BattleScene>> REGISTRY
    • ROTATION_CODEC

      public static final com.mojang.serialization.Codec<net.minecraft.world.level.block.Rotation> ROTATION_CODEC
    • CODEC

      public static final com.mojang.serialization.Codec<BattleScene> CODEC
  • Constructor Details

    • BattleScene

      public BattleScene(net.minecraft.resources.ResourceLocation structure, net.minecraft.world.level.block.Rotation structureRotation, float markerYawOffset, BattleSceneRenderSettings renderSettings)
      Creates an instance of a BattleScene record class.
      Parameters:
      structure - the value for the structure record component
      structureRotation - the value for the structureRotation record component
      markerYawOffset - the value for the markerYawOffset record component
      renderSettings - the value for the renderSettings record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • structure

      public net.minecraft.resources.ResourceLocation structure()
      Returns the value of the structure record component.
      Returns:
      the value of the structure record component
    • structureRotation

      public net.minecraft.world.level.block.Rotation structureRotation()
      Returns the value of the structureRotation record component.
      Returns:
      the value of the structureRotation record component
    • markerYawOffset

      public float markerYawOffset()
      Returns the value of the markerYawOffset record component.
      Returns:
      the value of the markerYawOffset record component
    • renderSettings

      public BattleSceneRenderSettings renderSettings()
      Returns the value of the renderSettings record component.
      Returns:
      the value of the renderSettings record component