Record Class ReactorLoot

java.lang.Object
java.lang.Record
net.darkhax.retroreactors.common.data.reactor.ReactorLoot
Record Components:
amount - The amount of loot to spawn.
radius - The radius of the circle to spawn loot within.
table - The loot table to spawn loot from.

public record ReactorLoot(net.minecraft.world.level.storage.loot.providers.number.NumberProvider amount, net.minecraft.world.level.storage.loot.providers.number.NumberProvider radius, net.minecraft.resources.ResourceKey<net.minecraft.world.level.storage.loot.LootTable> table) extends Record
Determines how loot generates inside the reactor tower.
  • Field Summary

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

    Constructors
    Constructor
    Description
    ReactorLoot(net.minecraft.world.level.storage.loot.providers.number.NumberProvider amount, net.minecraft.world.level.storage.loot.providers.number.NumberProvider radius, net.minecraft.resources.ResourceKey<net.minecraft.world.level.storage.loot.LootTable> table)
    Creates an instance of a ReactorLoot record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    net.minecraft.world.level.storage.loot.providers.number.NumberProvider
    Returns the value of the amount 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.world.level.storage.loot.providers.number.NumberProvider
    Returns the value of the radius record component.
    void
    spawn(net.minecraft.server.level.ServerLevel level, net.minecraft.core.BlockPos centerPos, net.minecraft.world.level.storage.loot.LootContext lootContext)
    Spawns loot within the reactor tower.
    net.minecraft.resources.ResourceKey<net.minecraft.world.level.storage.loot.LootTable>
    Returns the value of the table 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<ReactorLoot> CODEC
  • Constructor Details

    • ReactorLoot

      public ReactorLoot(net.minecraft.world.level.storage.loot.providers.number.NumberProvider amount, net.minecraft.world.level.storage.loot.providers.number.NumberProvider radius, net.minecraft.resources.ResourceKey<net.minecraft.world.level.storage.loot.LootTable> table)
      Creates an instance of a ReactorLoot record class.
      Parameters:
      amount - the value for the amount record component
      radius - the value for the radius record component
      table - the value for the table record component
  • Method Details

    • spawn

      public void spawn(net.minecraft.server.level.ServerLevel level, net.minecraft.core.BlockPos centerPos, net.minecraft.world.level.storage.loot.LootContext lootContext)
      Spawns loot within the reactor tower.
      Parameters:
      level - The level to spawn the loot within.
      centerPos - The center of the layer to spawn loot within.
      lootContext - Loot specific context.
    • 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.
    • amount

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

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

      public net.minecraft.resources.ResourceKey<net.minecraft.world.level.storage.loot.LootTable> table()
      Returns the value of the table record component.
      Returns:
      the value of the table record component