Package net.neoforged.neoforge.common
Class BasicItemListing
java.lang.Object
net.neoforged.neoforge.common.BasicItemListing
- All Implemented Interfaces:
net.minecraft.world.entity.npc.VillagerTrades.ItemListing
public class BasicItemListing
extends Object
implements net.minecraft.world.entity.npc.VillagerTrades.ItemListing
A default, exposed implementation of ITrade. All of the other implementations of ITrade (in VillagerTrades) are not public.
This class contains everything needed to make a MerchantOffer, the actual "trade" object shown in trading guis.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBasicItemListing
(int emeralds, net.minecraft.world.item.ItemStack forSale, int maxTrades, int xp) BasicItemListing
(int emeralds, net.minecraft.world.item.ItemStack forSale, int maxTrades, int xp, float mult) BasicItemListing
(net.minecraft.world.item.ItemStack price, net.minecraft.world.item.ItemStack forSale, int maxTrades, int xp, float priceMult) BasicItemListing
(net.minecraft.world.item.ItemStack price, net.minecraft.world.item.ItemStack price2, net.minecraft.world.item.ItemStack forSale, int maxTrades, int xp, float priceMult) -
Method Summary
Modifier and TypeMethodDescription@Nullable net.minecraft.world.item.trading.MerchantOffer
getOffer
(net.minecraft.world.entity.Entity p_219693_, net.minecraft.util.RandomSource p_219694_)
-
Field Details
-
price
protected final net.minecraft.world.item.ItemStack price -
price2
protected final net.minecraft.world.item.ItemStack price2 -
forSale
protected final net.minecraft.world.item.ItemStack forSale -
maxTrades
protected final int maxTrades -
xp
protected final int xp -
priceMult
protected final float priceMult
-
-
Constructor Details
-
BasicItemListing
public BasicItemListing(net.minecraft.world.item.ItemStack price, net.minecraft.world.item.ItemStack price2, net.minecraft.world.item.ItemStack forSale, int maxTrades, int xp, float priceMult) -
BasicItemListing
public BasicItemListing(net.minecraft.world.item.ItemStack price, net.minecraft.world.item.ItemStack forSale, int maxTrades, int xp, float priceMult) -
BasicItemListing
public BasicItemListing(int emeralds, net.minecraft.world.item.ItemStack forSale, int maxTrades, int xp, float mult) -
BasicItemListing
public BasicItemListing(int emeralds, net.minecraft.world.item.ItemStack forSale, int maxTrades, int xp)
-
-
Method Details
-
getOffer
@Nullable public @Nullable net.minecraft.world.item.trading.MerchantOffer getOffer(net.minecraft.world.entity.Entity p_219693_, net.minecraft.util.RandomSource p_219694_) - Specified by:
getOffer
in interfacenet.minecraft.world.entity.npc.VillagerTrades.ItemListing
-