Package net.minecraft.world.item.trading
Class MerchantOffer
java.lang.Object
net.minecraft.world.item.trading.MerchantOffer
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ItemCost
The first input for this offer.static final com.mojang.serialization.Codec
<MerchantOffer> The second input for this offer.private int
private final int
private final float
private final ItemStack
The output of this offer.private final boolean
private int
static final StreamCodec
<RegistryFriendlyByteBuf, MerchantOffer> private int
private final int
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
MerchantOffer
(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) private
MerchantOffer
(MerchantOffer other) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addToSpecialPriceDiff
(int add) assemble()
copy()
static MerchantOffer
getCostA()
getCostB()
int
int
private int
getModifiedCostCount
(ItemCost itemCost) float
int
int
getUses()
int
getXp()
void
boolean
boolean
void
void
boolean
satisfiedBy
(ItemStack playerOfferA, ItemStack playerOfferB) void
setSpecialPriceDiff
(int price) void
boolean
boolean
void
private static void
writeToStream
(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
-