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
ConstructorsConstructorDescriptionTemperatureChangeImpl(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 aTemperatureChangeImplrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintapplyReduction(net.minecraft.world.entity.LivingEntity target, int temperatureChange) Applies the reduction of the temperature source.@Nullable net.minecraft.world.entity.Entitycause()Returns the value of thecauserecord component.@Nullable net.minecraft.world.entity.EntityReturns the value of thedirectCauserecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@Nullable net.minecraft.world.phys.Vec3position()Returns the value of thepositionrecord component.net.minecraft.core.Holder<TemperatureSource> source()Returns the value of thesourcerecord component.final StringtoString()Returns a string representation of this record class.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 aTemperatureChangeImplrecord class.- Parameters:
source- the value for thesourcerecord componentcause- the value for thecauserecord componentdirectCause- the value for thedirectCauserecord componentposition- the value for thepositionrecord component
-
-
Method Details
-
applyReduction
public int applyReduction(net.minecraft.world.entity.LivingEntity target, int temperatureChange) Description copied from interface:TemperatureChangeApplies the reduction of the temperature source.- Specified by:
applyReductionin interfaceTemperatureChange- Parameters:
target- The target of the temperature change.temperatureChange- The original temperature change value.- Returns:
- Returns the adjusted temperature change.
-
toString
-
hashCode
-
equals
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 withObjects::equals(Object,Object). -
source
Returns the value of thesourcerecord component.- Specified by:
sourcein interfaceTemperatureChange- Returns:
- the value of the
sourcerecord component
-
cause
@Nullable public @Nullable net.minecraft.world.entity.Entity cause()Returns the value of thecauserecord component.- Specified by:
causein interfaceTemperatureChange- Returns:
- the value of the
causerecord component
-
directCause
@Nullable public @Nullable net.minecraft.world.entity.Entity directCause()Returns the value of thedirectCauserecord component.- Specified by:
directCausein interfaceTemperatureChange- Returns:
- the value of the
directCauserecord component
-
position
@Nullable public @Nullable net.minecraft.world.phys.Vec3 position()Returns the value of thepositionrecord component.- Specified by:
positionin interfaceTemperatureChange- Returns:
- the value of the
positionrecord component
-