Package net.minecraft.village
Class TradeOffer
java.lang.Object
net.minecraft.village.TradeOffer
- Mappings:
Namespace Name official bzvintermediary net/minecraft/class_1914named net/minecraft/village/TradeOffer
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intprivate final class_7317private final class_7317private final intprivate intprivate floatprivate booleanprivate int -
Constructor Summary
ConstructorsConstructorDescriptionTradeOffer(class_7317 class_7317, class_7317 class_73172, int int2, int int3, float float2) TradeOffer(class_7317 class_7317, class_7317 class_73172, int int2, int int3, int int4, float float2) TradeOffer(class_7317 class_7317, class_7317 class_73172, int int2, int int3, int int4, float float2, int int5) TradeOffer(NbtCompound nbt) -
Method Summary
Modifier and TypeMethodDescriptionvoiddisable()Sets the number of times this trade offer has been used to its maximum uses, making it disabled.intReturns the demand bonus of this trade offer.intReturns the maximum number of times this trade offer can be used.intReturns the amount of experience that will be given to a merchant after this trade offer has been used.floatReturns the price multiplier of this trade offer.Returns the sell item of this trade offer.intgetUses()Returns the number of times this trade offer has been used.booleanReturns whether this trade offer has already been used.booleanReturns whether this trade offer is disabled.booleanmethod_42853(class_7317 class_7317) voidResets the number of times this trade offer has been used.booleanReturns whether experience should be given to a player when they use this trade offer.toNbt()voidUpdates the demand bonus of this trade offer depending on its previous demand bonus, the number of times it has been used and its remaining uses.voiduse()Increments the number of times this trade offer has been used.
-
Field Details
-
field_38546
- Mappings:
Namespace Name Mixin selector official aLbzv;a:Lbzt;intermediary field_38546Lnet/minecraft/class_1914;field_38546:Lnet/minecraft/class_7317;named field_38546Lnet/minecraft/village/TradeOffer;field_38546:Lnet/minecraft/class_7317;
-
field_38547
- Mappings:
Namespace Name Mixin selector official bLbzv;b:Lbzt;intermediary field_38547Lnet/minecraft/class_1914;field_38547:Lnet/minecraft/class_7317;named field_38547Lnet/minecraft/village/TradeOffer;field_38547:Lnet/minecraft/class_7317;
-
uses
private int uses- Mappings:
Namespace Name Mixin selector official cLbzv;c:Iintermediary field_9147Lnet/minecraft/class_1914;field_9147:Inamed usesLnet/minecraft/village/TradeOffer;uses:I
-
maxUses
private final int maxUses- Mappings:
Namespace Name Mixin selector official dLbzv;d:Iintermediary field_9144Lnet/minecraft/class_1914;field_9144:Inamed maxUsesLnet/minecraft/village/TradeOffer;maxUses:I
-
rewardingPlayerExperience
private boolean rewardingPlayerExperience- Mappings:
Namespace Name Mixin selector official eLbzv;e:Zintermediary field_9145Lnet/minecraft/class_1914;field_9145:Znamed rewardingPlayerExperienceLnet/minecraft/village/TradeOffer;rewardingPlayerExperience:Z
-
demandBonus
private int demandBonus- Mappings:
Namespace Name Mixin selector official fLbzv;f:Iintermediary field_18677Lnet/minecraft/class_1914;field_18677:Inamed demandBonusLnet/minecraft/village/TradeOffer;demandBonus:I
-
priceMultiplier
private float priceMultiplier- Mappings:
Namespace Name Mixin selector official gLbzv;g:Fintermediary field_18678Lnet/minecraft/class_1914;field_18678:Fnamed priceMultiplierLnet/minecraft/village/TradeOffer;priceMultiplier:F
-
merchantExperience
private int merchantExperience- Mappings:
Namespace Name Mixin selector official hLbzv;h:Iintermediary field_18679Lnet/minecraft/class_1914;field_18679:Inamed merchantExperienceLnet/minecraft/village/TradeOffer;merchantExperience:I
-
-
Constructor Details
-
TradeOffer
- Mappings:
Namespace Name Mixin selector official <init>Lbzv;<init>(Lom;)Vintermediary <init>Lnet/minecraft/class_1914;<init>(Lnet/minecraft/class_2487;)Vnamed <init>Lnet/minecraft/village/TradeOffer;<init>(Lnet/minecraft/nbt/NbtCompound;)V
-
TradeOffer
-
TradeOffer
public TradeOffer(class_7317 class_7317, class_7317 class_73172, int int2, int int3, int int4, float float2) -
TradeOffer
public TradeOffer(class_7317 class_7317, class_7317 class_73172, int int2, int int3, int int4, float float2, int int5)
-
-
Method Details
-
method_42852
- Mappings:
Namespace Name Mixin selector official aLbzv;a()Lbzt;intermediary method_42852Lnet/minecraft/class_1914;method_42852()Lnet/minecraft/class_7317;named method_42852Lnet/minecraft/village/TradeOffer;method_42852()Lnet/minecraft/class_7317;
-
getSellItem
Returns the sell item of this trade offer.- Mappings:
Namespace Name Mixin selector official bLbzv;b()Lbzt;intermediary method_8250Lnet/minecraft/class_1914;method_8250()Lnet/minecraft/class_7317;named getSellItemLnet/minecraft/village/TradeOffer;getSellItem()Lnet/minecraft/class_7317;
-
updateDemandBonus
public void updateDemandBonus()Updates the demand bonus of this trade offer depending on its previous demand bonus, the number of times it has been used and its remaining uses.- Mappings:
Namespace Name Mixin selector official cLbzv;c()Vintermediary method_19274Lnet/minecraft/class_1914;method_19274()Vnamed updateDemandBonusLnet/minecraft/village/TradeOffer;updateDemandBonus()V
-
method_42856
- Mappings:
Namespace Name Mixin selector official dLbzv;d()Lbux;intermediary method_42856Lnet/minecraft/class_1914;method_42856()Lnet/minecraft/class_1799;named method_42856Lnet/minecraft/village/TradeOffer;method_42856()Lnet/minecraft/item/ItemStack;
-
getUses
public int getUses()Returns the number of times this trade offer has been used.- Mappings:
Namespace Name Mixin selector official eLbzv;e()Iintermediary method_8249Lnet/minecraft/class_1914;method_8249()Inamed getUsesLnet/minecraft/village/TradeOffer;getUses()I
-
resetUses
public void resetUses()Resets the number of times this trade offer has been used.- Mappings:
Namespace Name Mixin selector official fLbzv;f()Vintermediary method_19275Lnet/minecraft/class_1914;method_19275()Vnamed resetUsesLnet/minecraft/village/TradeOffer;resetUses()V
-
getMaxUses
public int getMaxUses()Returns the maximum number of times this trade offer can be used.- Mappings:
Namespace Name Mixin selector official gLbzv;g()Iintermediary method_8248Lnet/minecraft/class_1914;method_8248()Inamed getMaxUsesLnet/minecraft/village/TradeOffer;getMaxUses()I
-
use
public void use()Increments the number of times this trade offer has been used.- Mappings:
Namespace Name Mixin selector official hLbzv;h()Vintermediary method_8244Lnet/minecraft/class_1914;method_8244()Vnamed useLnet/minecraft/village/TradeOffer;use()V
-
getDemandBonus
public int getDemandBonus()Returns the demand bonus of this trade offer. It is used to adjust the price of its first buy item.The more the demand bonus is, the more the price will be high.
It is updated when a villager restocks.
- See Also:
- Mappings:
Namespace Name Mixin selector official iLbzv;i()Iintermediary method_21725Lnet/minecraft/class_1914;method_21725()Inamed getDemandBonusLnet/minecraft/village/TradeOffer;getDemandBonus()I
-
getPriceMultiplier
public float getPriceMultiplier()Returns the price multiplier of this trade offer. It is used to adjust the price of its first buy item.- Mappings:
Namespace Name Mixin selector official jLbzv;j()Fintermediary method_19278Lnet/minecraft/class_1914;method_19278()Fnamed getPriceMultiplierLnet/minecraft/village/TradeOffer;getPriceMultiplier()F
-
getMerchantExperience
public int getMerchantExperience()Returns the amount of experience that will be given to a merchant after this trade offer has been used.- Mappings:
Namespace Name Mixin selector official kLbzv;k()Iintermediary method_19279Lnet/minecraft/class_1914;method_19279()Inamed getMerchantExperienceLnet/minecraft/village/TradeOffer;getMerchantExperience()I
-
isDisabled
public boolean isDisabled()Returns whether this trade offer is disabled.Checks if the number of times this trade offer has been used is greater or equal to its maximum uses.
- Mappings:
Namespace Name Mixin selector official lLbzv;l()Zintermediary method_8255Lnet/minecraft/class_1914;method_8255()Znamed isDisabledLnet/minecraft/village/TradeOffer;isDisabled()Z
-
disable
public void disable()Sets the number of times this trade offer has been used to its maximum uses, making it disabled.- Mappings:
Namespace Name Mixin selector official mLbzv;m()Vintermediary method_8254Lnet/minecraft/class_1914;method_8254()Vnamed disableLnet/minecraft/village/TradeOffer;disable()V
-
hasBeenUsed
public boolean hasBeenUsed()Returns whether this trade offer has already been used.Checks if the number of times this trade offer has been used is greater than 0.
- Mappings:
Namespace Name Mixin selector official nLbzv;n()Zintermediary method_21834Lnet/minecraft/class_1914;method_21834()Znamed hasBeenUsedLnet/minecraft/village/TradeOffer;hasBeenUsed()Z
-
shouldRewardPlayerExperience
public boolean shouldRewardPlayerExperience()Returns whether experience should be given to a player when they use this trade offer.- Mappings:
Namespace Name Mixin selector official oLbzv;o()Zintermediary method_8256Lnet/minecraft/class_1914;method_8256()Znamed shouldRewardPlayerExperienceLnet/minecraft/village/TradeOffer;shouldRewardPlayerExperience()Z
-
toNbt
- Mappings:
Namespace Name Mixin selector official pLbzv;p()Lom;intermediary method_8251Lnet/minecraft/class_1914;method_8251()Lnet/minecraft/class_2487;named toNbtLnet/minecraft/village/TradeOffer;toNbt()Lnet/minecraft/nbt/NbtCompound;
-
method_42853
- Mappings:
Namespace Name Mixin selector official aLbzv;a(Lbzt;)Zintermediary method_42853Lnet/minecraft/class_1914;method_42853(Lnet/minecraft/class_7317;)Znamed method_42853Lnet/minecraft/village/TradeOffer;method_42853(Lnet/minecraft/class_7317;)Z
-