Record Class DivideValueEffect
java.lang.Object
java.lang.Record
com.portingdeadmods.researchd.impl.research.effect.DivideValueEffect
- All Implemented Interfaces:
ResearchEffect
public record DivideValueEffect(ValueEffect value, Float divisor)
extends Record
implements ResearchEffect
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final net.minecraft.resources.ResourceLocationstatic final ResearchEffectSerializer<DivideValueEffect> -
Constructor Summary
ConstructorsConstructorDescriptionDivideValueEffect(ValueEffect value, Float divisor) Creates an instance of aDivideValueEffectrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondivisor()Returns the value of thedivisorrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.net.minecraft.resources.ResourceLocationid()voidonUnlock(net.minecraft.world.level.Level level, net.minecraft.world.entity.player.Player player, net.minecraft.resources.ResourceKey<Research> research) final StringtoString()Returns a string representation of this record class.value()Returns the value of thevaluerecord component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.portingdeadmods.researchd.api.research.effects.ResearchEffect
getTranslation
-
Field Details
-
SERIALIZER
-
ID
public static final net.minecraft.resources.ResourceLocation ID
-
-
Constructor Details
-
DivideValueEffect
Creates an instance of aDivideValueEffectrecord class.- Parameters:
value- the value for thevaluerecord componentdivisor- the value for thedivisorrecord component
-
-
Method Details
-
onUnlock
public void onUnlock(net.minecraft.world.level.Level level, net.minecraft.world.entity.player.Player player, net.minecraft.resources.ResourceKey<Research> research) - Specified by:
onUnlockin interfaceResearchEffect
-
id
public net.minecraft.resources.ResourceLocation id()- Specified by:
idin interfaceResearchEffect
-
getSerializer
- Specified by:
getSerializerin interfaceResearchEffect
-
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. -
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. -
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). -
value
Returns the value of thevaluerecord component.- Returns:
- the value of the
valuerecord component
-
divisor
Returns the value of thedivisorrecord component.- Returns:
- the value of the
divisorrecord component
-