Class WandererTradesEvent
java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.event.village.WandererTradesEvent
public class WandererTradesEvent
extends net.neoforged.bus.api.Event
WandererTradesEvent is fired during reload by
TagsUpdatedEvent. It is used to gather the trade lists for the wandering merchant.
It is fired on the NeoForge.EVENT_BUS.
For each set of trades the wandering merchant picks the specified amount of trades from the corresponding list.
To add trades to the merchant, simply add new trades to the list. BasicItemListing provides a default implementation.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected List<org.apache.commons.lang3.tuple.Pair<List<VillagerTrades.ItemListing>, Integer>> protected List<VillagerTrades.ItemListing> protected intprotected List<VillagerTrades.ItemListing> protected intprotected List<VillagerTrades.ItemListing> protected intprivate final HolderLookup.Provider -
Constructor Summary
ConstructorsConstructorDescriptionWandererTradesEvent(List<VillagerTrades.ItemListing> buying, int buyingAmount, List<VillagerTrades.ItemListing> rare, int rareAmount, List<VillagerTrades.ItemListing> generic, int genericAmount, List<org.apache.commons.lang3.tuple.Pair<List<VillagerTrades.ItemListing>, Integer>> additionalTrades, HolderLookup.Provider registries) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddTrades(List<VillagerTrades.ItemListing> trades, int amount) intintintvoidsetBuyingAmount(int amount) voidsetGenericAmount(int amount) voidsetRareAmount(int amount)
-
Field Details
-
buying
-
buyingAmount
protected int buyingAmount -
rare
-
rareAmount
protected int rareAmount -
generic
-
genericAmount
protected int genericAmount -
additionalTrades
protected List<org.apache.commons.lang3.tuple.Pair<List<VillagerTrades.ItemListing>,Integer>> additionalTrades -
registries
-
-
Constructor Details
-
WandererTradesEvent
@Internal public WandererTradesEvent(List<VillagerTrades.ItemListing> buying, int buyingAmount, List<VillagerTrades.ItemListing> rare, int rareAmount, List<VillagerTrades.ItemListing> generic, int genericAmount, List<org.apache.commons.lang3.tuple.Pair<List<VillagerTrades.ItemListing>, Integer>> additionalTrades, HolderLookup.Provider registries)
-
-
Method Details
-
getBuyingTrades
-
getBuyingAmount
public int getBuyingAmount() -
setBuyingAmount
public void setBuyingAmount(int amount) -
getRareTrades
-
getRareAmount
public int getRareAmount() -
setRareAmount
public void setRareAmount(int amount) -
getGenericTrades
-
getGenericAmount
public int getGenericAmount() -
setGenericAmount
public void setGenericAmount(int amount) -
addTrades
-
getRegistries
-