Record Class TradeListPacket.Trade

java.lang.Object
java.lang.Record
net.minestom.server.network.packet.server.play.TradeListPacket.Trade
All Implemented Interfaces:
Writeable
Enclosing class:
TradeListPacket

public static record TradeListPacket.Trade(ItemStack inputItem1, ItemStack result, ItemStack inputItem2, boolean tradeDisabled, int tradeUsesNumber, int maxTradeUsesNumber, int exp, int specialPrice, float priceMultiplier, int demand) extends Record implements Writeable
  • Constructor Summary

    Constructors
    Constructor
    Description
    Trade(ItemStack inputItem1, ItemStack result, ItemStack inputItem2, boolean tradeDisabled, int tradeUsesNumber, int maxTradeUsesNumber, int exp, int specialPrice, float priceMultiplier, int demand)
    Creates an instance of a Trade record class.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the value of the demand record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    int
    exp()
    Returns the value of the exp record component.
    final int
    Returns a hash code value for this object.
    Returns the value of the inputItem1 record component.
    Returns the value of the inputItem2 record component.
    int
    Returns the value of the maxTradeUsesNumber record component.
    float
    Returns the value of the priceMultiplier record component.
    Returns the value of the result record component.
    int
    Returns the value of the specialPrice record component.
    final String
    Returns a string representation of this record class.
    boolean
    Returns the value of the tradeDisabled record component.
    int
    Returns the value of the tradeUsesNumber record component.
    void
    Writes into a BinaryWriter.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Trade

      public Trade(BinaryReader reader)
    • Trade

      public Trade(ItemStack inputItem1, ItemStack result, ItemStack inputItem2, boolean tradeDisabled, int tradeUsesNumber, int maxTradeUsesNumber, int exp, int specialPrice, float priceMultiplier, int demand)
      Creates an instance of a Trade record class.
      Parameters:
      inputItem1 - the value for the inputItem1 record component
      result - the value for the result record component
      inputItem2 - the value for the inputItem2 record component
      tradeDisabled - the value for the tradeDisabled record component
      tradeUsesNumber - the value for the tradeUsesNumber record component
      maxTradeUsesNumber - the value for the maxTradeUsesNumber record component
      exp - the value for the exp record component
      specialPrice - the value for the specialPrice record component
      priceMultiplier - the value for the priceMultiplier record component
      demand - the value for the demand record component
  • Method Details

    • write

      public void write(BinaryWriter writer)
      Description copied from interface: Writeable
      Writes into a BinaryWriter.
      Specified by:
      write in interface Writeable
      Parameters:
      writer - the writer to write to
    • 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.
    • inputItem1

      public ItemStack inputItem1()
      Returns the value of the inputItem1 record component.
      Returns:
      the value of the inputItem1 record component
    • result

      public ItemStack result()
      Returns the value of the result record component.
      Returns:
      the value of the result record component
    • inputItem2

      public ItemStack inputItem2()
      Returns the value of the inputItem2 record component.
      Returns:
      the value of the inputItem2 record component
    • tradeDisabled

      public boolean tradeDisabled()
      Returns the value of the tradeDisabled record component.
      Returns:
      the value of the tradeDisabled record component
    • tradeUsesNumber

      public int tradeUsesNumber()
      Returns the value of the tradeUsesNumber record component.
      Returns:
      the value of the tradeUsesNumber record component
    • maxTradeUsesNumber

      public int maxTradeUsesNumber()
      Returns the value of the maxTradeUsesNumber record component.
      Returns:
      the value of the maxTradeUsesNumber record component
    • exp

      public int exp()
      Returns the value of the exp record component.
      Returns:
      the value of the exp record component
    • specialPrice

      public int specialPrice()
      Returns the value of the specialPrice record component.
      Returns:
      the value of the specialPrice record component
    • priceMultiplier

      public float priceMultiplier()
      Returns the value of the priceMultiplier record component.
      Returns:
      the value of the priceMultiplier record component
    • demand

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