java.lang.Object
io.github.vampirestudios.vampirelib.village.BasicTrade
All Implemented Interfaces:
net.minecraft.world.entity.npc.VillagerTrades.ItemListing

public class BasicTrade 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
    BasicTrade(int emeralds, net.minecraft.world.item.ItemStack forSale, int maxTrades, int xp)
     
    BasicTrade(int emeralds, net.minecraft.world.item.ItemStack forSale, int maxTrades, int xp, float mult)
     
    BasicTrade(net.minecraft.world.item.ItemStack price, net.minecraft.world.item.ItemStack forSale, int maxTrades, int xp, float priceMult)
     
    BasicTrade(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 merchant, net.minecraft.util.RandomSource rand)
     

    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

    • BasicTrade

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

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

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

      public BasicTrade(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 merchant, net.minecraft.util.RandomSource rand)
      Specified by:
      getOffer in interface net.minecraft.world.entity.npc.VillagerTrades.ItemListing