Class BasicItemListing

java.lang.Object
net.neoforged.neoforge.common.BasicItemListing
All Implemented Interfaces:
net.minecraft.world.entity.npc.VillagerTrades.ItemListing

public class BasicItemListing extends Object implements net.minecraft.world.entity.npc.VillagerTrades.ItemListing
A default, exposed implementation of ITrade. All of the other implementations of ITrade (in VillagerTrades) are not public. This class contains everything needed to make a MerchantOffer, the actual "trade" object shown in trading guis.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final net.minecraft.world.item.ItemStack
     
    protected final int
     
    protected final net.minecraft.world.item.ItemStack
     
    protected final net.minecraft.world.item.ItemStack
     
    protected final float
     
    protected final int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    BasicItemListing(int emeralds, net.minecraft.world.item.ItemStack forSale, int maxTrades, int xp)
     
    BasicItemListing(int emeralds, net.minecraft.world.item.ItemStack forSale, int maxTrades, int xp, float mult)
     
    BasicItemListing(net.minecraft.world.item.ItemStack price, net.minecraft.world.item.ItemStack forSale, int maxTrades, int xp, float priceMult)
     
    BasicItemListing(net.minecraft.world.item.ItemStack price, net.minecraft.world.item.ItemStack price2, net.minecraft.world.item.ItemStack forSale, int maxTrades, int xp, float priceMult)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable net.minecraft.world.item.trading.MerchantOffer
    getOffer(net.minecraft.world.entity.Entity p_219693_, net.minecraft.util.RandomSource p_219694_)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • price

      protected final net.minecraft.world.item.ItemStack price
    • price2

      protected final net.minecraft.world.item.ItemStack price2
    • forSale

      protected final net.minecraft.world.item.ItemStack forSale
    • maxTrades

      protected final int maxTrades
    • xp

      protected final int xp
    • priceMult

      protected final float priceMult
  • Constructor Details

    • BasicItemListing

      public BasicItemListing(net.minecraft.world.item.ItemStack price, net.minecraft.world.item.ItemStack price2, net.minecraft.world.item.ItemStack forSale, int maxTrades, int xp, float priceMult)
    • BasicItemListing

      public BasicItemListing(net.minecraft.world.item.ItemStack price, net.minecraft.world.item.ItemStack forSale, int maxTrades, int xp, float priceMult)
    • BasicItemListing

      public BasicItemListing(int emeralds, net.minecraft.world.item.ItemStack forSale, int maxTrades, int xp, float mult)
    • BasicItemListing

      public BasicItemListing(int emeralds, net.minecraft.world.item.ItemStack forSale, int maxTrades, int xp)
  • Method Details

    • getOffer

      @Nullable public @Nullable 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