Record Class SigmoidNumberProvider

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

public record SigmoidNumberProvider(net.minecraft.world.level.storage.loot.providers.number.NumberProvider shallowness, net.minecraft.world.level.storage.loot.providers.number.NumberProvider midpoint, net.minecraft.world.level.storage.loot.providers.number.NumberProvider value) extends Record implements IEstimableNumberProvider
  • Field Summary

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

    Constructors
    Constructor
    Description
    SigmoidNumberProvider(net.minecraft.world.level.storage.loot.providers.number.NumberProvider shallowness, net.minecraft.world.level.storage.loot.providers.number.NumberProvider midpoint, net.minecraft.world.level.storage.loot.providers.number.NumberProvider value)
    Creates an instance of a SigmoidNumberProvider 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 lootContext)
     
    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.
    net.minecraft.world.level.storage.loot.providers.number.NumberProvider
    Returns the value of the midpoint record component.
    net.minecraft.world.level.storage.loot.providers.number.NumberProvider
    Returns the value of the shallowness record component.
    final String
    Returns a string representation of this record class.
    net.minecraft.world.level.storage.loot.providers.number.NumberProvider
    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

    • SigmoidNumberProvider

      public SigmoidNumberProvider(net.minecraft.world.level.storage.loot.providers.number.NumberProvider shallowness, net.minecraft.world.level.storage.loot.providers.number.NumberProvider midpoint, net.minecraft.world.level.storage.loot.providers.number.NumberProvider value)
      Creates an instance of a SigmoidNumberProvider record class.
      Parameters:
      shallowness - the value for the shallowness record component
      midpoint - the value for the midpoint record component
      value - the value for the value record component
  • Method Details

    • getFloat

      public float getFloat(@Nonnull net.minecraft.world.level.storage.loot.LootContext lootContext)
      Specified by:
      getFloat in interface net.minecraft.world.level.storage.loot.providers.number.NumberProvider
    • 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
    • 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
    • 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.
    • shallowness

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

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

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