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 int
The field for thematerialCost
record component.private final ItemStack
The field for theoutput
record component.private final int
The field for thexpCost
record component. -
Constructor Summary
ConstructorsConstructorDescriptionVanillaResult
(ItemStack output, int xpCost, int materialCost) Creates an instance of aVanillaResult
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.int
Returns the value of thematerialCost
record component.output()
Returns the value of theoutput
record component.final String
toString()
Returns a string representation of this record class.int
xpCost()
Returns the value of thexpCost
record component.
-
Field Details
-
output
The field for theoutput
record component. -
xpCost
private final int xpCostThe field for thexpCost
record component. -
materialCost
private final int materialCostThe field for thematerialCost
record component.
-
-
Constructor Details
-
VanillaResult
Creates an instance of aVanillaResult
record class.- Parameters:
output
- the value for theoutput
record componentxpCost
- the value for thexpCost
record componentmaterialCost
- the value for thematerialCost
record component
-
-
Method Details
-
output
Returns the value of theoutput
record component.- Returns:
- the value of the
output
record 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 thexpCost
record component.- Returns:
- the value of the
xpCost
record component
-
materialCost
public int materialCost()Returns the value of thematerialCost
record component.- Returns:
- the value of the
materialCost
record component
-