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_329205_, Optional<ItemCost> p_330242_, ItemStack p_45334_, int p_45337_, int p_45338_, boolean p_336032_, int p_45339_, int p_335600_, float p_45340_, int p_332893_)
    • MerchantOffer

      public MerchantOffer(ItemCost p_329227_, ItemStack p_45327_, int p_45330_, int p_45331_, float p_45332_)
    • MerchantOffer

      public MerchantOffer(ItemCost p_329055_, Optional<ItemCost> p_335735_, ItemStack p_45321_, int p_45323_, int p_45324_, float p_45325_)
    • MerchantOffer

      public MerchantOffer(ItemCost p_335696_, Optional<ItemCost> p_334891_, ItemStack p_45342_, int p_45345_, int p_45346_, int p_45347_, float p_45348_)
    • MerchantOffer

      public MerchantOffer(ItemCost p_330366_, Optional<ItemCost> p_332494_, ItemStack p_335597_, int p_333040_, int p_328201_, int p_334322_, float p_333357_, int p_332973_)
    • MerchantOffer

      private MerchantOffer(MerchantOffer p_301741_)
  • Method Details

    • getBaseCostA

      public ItemStack getBaseCostA()
    • getCostA

      public ItemStack getCostA()
    • getModifiedCostCount

      private int getModifiedCostCount(ItemCost p_330475_)
    • 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_331919_, MerchantOffer p_333750_)
    • createFromStream

      public static MerchantOffer createFromStream(RegistryFriendlyByteBuf p_335331_)