Record Class StudyItemListener.StudyItem
java.lang.Object
java.lang.Record
com.minecolonies.core.datalistener.StudyItemListener.StudyItem
- Record Components:
item- the item to use.skillIncreaseChance- chance for skill to increase after using the item.breakChance- chance for the item to be used up after using it.
- Enclosing class:
- StudyItemListener
public static record StudyItemListener.StudyItem(net.minecraft.world.item.Item item, int skillIncreaseChance, int breakChance)
extends Record
Container class for any study item.
-
Constructor Summary
ConstructorsConstructorDescriptionStudyItem(net.minecraft.world.item.Item item, int skillIncreaseChance, int breakChance) Creates an instance of aStudyItemrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of thebreakChancerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.net.minecraft.world.item.Itemitem()Returns the value of theitemrecord component.intReturns the value of theskillIncreaseChancerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
StudyItem
public StudyItem(net.minecraft.world.item.Item item, int skillIncreaseChance, int breakChance) Creates an instance of aStudyItemrecord class.- Parameters:
item- the value for theitemrecord componentskillIncreaseChance- the value for theskillIncreaseChancerecord componentbreakChance- the value for thebreakChancerecord component
-
-
Method Details
-
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 '=='. -
item
public net.minecraft.world.item.Item item()Returns the value of theitemrecord component.- Returns:
- the value of the
itemrecord component
-
skillIncreaseChance
public int skillIncreaseChance()Returns the value of theskillIncreaseChancerecord component.- Returns:
- the value of the
skillIncreaseChancerecord component
-
breakChance
public int breakChance()Returns the value of thebreakChancerecord component.- Returns:
- the value of the
breakChancerecord component
-