Package fr.pacdu.pacpackquests
Record Class QuestTask
java.lang.Object
java.lang.Record
fr.pacdu.pacpackquests.QuestTask
- Record Components:
type- TheTaskTypedefining the nature of the objective.target- The target registry ID, tag, or dimension/biome identifier to match.requiredAmount- The amount of times the objective must be completed.
Represents an individual task or objective within a quest (e.g. mine a block, craft an item, visit a biome).
A quest can contain one or multiple tasks.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static QuestTaskCreates a newQuestTaskinstance.static QuestTaskread(net.minecraft.network.FriendlyByteBuf buf) Deserializes aQuestTaskfrom aFriendlyByteBuf.intReturns the value of therequiredAmountrecord component.target()Returns the value of thetargetrecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.voidwrite(net.minecraft.network.FriendlyByteBuf buf) Serializes this task into aFriendlyByteBuf.
-
Constructor Details
-
QuestTask
Creates an instance of aQuestTaskrecord class.- Parameters:
type- the value for thetyperecord componenttarget- the value for thetargetrecord componentrequiredAmount- the value for therequiredAmountrecord component
-
-
Method Details
-
of
Creates a newQuestTaskinstance.- Parameters:
type- The type of task.target- The target identifier.requiredAmount- The target count required.- Returns:
- A new
QuestTaskinstance.
-
write
public void write(net.minecraft.network.FriendlyByteBuf buf) Serializes this task into aFriendlyByteBuf.- Parameters:
buf- The buffer to write into.
-
read
Deserializes aQuestTaskfrom aFriendlyByteBuf.- Parameters:
buf- The buffer to read from.- Returns:
- The deserialized
QuestTask.
-
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 '=='. -
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
target
Returns the value of thetargetrecord component.- Returns:
- the value of the
targetrecord component
-
requiredAmount
public int requiredAmount()Returns the value of therequiredAmountrecord component.- Returns:
- the value of the
requiredAmountrecord component
-