Package net.minecraft.world.item.trading
Class MerchantOffer
java.lang.Object
net.minecraft.world.item.trading.MerchantOffer
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ItemCostThe first input for this offer.static final com.mojang.serialization.Codec<MerchantOffer> The second input for this offer.private intprivate final intprivate final floatprivate final ItemStackThe output of this offer.private final booleanprivate intstatic final StreamCodec<RegistryFriendlyByteBuf, MerchantOffer> private intprivate final int -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateMerchantOffer(ItemCost baseCostA, Optional<ItemCost> costB, ItemStack result, int uses, int maxUses, boolean rewardExp, int specialPriceDiff, int demand, float priceMultiplier, int xp) MerchantOffer(ItemCost baseCostA, Optional<ItemCost> costB, ItemStack result, int maxUses, int xp, float priceMultiplier) MerchantOffer(ItemCost baseCostA, Optional<ItemCost> costB, ItemStack result, int uses, int maxUses, int xp, float priceMultiplier) MerchantOffer(ItemCost baseCostA, Optional<ItemCost> costB, ItemStack result, int uses, int maxUses, int xp, float priceMultiplier, int demand) MerchantOffer(ItemCost baseCostA, ItemStack result, int maxUses, int xp, float priceMultiplier) privateMerchantOffer(MerchantOffer other) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddToSpecialPriceDiff(int add) assemble()copy()static MerchantOffergetCostA()getCostB()intintprivate intgetModifiedCostCount(ItemCost itemCost) floatintintgetUses()intgetXp()voidbooleanbooleanvoidvoidbooleansatisfiedBy(ItemStack playerOfferA, ItemStack playerOfferB) voidsetSpecialPriceDiff(int price) voidbooleanbooleanvoidprivate static voidwriteToStream(RegistryFriendlyByteBuf buffer, MerchantOffer offer)
-
Field Details
-
CODEC
-
STREAM_CODEC
-
baseCostA
The first input for this offer. -
costB
The second input for this offer. -
result
The output of this offer. -
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
-
MerchantOffer
-
MerchantOffer
-
MerchantOffer
-
MerchantOffer
-
MerchantOffer
-
-
Method Details
-
getBaseCostA
-
getCostA
-
getModifiedCostCount
-
getCostB
-
getItemCostA
-
getItemCostB
-
getResult
-
updateDemand
public void updateDemand() -
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 add) -
resetSpecialPriceDiff
public void resetSpecialPriceDiff() -
getSpecialPriceDiff
public int getSpecialPriceDiff() -
setSpecialPriceDiff
public void setSpecialPriceDiff(int price) -
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
-
take
-
copy
-
writeToStream
-
createFromStream
-