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 AmadronTradeResource |
input |
protected int |
inStock |
protected AmadronTradeResource |
output |
| Constructor and Description |
|---|
AmadronOffer(net.minecraft.util.ResourceLocation id,
AmadronTradeResource input,
AmadronTradeResource output,
boolean isStaticOffer,
int tradeLevel) |
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) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o) |
boolean |
equivalentTo(AmadronPlayerOffer offer) |
static AmadronOffer |
fromJson(net.minecraft.util.ResourceLocation id,
com.google.gson.JsonObject json) |
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() |
java.lang.String |
getVendor()
Get the offer's vendor name, for display purposes.
|
int |
hashCode() |
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) ?
|
static AmadronOffer |
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.
|
isRemovableBy, passesQueryassemble, canCraftInDimensions, getId, getResultItem, isSpecial, matchesprotected final AmadronTradeResource input
protected final AmadronTradeResource output
protected int inStock
public AmadronOffer(net.minecraft.util.ResourceLocation id,
@Nonnull
AmadronTradeResource input,
@Nonnull
AmadronTradeResource output,
boolean isStaticOffer,
int tradeLevel,
int maxStock,
int inStock)
public AmadronOffer(net.minecraft.util.ResourceLocation id,
@Nonnull
AmadronTradeResource input,
@Nonnull
AmadronTradeResource output,
boolean isStaticOffer,
int tradeLevel,
int maxStock)
public AmadronOffer(net.minecraft.util.ResourceLocation id,
@Nonnull
AmadronTradeResource input,
@Nonnull
AmadronTradeResource output,
boolean isStaticOffer,
int tradeLevel)
public AmadronTradeResource getInput()
AmadronRecipegetInput in class AmadronRecipepublic 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 java.lang.String getVendor()
AmadronRecipegetVendor 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 AmadronOffer offerFromBuf(net.minecraft.util.ResourceLocation id, net.minecraft.network.PacketBuffer buf)
public com.google.gson.JsonObject toJson(com.google.gson.JsonObject json)
public static AmadronOffer fromJson(net.minecraft.util.ResourceLocation id, com.google.gson.JsonObject json) throws com.mojang.brigadier.exceptions.CommandSyntaxException
com.mojang.brigadier.exceptions.CommandSyntaxExceptionpublic 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 AmadronRecipe