public class AmadronOffer extends AmadronRecipe
| Modifier and Type | Class and Description |
|---|---|
static class |
AmadronOffer.Serializer<T extends AmadronRecipe> |
PneumaticCraftRecipe.DummyIInventory| Modifier and Type | Field and Description |
|---|---|
protected PlayerFilter |
blacklist |
protected AmadronTradeResource |
input |
protected int |
inStock |
protected AmadronTradeResource |
output |
protected PlayerFilter |
whitelist |
| Constructor and Description |
|---|
AmadronOffer(net.minecraft.util.ResourceLocation id,
AmadronTradeResource input,
AmadronTradeResource output,
boolean isStaticOffer,
int tradeLevel,
int maxStock) |
AmadronOffer(net.minecraft.util.ResourceLocation id,
AmadronTradeResource input,
AmadronTradeResource output,
boolean isStaticOffer,
int tradeLevel,
int maxStock,
int inStock,
PlayerFilter whitelist,
PlayerFilter blacklist) |
| Modifier and Type | Method and Description |
|---|---|
void |
addAvailabilityData(net.minecraft.entity.player.PlayerEntity player,
java.util.List<net.minecraft.util.text.ITextComponent> curTip)
Add some information about where this offer is available, in the case of offers with limited availablity.
|
boolean |
equals(java.lang.Object o) |
boolean |
equivalentTo(AmadronPlayerOffer offer) |
net.minecraft.util.text.ITextComponent |
getDescription()
Get a player-friendly description of the offer
|
AmadronTradeResource |
getInput()
Get the offer's input, i.e.
|
int |
getMaxStock()
Get the maximum (initial) stock level for this offer.
|
AmadronTradeResource |
getOutput()
Get the offer's output, i.e.
|
net.minecraft.item.crafting.IRecipeSerializer<?> |
getSerializer() |
int |
getStock()
Get the number of trades Amadron currently has in stock for this offer.
|
int |
getTradeLevel()
The rarity for villager and periodic trades, in the range of 1 (common) to 5 (very rare)
|
net.minecraft.item.crafting.IRecipeType<?> |
getType() |
net.minecraft.util.text.ITextComponent |
getVendorName()
Get the offer's vendor name, for display purposes.
|
int |
hashCode() |
boolean |
isLocationLimited() |
boolean |
isStaticOffer()
Is this a static offer, always displayed on the Amadron tablet? Or periodic, shuffled in at random once per
Minecraft day (by default) ?
|
boolean |
isUsableByPlayer(net.minecraft.entity.player.PlayerEntity player)
Is this offer available to the given player? By default, all offers are available, but offers can be
whitelisted/blacklisted in data packs with the "whitelist" and "blacklist" fields in the Amadron recipe JSON.
|
static AmadronRecipe |
offerFromBuf(net.minecraft.util.ResourceLocation id,
net.minecraft.network.PacketBuffer buf) |
void |
onTrade(int tradingAmount,
java.lang.String buyingPlayer) |
void |
setStock(int inStock)
Update the number of trades Amadron currently has in stock for this offer.
|
AmadronOffer |
setVillagerTrade() |
com.google.gson.JsonObject |
toJson(com.google.gson.JsonObject json) |
java.lang.String |
toString() |
void |
write(net.minecraft.network.PacketBuffer buf)
Writes this recipe to a PacketBuffer.
|
getVendor, isRemovableBy, passesQueryassemble, canCraftInDimensions, getId, getResultItem, isSpecial, matches@Nonnull protected final AmadronTradeResource input
@Nonnull protected final AmadronTradeResource output
protected final PlayerFilter whitelist
protected final PlayerFilter blacklist
protected int inStock
public AmadronOffer(net.minecraft.util.ResourceLocation id,
@Nonnull
AmadronTradeResource input,
@Nonnull
AmadronTradeResource output,
boolean isStaticOffer,
int tradeLevel,
int maxStock,
int inStock,
PlayerFilter whitelist,
PlayerFilter blacklist)
public AmadronOffer(net.minecraft.util.ResourceLocation id,
@Nonnull
AmadronTradeResource input,
@Nonnull
AmadronTradeResource output,
boolean isStaticOffer,
int tradeLevel,
int maxStock)
@Nonnull public AmadronTradeResource getInput()
AmadronRecipegetInput in class AmadronRecipe@Nonnull public AmadronTradeResource getOutput()
AmadronRecipegetOutput in class AmadronRecipepublic boolean isStaticOffer()
AmadronRecipeisStaticOffer in class AmadronRecipepublic int getTradeLevel()
AmadronRecipegetTradeLevel in class AmadronRecipepublic AmadronOffer setVillagerTrade()
public boolean equivalentTo(AmadronPlayerOffer offer)
public net.minecraft.util.text.ITextComponent getVendorName()
AmadronRecipegetVendorName in class AmadronRecipepublic int getStock()
AmadronRecipegetStock in class AmadronRecipepublic void setStock(int inStock)
AmadronRecipeAmadronRecipe.getMaxStock() (provided that the max stock level is > 0).setStock in class AmadronRecipeinStock - the new stock levelpublic void onTrade(int tradingAmount,
java.lang.String buyingPlayer)
public void write(net.minecraft.network.PacketBuffer buf)
PneumaticCraftRecipewrite in class PneumaticCraftRecipebuf - The buffer to write to.public static AmadronRecipe offerFromBuf(net.minecraft.util.ResourceLocation id, net.minecraft.network.PacketBuffer buf)
public com.google.gson.JsonObject toJson(com.google.gson.JsonObject json)
public java.lang.String toString()
toString in class java.lang.Objectpublic net.minecraft.util.text.ITextComponent getDescription()
public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic net.minecraft.item.crafting.IRecipeSerializer<?> getSerializer()
public net.minecraft.item.crafting.IRecipeType<?> getType()
public int getMaxStock()
AmadronRecipegetMaxStock in class AmadronRecipepublic boolean isUsableByPlayer(net.minecraft.entity.player.PlayerEntity player)
AmadronRecipePneumaticRegistry.IPneumaticCraftInterface.registerPlayerMatcher(ResourceLocation, IPlayerMatcher.MatcherFactory)isUsableByPlayer in class AmadronRecipeplayer - the player to checkpublic void addAvailabilityData(net.minecraft.entity.player.PlayerEntity player,
java.util.List<net.minecraft.util.text.ITextComponent> curTip)
AmadronRecipeaddAvailabilityData in class AmadronRecipecurTip - tooltip to add information topublic boolean isLocationLimited()
isLocationLimited in class AmadronRecipe