/** * Gets the sell price of an item (that is, how much a server will buy an item from a player for). * * @param itemStack The item to check. * @return The price, or {@link Optional} if not being bought. */ default Optional<Double> getSellPrice(ItemStack itemStack) { Preconditions.checkNotNull(itemStack); return getSellPrice(itemStack.createSnapshot()); }
/** * Gets the buy price of an item (that is, how much a server will sell an item to a player for). * * @param type The item to check. * @return The price, or {@link Optional} if not being sold. */ default Optional<Double> getBuyPrice(ItemType type) { Preconditions.checkNotNull(type); return getBuyPrice(ItemStack.of(type, 1)); }
/** * Gets the buy price of an item (that is, how much a server will sell an item to a player for). * * @param itemStack The item to check. * @return The price, or {@link Optional} if not being sold. */ default Optional<Double> getBuyPrice(ItemStack itemStack) { Preconditions.checkNotNull(itemStack); return getBuyPrice(itemStack.createSnapshot()); }
/** * Gets the sell price of an item (that is, how much a server will buy an item from a player for). * * @param type The item to check. * @return The price, or {@link Optional} if not being bought. */ default Optional<Double> getSellPrice(ItemType type) { Preconditions.checkNotNull(type); return getSellPrice(ItemStack.of(type, 1)); }