Package net.neoforged.neoforge.event
Record Class AnvilUpdateEvent.VanillaResult
java.lang.Object
java.lang.Record
net.neoforged.neoforge.event.AnvilUpdateEvent.VanillaResult
- Record Components:
output- The result of the vanilla anvil operation.xpCost- The experience cost of the vanilla anvil operation.materialCost- The material (right input) cost of the vanilla anvil operation.
- Enclosing class:
AnvilUpdateEvent
public static record AnvilUpdateEvent.VanillaResult(ItemStack output, int xpCost, int materialCost)
extends Record
A record packing all the vanilla result data.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intThe field for thematerialCostrecord component.private final ItemStackThe field for theoutputrecord component.private final intThe field for thexpCostrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionVanillaResult(ItemStack output, int xpCost, int materialCost) Creates an instance of aVanillaResultrecord class. -
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.intReturns the value of thematerialCostrecord component.output()Returns the value of theoutputrecord component.final StringtoString()Returns a string representation of this record class.intxpCost()Returns the value of thexpCostrecord component.
-
Field Details
-
output
The field for theoutputrecord component. -
xpCost
private final int xpCostThe field for thexpCostrecord component. -
materialCost
private final int materialCostThe field for thematerialCostrecord component.
-
-
Constructor Details
-
VanillaResult
Creates an instance of aVanillaResultrecord class.- Parameters:
output- the value for theoutputrecord componentxpCost- the value for thexpCostrecord componentmaterialCost- the value for thematerialCostrecord component
-
-
Method Details
-
output
Returns the value of theoutputrecord component.- Returns:
- the value of the
outputrecord component
-
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 '=='. -
xpCost
public int xpCost()Returns the value of thexpCostrecord component.- Returns:
- the value of the
xpCostrecord component
-
materialCost
public int materialCost()Returns the value of thematerialCostrecord component.- Returns:
- the value of the
materialCostrecord component
-