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 Details

    • output

      private final ItemStack output
      The field for the output record component.
    • xpCost

      private final int xpCost
      The field for the xpCost record component.
    • materialCost

      private final int materialCost
      The field for the materialCost record component.
  • Constructor Details

    • VanillaResult

      public VanillaResult(ItemStack output, int xpCost, int materialCost)
      Creates an instance of a VanillaResult record class.
      Parameters:
      output - the value for the output record component
      xpCost - the value for the xpCost record component
      materialCost - the value for the materialCost record component
  • Method Details

    • output

      public ItemStack output()
      Returns the value of the output record component.
      Returns:
      the value of the output record component
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • xpCost

      public int xpCost()
      Returns the value of the xpCost record component.
      Returns:
      the value of the xpCost record component
    • materialCost

      public int materialCost()
      Returns the value of the materialCost record component.
      Returns:
      the value of the materialCost record component