Package net.frozenblock.lib.item.impl
Record Class SaveableItemCooldowns.SaveableCooldownInstance
java.lang.Object
java.lang.Record
net.frozenblock.lib.item.impl.SaveableItemCooldowns.SaveableCooldownInstance
- Enclosing class:
- SaveableItemCooldowns
public static record SaveableItemCooldowns.SaveableCooldownInstance(net.minecraft.resources.ResourceLocation itemResourceLocation, int cooldownLeft, int totalCooldownTime)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<SaveableItemCooldowns.SaveableCooldownInstance> -
Constructor Summary
ConstructorsConstructorDescriptionSaveableCooldownInstance(net.minecraft.resources.ResourceLocation itemResourceLocation, int cooldownLeft, int totalCooldownTime) Creates an instance of aSaveableCooldownInstancerecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of thecooldownLeftrecord 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.ResourceLocationReturns the value of theitemResourceLocationrecord component.static @NotNull SaveableItemCooldowns.SaveableCooldownInstancemakeFromCooldownInstance(@NotNull net.minecraft.world.item.Item item, net.minecraft.world.item.ItemCooldowns.CooldownInstance cooldownInstance, int tickCount) final StringtoString()Returns a string representation of this record class.intReturns the value of thetotalCooldownTimerecord component.
-
Field Details
-
CODEC
public static final com.mojang.serialization.Codec<SaveableItemCooldowns.SaveableCooldownInstance> CODEC
-
-
Constructor Details
-
SaveableCooldownInstance
public SaveableCooldownInstance(net.minecraft.resources.ResourceLocation itemResourceLocation, int cooldownLeft, int totalCooldownTime) Creates an instance of aSaveableCooldownInstancerecord class.- Parameters:
itemResourceLocation- the value for theitemResourceLocationrecord componentcooldownLeft- the value for thecooldownLeftrecord componenttotalCooldownTime- the value for thetotalCooldownTimerecord component
-
-
Method Details
-
makeFromCooldownInstance
@NotNull public static @NotNull SaveableItemCooldowns.SaveableCooldownInstance makeFromCooldownInstance(@NotNull @NotNull net.minecraft.world.item.Item item, @NotNull net.minecraft.world.item.ItemCooldowns.CooldownInstance cooldownInstance, int tickCount) -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
itemResourceLocation
public net.minecraft.resources.ResourceLocation itemResourceLocation()Returns the value of theitemResourceLocationrecord component.- Returns:
- the value of the
itemResourceLocationrecord component
-
cooldownLeft
public int cooldownLeft()Returns the value of thecooldownLeftrecord component.- Returns:
- the value of the
cooldownLeftrecord component
-
totalCooldownTime
public int totalCooldownTime()Returns the value of thetotalCooldownTimerecord component.- Returns:
- the value of the
totalCooldownTimerecord component
-