Record Class ContextTeamNumberProvider

java.lang.Object
java.lang.Record
com.petrolpark.core.data.loot.numberprovider.ContextTeamNumberProvider
All Implemented Interfaces:
IEstimableNumberProvider, net.minecraft.world.level.storage.loot.LootContextUser, net.minecraft.world.level.storage.loot.providers.number.NumberProvider

public record ContextTeamNumberProvider(TeamNumberProvider value) extends Record implements IEstimableNumberProvider
  • Field Summary

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

    Constructors
    Constructor
    Description
    Creates an instance of a ContextTeamNumberProvider record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    A rough estimate for the output of this Number Provider, for display purposes only.
    float
    getFloat(net.minecraft.world.level.storage.loot.LootContext context)
     
    float
    getMaxFloat(net.minecraft.world.level.storage.loot.LootContext context)
    The maximum possible value this Number Provider can give, ignoring any randomness.
    Set<net.minecraft.world.level.storage.loot.parameters.LootContextParam<?>>
     
    net.minecraft.world.level.storage.loot.providers.number.LootNumberProviderType
     
    final int
    Returns a hash code value for this object.
    final String
    Returns a string representation of this record class.
    Returns the value of the value record component.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface net.minecraft.world.level.storage.loot.LootContextUser

    validate

    Methods inherited from interface net.minecraft.world.level.storage.loot.providers.number.NumberProvider

    getInt
  • Field Details

  • Constructor Details

    • ContextTeamNumberProvider

      public ContextTeamNumberProvider(TeamNumberProvider value)
      Creates an instance of a ContextTeamNumberProvider record class.
      Parameters:
      value - the value for the value record component
  • Method Details

    • getFloat

      public float getFloat(@Nonnull net.minecraft.world.level.storage.loot.LootContext context)
      Specified by:
      getFloat in interface net.minecraft.world.level.storage.loot.providers.number.NumberProvider
    • getEstimate

      public NumberEstimate getEstimate()
      Description copied from interface: IEstimableNumberProvider
      A rough estimate for the output of this Number Provider, for display purposes only.
      Specified by:
      getEstimate in interface IEstimableNumberProvider
    • getMaxFloat

      public float getMaxFloat(net.minecraft.world.level.storage.loot.LootContext context)
      Description copied from interface: IEstimableNumberProvider
      The maximum possible value this Number Provider can give, ignoring any randomness.
      Specified by:
      getMaxFloat in interface IEstimableNumberProvider
    • getType

      public net.minecraft.world.level.storage.loot.providers.number.LootNumberProviderType getType()
      Specified by:
      getType in interface net.minecraft.world.level.storage.loot.providers.number.NumberProvider
    • getReferencedContextParams

      public Set<net.minecraft.world.level.storage.loot.parameters.LootContextParam<?>> getReferencedContextParams()
      Specified by:
      getReferencedContextParams in interface net.minecraft.world.level.storage.loot.LootContextUser
    • 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.
    • value

      public TeamNumberProvider value()
      Returns the value of the value record component.
      Returns:
      the value of the value record component