示例#1
0
 public static BufferedImage rendershort(List<ItemInfo> info) {
   ItemInfo.Name nm = find(ItemInfo.Name.class, info);
   if (nm == null) return (null);
   BufferedImage img = nm.str.img;
   Alchemy ch = find(Alchemy.class, info);
   if (ch != null)
     img =
         ItemInfo.catimgsh(
             5, img, ch.smallmeter(), Text.std.renderf("(%d%% pure)", (int) (ch.a[0] * 100)).img);
   return (img);
 }
示例#2
0
  // checks to see if the player has enough of a list of items
  public static boolean isEnough(String itemName, Player player) {
    ArrayList<ItemStack> reqItems = Alchemy.getRecipies().get(itemName);
    boolean enoughItemFlag = true;
    int currTotal = 0;
    for (int i = 1; i < reqItems.size(); i++) {
      ItemStack currItem = new ItemStack(reqItems.get(i).getTypeId(), reqItems.get(i).getAmount());

      int neededAmount = reqItems.get(i).getAmount();
      currTotal = getTotalItems(currItem, player);
      if (neededAmount > currTotal) {
        enoughItemFlag = false;
      }
    }
    return enoughItemFlag;
  }