Record Class TemperatureChangeImpl

java.lang.Object
java.lang.Record
com.github.thedeathlycow.thermoo.impl.core.TemperatureChangeImpl
All Implemented Interfaces:
TemperatureChange

public record TemperatureChangeImpl(net.minecraft.core.Holder<TemperatureSource> source, @Nullable net.minecraft.world.entity.Entity cause, @Nullable net.minecraft.world.entity.Entity directCause, @Nullable net.minecraft.world.phys.Vec3 position) extends Record implements TemperatureChange
  • Constructor Summary

    Constructors
    Constructor
    Description
    TemperatureChangeImpl(net.minecraft.core.Holder<TemperatureSource> source, @Nullable net.minecraft.world.entity.Entity cause, @Nullable net.minecraft.world.entity.Entity directCause, @Nullable net.minecraft.world.phys.Vec3 position)
    Creates an instance of a TemperatureChangeImpl record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    applyReduction(net.minecraft.world.entity.LivingEntity target, int temperatureChange)
    Applies the reduction of the temperature source.
    @Nullable net.minecraft.world.entity.Entity
    Returns the value of the cause record component.
    @Nullable net.minecraft.world.entity.Entity
    Returns the value of the directCause record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    @Nullable net.minecraft.world.phys.Vec3
    Returns the value of the position record component.
    net.minecraft.core.Holder<TemperatureSource>
    Returns the value of the source 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

    Methods inherited from interface TemperatureChange

    is, is, isDirect
  • Constructor Details

    • TemperatureChangeImpl

      public TemperatureChangeImpl(net.minecraft.core.Holder<TemperatureSource> source, @Nullable @Nullable net.minecraft.world.entity.Entity cause, @Nullable @Nullable net.minecraft.world.entity.Entity directCause, @Nullable @Nullable net.minecraft.world.phys.Vec3 position)
      Creates an instance of a TemperatureChangeImpl record class.
      Parameters:
      source - the value for the source record component
      cause - the value for the cause record component
      directCause - the value for the directCause record component
      position - the value for the position record component
  • Method Details

    • applyReduction

      public int applyReduction(net.minecraft.world.entity.LivingEntity target, int temperatureChange)
      Description copied from interface: TemperatureChange
      Applies the reduction of the temperature source.
      Specified by:
      applyReduction in interface TemperatureChange
      Parameters:
      target - The target of the temperature change.
      temperatureChange - The original temperature change value.
      Returns:
      Returns the adjusted temperature change.
    • 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.
    • source

      public net.minecraft.core.Holder<TemperatureSource> source()
      Returns the value of the source record component.
      Specified by:
      source in interface TemperatureChange
      Returns:
      the value of the source record component
    • cause

      @Nullable public @Nullable net.minecraft.world.entity.Entity cause()
      Returns the value of the cause record component.
      Specified by:
      cause in interface TemperatureChange
      Returns:
      the value of the cause record component
    • directCause

      @Nullable public @Nullable net.minecraft.world.entity.Entity directCause()
      Returns the value of the directCause record component.
      Specified by:
      directCause in interface TemperatureChange
      Returns:
      the value of the directCause record component
    • position

      @Nullable public @Nullable net.minecraft.world.phys.Vec3 position()
      Returns the value of the position record component.
      Specified by:
      position in interface TemperatureChange
      Returns:
      the value of the position record component