Record Class RaidType

java.lang.Object
java.lang.Record
com.pixelmonmod.pixelmon.battles.raids.RaidType
Record Components:
renderOptions - The den model, active-raid visual effect, and optional active-light configuration.
eligibleSpawns - The spawn sets this raid type can draw from when creating raid instances.
eligibleAllies - The ally sets this raid type can draw from when filling non-player raid slots.
adminItems - The items an empty den of this raid type accepts to force-create a raid. Normal admin items roll from this raid type's eligible spawns; special admin items may create raids with item-specific rules.
spawnStrategy - The strategy used to decide whether this raid type may spawn for a given den.
battleStartStrategy - The strategy used to create the battle or battles for this raid type.
raidStrategies - The strategies applied during the raid battle lifecycle.
intentHandlers - The server-side handlers this raid type allows for client raid intents, keyed by the intent type id.

public record RaidType(RenderOptions renderOptions, org.joml.Vector2f hitbox, net.minecraft.core.HolderSet<RaidSpawnSet> eligibleSpawns, net.minecraft.core.HolderSet<RaidAllySet> eligibleAllies, net.minecraft.core.HolderSet<net.minecraft.world.item.Item> adminItems, RaidSpawnStrategy spawnStrategy, BattleStartStrategy battleStartStrategy, List<RaidStrategy> raidStrategies, Map<net.minecraft.resources.ResourceLocation,RaidIntentHandler<?>> intentHandlers) extends Record
Datapack-defined raid mode configuration.

A raid type describes the reusable rules for a raid mode, such as Dynamax, Gigantamax, or Terastal raids. It does not represent one spawned raid instance and should not own the concrete Pokemon, rolled star value, rolled rewards, or den-specific loot behavior for that instance.

The render options define the den presentation for this type, including its model, active-raid visual effects, and optional active block light. The eligible spawn sets define which RaidSpawnSet entries this type may draw from. The eligible ally sets define which RaidAllySet entries this type may use when filling non-player raid slots. The admin item set defines which items an empty den of this type accepts to force-create a raid. Ordinary admin items roll from this raid type's configured spawn pool; special admin items may provide their own item-specific raid creation behavior. The spawn strategy decides whether this type may roll or create a raid for a den. The battle start strategy owns the battle topology used when the raid begins. The raid strategies own battle-time behavior after the boss participant exists. The intent handler map owns server-side responses to client raid intents, allowing different raid types to interpret the same client request differently or reject it by leaving it unmapped.

CODEC is the full datapack codec for server-side raid configuration. NETWORK_CODEC intentionally syncs only the visual options because clients only need the rendered den appearance and effects, not the server-owned spawn, ally, battle strategy, or intent handling configuration.

RaidType is configuration, not a strategy implementation. Use strategySet() to create a runtime composite when a caller needs a single RaidStrategy dispatch surface for the configured strategy list. Use intentHandler(RaidIntent) when processing a received RaidIntent.

  • Field Details

    • CODEC

      public static final com.mojang.serialization.Codec<RaidType> CODEC
    • NETWORK_CODEC

      public static final com.mojang.serialization.Codec<RaidType> NETWORK_CODEC
    • REGISTRY

      public static final net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<RaidType>> REGISTRY
    • DYNAMAX

      public static final net.minecraft.resources.ResourceKey<RaidType> DYNAMAX
    • TERA

      public static final net.minecraft.resources.ResourceKey<RaidType> TERA
  • Constructor Details

    • RaidType

      public RaidType(RenderOptions renderOptions, org.joml.Vector2f hitbox)
    • RaidType

      public RaidType(RenderOptions renderOptions, org.joml.Vector2f hitbox, net.minecraft.core.HolderSet<RaidSpawnSet> eligibleSpawns, net.minecraft.core.HolderSet<RaidAllySet> eligibleAllies, net.minecraft.core.HolderSet<net.minecraft.world.item.Item> adminItems, RaidSpawnStrategy spawnStrategy, BattleStartStrategy battleStartStrategy, List<RaidStrategy> raidStrategies, Map<net.minecraft.resources.ResourceLocation,RaidIntentHandler<?>> intentHandlers)
      Creates an instance of a RaidType record class.
      Parameters:
      renderOptions - the value for the renderOptions record component
      hitbox - the value for the hitbox record component
      eligibleSpawns - the value for the eligibleSpawns record component
      eligibleAllies - the value for the eligibleAllies record component
      adminItems - the value for the adminItems record component
      spawnStrategy - the value for the spawnStrategy record component
      battleStartStrategy - the value for the battleStartStrategy record component
      raidStrategies - the value for the raidStrategies record component
      intentHandlers - the value for the intentHandlers record component
  • Method Details

    • strategySet

      public RaidStrategy strategySet()
      Creates a runtime composite for the configured battle-time raid strategies.
      Returns:
      A strategy set that dispatches to this raid type's strategy list in order.
    • intentHandler

      public RaidIntentHandler<?> intentHandler(RaidIntent intent)
      Gets this raid type's server-side handler for the given intent.
      Parameters:
      intent - The received client intent.
      Returns:
      The handler for the intent, or null if this raid type does not handle it.
    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • renderOptions

      public RenderOptions renderOptions()
      Returns the value of the renderOptions record component.
      Returns:
      the value of the renderOptions record component
    • hitbox

      public org.joml.Vector2f hitbox()
      Returns the value of the hitbox record component.
      Returns:
      the value of the hitbox record component
    • eligibleSpawns

      public net.minecraft.core.HolderSet<RaidSpawnSet> eligibleSpawns()
      Returns the value of the eligibleSpawns record component.
      Returns:
      the value of the eligibleSpawns record component
    • eligibleAllies

      public net.minecraft.core.HolderSet<RaidAllySet> eligibleAllies()
      Returns the value of the eligibleAllies record component.
      Returns:
      the value of the eligibleAllies record component
    • adminItems

      public net.minecraft.core.HolderSet<net.minecraft.world.item.Item> adminItems()
      Returns the value of the adminItems record component.
      Returns:
      the value of the adminItems record component
    • spawnStrategy

      public RaidSpawnStrategy spawnStrategy()
      Returns the value of the spawnStrategy record component.
      Returns:
      the value of the spawnStrategy record component
    • battleStartStrategy

      public BattleStartStrategy battleStartStrategy()
      Returns the value of the battleStartStrategy record component.
      Returns:
      the value of the battleStartStrategy record component
    • raidStrategies

      public List<RaidStrategy> raidStrategies()
      Returns the value of the raidStrategies record component.
      Returns:
      the value of the raidStrategies record component
    • intentHandlers

      public Map<net.minecraft.resources.ResourceLocation,RaidIntentHandler<?>> intentHandlers()
      Returns the value of the intentHandlers record component.
      Returns:
      the value of the intentHandlers record component