Class MerchantOffer

java.lang.Object
net.minecraft.world.item.trading.MerchantOffer

public class MerchantOffer extends Object
  • Field Details

    • CODEC

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

      public static final StreamCodec<RegistryFriendlyByteBuf,MerchantOffer> STREAM_CODEC
    • baseCostA

      private final ItemCost baseCostA
    • costB

      private final Optional<ItemCost> costB
    • result

      private final ItemStack result
    • uses

      private int uses
    • maxUses

      private final int maxUses
    • rewardExp

      private final boolean rewardExp
    • specialPriceDiff

      private int specialPriceDiff
    • demand

      private int demand
    • priceMultiplier

      private final float priceMultiplier
    • xp

      private final int xp
  • Constructor Details

    • MerchantOffer

      private MerchantOffer(ItemCost p_330734_, Optional<ItemCost> p_331500_, ItemStack p_45327_, int p_45330_, int p_45331_, boolean p_330754_, int p_332006_, int p_330432_, float p_45332_, int p_330282_)
    • MerchantOffer

      public MerchantOffer(ItemCost p_332077_, ItemStack p_320418_, int p_320071_, int p_320069_, float p_320947_)
    • MerchantOffer

      public MerchantOffer(ItemCost p_331596_, Optional<ItemCost> p_330410_, ItemStack p_45334_, int p_45337_, int p_45338_, float p_45340_)
    • MerchantOffer

      public MerchantOffer(ItemCost p_331409_, Optional<ItemCost> p_331614_, ItemStack p_45321_, int p_45323_, int p_45324_, int p_330951_, float p_45325_)
    • MerchantOffer

      public MerchantOffer(ItemCost p_331744_, Optional<ItemCost> p_330460_, ItemStack p_324239_, int p_324562_, int p_324493_, int p_323558_, float p_323528_, int p_324484_)
    • MerchantOffer

      private MerchantOffer(MerchantOffer p_302340_)
  • Method Details

    • getBaseCostA

      public ItemStack getBaseCostA()
    • getCostA

      public ItemStack getCostA()
    • getModifiedCostCount

      private int getModifiedCostCount(ItemCost p_330556_)
    • getCostB

      public ItemStack getCostB()
    • getItemCostA

      public ItemCost getItemCostA()
    • getItemCostB

      public Optional<ItemCost> getItemCostB()
    • getResult

      public ItemStack getResult()
    • updateDemand

      public void updateDemand()
    • assemble

      public ItemStack assemble()
    • getUses

      public int getUses()
    • resetUses

      public void resetUses()
    • getMaxUses

      public int getMaxUses()
    • increaseUses

      public void increaseUses()
    • getDemand

      public int getDemand()
    • addToSpecialPriceDiff

      public void addToSpecialPriceDiff(int p_45354_)
    • resetSpecialPriceDiff

      public void resetSpecialPriceDiff()
    • getSpecialPriceDiff

      public int getSpecialPriceDiff()
    • setSpecialPriceDiff

      public void setSpecialPriceDiff(int p_45360_)
    • getPriceMultiplier

      public float getPriceMultiplier()
    • getXp

      public int getXp()
    • isOutOfStock

      public boolean isOutOfStock()
    • setToOutOfStock

      public void setToOutOfStock()
    • needsRestock

      public boolean needsRestock()
    • shouldRewardExp

      public boolean shouldRewardExp()
    • satisfiedBy

      public boolean satisfiedBy(ItemStack p_45356_, ItemStack p_45357_)
    • take

      public boolean take(ItemStack p_45362_, ItemStack p_45363_)
    • copy

      public MerchantOffer copy()
    • writeToStream

      private static void writeToStream(RegistryFriendlyByteBuf p_320530_, MerchantOffer p_320384_)
    • createFromStream

      public static MerchantOffer createFromStream(RegistryFriendlyByteBuf p_320207_)