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
-
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
-
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
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
xpCost
-
materialCost
public int materialCost()Returns the value of thematerialCostrecord component.- Returns:
- the value of the
materialCostrecord component
-