Class WeightedTrade
java.lang.Object
com.hypixel.hytale.builtin.adventure.shop.barter.WeightedTrade
- All Implemented Interfaces:
IWeightedElement
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final BuilderCodec<WeightedTrade> static final WeightedTrade[]protected BarterItemStack[]protected BarterItemStackprotected int[]protected double -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedWeightedTrade(double weight, BarterItemStack output, BarterItemStack[] input, int stock) WeightedTrade(double weight, BarterItemStack output, BarterItemStack[] input, int stockMin, int stockMax) -
Method Summary
Modifier and TypeMethodDescriptiongetInput()intintint[]doublebooleanintresolveStock(Random random) toBarterTrade(Random random) toString()
-
Field Details
-
CODEC
-
EMPTY_ARRAY
-
weight
protected double weight -
output
-
input
-
stockRange
protected int[] stockRange
-
-
Constructor Details
-
WeightedTrade
public WeightedTrade(double weight, @Nonnull BarterItemStack output, @Nonnull BarterItemStack[] input, int stock) -
WeightedTrade
public WeightedTrade(double weight, @Nonnull BarterItemStack output, @Nonnull BarterItemStack[] input, int stockMin, int stockMax) -
WeightedTrade
protected WeightedTrade()
-
-
Method Details
-
getWeight
public double getWeight()- Specified by:
getWeightin interfaceIWeightedElement
-
getOutput
-
getInput
-
getStockRange
@Nonnull public int[] getStockRange() -
hasStockRange
public boolean hasStockRange() -
getStockMin
public int getStockMin() -
getStockMax
public int getStockMax() -
resolveStock
-
toBarterTrade
-
toBarterTrade
-
toString
-