Record Class SimpleItemListing

java.lang.Object
java.lang.Record
tech.anonymoushacker1279.immersiveweapons.entity.npc.trading.SimpleItemListing
All Implemented Interfaces:
net.minecraft.world.entity.npc.VillagerTrades.ItemListing

public record SimpleItemListing(net.minecraft.world.item.ItemStack item1, net.minecraft.world.item.ItemStack item2, net.minecraft.world.item.ItemStack result, int maxUses, int xpReward, float priceMultiplier) extends Record implements net.minecraft.world.entity.npc.VillagerTrades.ItemListing
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.mojang.serialization.Codec<SimpleItemListing>
     
    static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,SimpleItemListing>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    SimpleItemListing(int emeralds, net.minecraft.world.item.ItemStack result, int maxUses)
     
    SimpleItemListing(int emeralds, net.minecraft.world.item.ItemStack result, int maxUses, int xpReward)
     
    SimpleItemListing(net.minecraft.world.item.ItemStack item1, net.minecraft.world.item.ItemStack result, int maxUses, int xpReward, float priceMultiplier)
     
    SimpleItemListing(net.minecraft.world.item.ItemStack item1, net.minecraft.world.item.ItemStack item2, net.minecraft.world.item.ItemStack result, int maxUses, int xpReward, float priceMultiplier)
    Creates an instance of a SimpleItemListing record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    net.minecraft.world.item.trading.MerchantOffer
    getOffer(net.minecraft.world.entity.Entity p_219693_, net.minecraft.util.RandomSource p_219694_)
     
    final int
    Returns a hash code value for this object.
    net.minecraft.world.item.ItemStack
    Returns the value of the item1 record component.
    net.minecraft.world.item.ItemStack
    Returns the value of the item2 record component.
    int
    Returns the value of the maxUses record component.
    float
    Returns the value of the priceMultiplier record component.
    net.minecraft.world.item.ItemStack
    Returns the value of the result record component.
    final String
    Returns a string representation of this record class.
    int
    Returns the value of the xpReward record component.

    Methods inherited from class java.lang.Object

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

    • CODEC

      public static final com.mojang.serialization.Codec<SimpleItemListing> CODEC
    • STREAM_CODEC

      public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,SimpleItemListing> STREAM_CODEC
  • Constructor Details

    • SimpleItemListing

      public SimpleItemListing(net.minecraft.world.item.ItemStack item1, net.minecraft.world.item.ItemStack result, int maxUses, int xpReward, float priceMultiplier)
    • SimpleItemListing

      public SimpleItemListing(int emeralds, net.minecraft.world.item.ItemStack result, int maxUses, int xpReward)
    • SimpleItemListing

      public SimpleItemListing(int emeralds, net.minecraft.world.item.ItemStack result, int maxUses)
    • SimpleItemListing

      public SimpleItemListing(net.minecraft.world.item.ItemStack item1, net.minecraft.world.item.ItemStack item2, net.minecraft.world.item.ItemStack result, int maxUses, int xpReward, float priceMultiplier)
      Creates an instance of a SimpleItemListing record class.
      Parameters:
      item1 - the value for the item1 record component
      item2 - the value for the item2 record component
      result - the value for the result record component
      maxUses - the value for the maxUses record component
      xpReward - the value for the xpReward record component
      priceMultiplier - the value for the priceMultiplier record component
  • Method Details

    • getOffer

      public net.minecraft.world.item.trading.MerchantOffer getOffer(net.minecraft.world.entity.Entity p_219693_, net.minecraft.util.RandomSource p_219694_)
      Specified by:
      getOffer in interface net.minecraft.world.entity.npc.VillagerTrades.ItemListing
    • 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.
    • item1

      public net.minecraft.world.item.ItemStack item1()
      Returns the value of the item1 record component.
      Returns:
      the value of the item1 record component
    • item2

      public net.minecraft.world.item.ItemStack item2()
      Returns the value of the item2 record component.
      Returns:
      the value of the item2 record component
    • result

      public net.minecraft.world.item.ItemStack result()
      Returns the value of the result record component.
      Returns:
      the value of the result record component
    • maxUses

      public int maxUses()
      Returns the value of the maxUses record component.
      Returns:
      the value of the maxUses record component
    • xpReward

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

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