Record Class ReactorMobs

java.lang.Object
java.lang.Record
net.darkhax.retroreactors.common.data.reactor.ReactorMobs
Record Components:
spawnAmount - The amount of random mobs to spawn.
random - The pool of random mobs. Optional, and can be empty.
always - A pool of mobs that always spawn. Optional, and can be empty.

public record ReactorMobs(net.minecraft.world.level.storage.loot.providers.number.NumberProvider spawnRadius, net.minecraft.world.level.storage.loot.providers.number.NumberProvider spawnAmount, net.minecraft.util.random.WeightedList<net.minecraft.world.item.component.TypedEntityData<net.minecraft.world.entity.EntityType<?>>> random, List<net.minecraft.world.item.component.TypedEntityData<net.minecraft.world.entity.EntityType<?>>> always) extends Record
Represents mob spawning logic for a reactor tower.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.mojang.serialization.Codec<ReactorMobs>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    ReactorMobs(net.minecraft.world.level.storage.loot.providers.number.NumberProvider spawnRadius, net.minecraft.world.level.storage.loot.providers.number.NumberProvider spawnAmount, net.minecraft.util.random.WeightedList<net.minecraft.world.item.component.TypedEntityData<net.minecraft.world.entity.EntityType<?>>> random, List<net.minecraft.world.item.component.TypedEntityData<net.minecraft.world.entity.EntityType<?>>> always)
    Creates an instance of a ReactorMobs record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    List<net.minecraft.world.item.component.TypedEntityData<net.minecraft.world.entity.EntityType<?>>>
    Returns the value of the always record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    net.minecraft.util.random.WeightedList<net.minecraft.world.item.component.TypedEntityData<net.minecraft.world.entity.EntityType<?>>>
    Returns the value of the random record component.
    net.minecraft.world.level.storage.loot.providers.number.NumberProvider
    Returns the value of the spawnAmount record component.
    void
    spawnMobs(net.minecraft.server.level.ServerLevel level, net.minecraft.core.BlockPos centerPos, net.minecraft.world.level.storage.loot.LootContext lootContext)
    Spawns mobs from the configuration into the reactor.
    net.minecraft.world.level.storage.loot.providers.number.NumberProvider
    Returns the value of the spawnRadius record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • CODEC

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

    • ReactorMobs

      public ReactorMobs(net.minecraft.world.level.storage.loot.providers.number.NumberProvider spawnRadius, net.minecraft.world.level.storage.loot.providers.number.NumberProvider spawnAmount, net.minecraft.util.random.WeightedList<net.minecraft.world.item.component.TypedEntityData<net.minecraft.world.entity.EntityType<?>>> random, List<net.minecraft.world.item.component.TypedEntityData<net.minecraft.world.entity.EntityType<?>>> always)
      Creates an instance of a ReactorMobs record class.
      Parameters:
      spawnRadius - the value for the spawnRadius record component
      spawnAmount - the value for the spawnAmount record component
      random - the value for the random record component
      always - the value for the always record component
  • Method Details

    • spawnMobs

      public void spawnMobs(net.minecraft.server.level.ServerLevel level, net.minecraft.core.BlockPos centerPos, net.minecraft.world.level.storage.loot.LootContext lootContext)
      Spawns mobs from the configuration into the reactor.
      Parameters:
      level - The level to spawn mobs within.
      centerPos - The center of the reactor layer to spawn mobs within.
    • 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.
    • spawnRadius

      public net.minecraft.world.level.storage.loot.providers.number.NumberProvider spawnRadius()
      Returns the value of the spawnRadius record component.
      Returns:
      the value of the spawnRadius record component
    • spawnAmount

      public net.minecraft.world.level.storage.loot.providers.number.NumberProvider spawnAmount()
      Returns the value of the spawnAmount record component.
      Returns:
      the value of the spawnAmount record component
    • random

      public net.minecraft.util.random.WeightedList<net.minecraft.world.item.component.TypedEntityData<net.minecraft.world.entity.EntityType<?>>> random()
      Returns the value of the random record component.
      Returns:
      the value of the random record component
    • always

      public List<net.minecraft.world.item.component.TypedEntityData<net.minecraft.world.entity.EntityType<?>>> always()
      Returns the value of the always record component.
      Returns:
      the value of the always record component