public class MerchantTradeOffersEvent extends Event
IMerchant.getRecipes(EntityPlayer)
, allowing mods to modify trade offers depending
on the player. Be warned that this event is fired on both server and client; thus, modders
should ensure that they sync the needed data for this event themselves.Cancelable
.Event.HasResult
MinecraftForge.EVENT_BUS
.Event.HasResult, Event.Result
Modifier and Type | Field and Description |
---|---|
private MerchantRecipeList |
list |
private IMerchant |
merchant |
private EntityPlayer |
player |
Constructor and Description |
---|
MerchantTradeOffersEvent(IMerchant merchant,
EntityPlayer player,
MerchantRecipeList list) |
Modifier and Type | Method and Description |
---|---|
MerchantRecipeList |
getList()
The recipe list (if not
null ) returned from this function may be modified. |
IMerchant |
getMerchant() |
EntityPlayer |
getPlayer() |
void |
setList(MerchantRecipeList list) |
getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult, setup
private final IMerchant merchant
private final EntityPlayer player
@Nullable private MerchantRecipeList list
public MerchantTradeOffersEvent(IMerchant merchant, EntityPlayer player, @Nullable MerchantRecipeList list)
@Nullable public MerchantRecipeList getList()
null
) returned from this function may be modified.public void setList(@Nullable MerchantRecipeList list)
public IMerchant getMerchant()
public EntityPlayer getPlayer()