Esempio n. 1
0
  public static EnumGeckoType getTypeFromItem(ItemStack stack1, ItemStack stack2) {
    if (stack1 == null || stack2 == null) {
      return null;
    }

    ItemStack sapling1 = new ItemStack(Blocks.sapling);
    ItemStack sapling2 = new ItemStack(Blocks.sapling);

    for (EnumGeckoType type : VALUES) {
      sapling1.setItemDamage(type.saplingTypes.getValue0());
      sapling2.setItemDamage(type.saplingTypes.getValue1());

      if (SAPUtils.areStacksEqualWithWCV(sapling1, stack1)
          && SAPUtils.areStacksEqualWithWCV(sapling2, stack2)) {
        return type;
      }
    }

    return null;
  }
Esempio n. 2
0
  public static EnumBunnyType getTypeFromItem(ItemStack stack) {
    if (stack == null) {
      return null;
    }

    if (SAPUtils.isIndexInRange(VALUES, stack.getItemDamage())) {
      return VALUES[stack.getItemDamage()];
    }

    return null;
  }
Esempio n. 3
0
  public static EnumHorseType getTypeFromItem(ItemStack stack) {
    if (stack == null) {
      return null;
    }

    if (stack.getItem() == Item.getItemFromBlock(Blocks.tallgrass) && stack.getItemDamage() == 0) {
      return null;
    }

    for (EnumHorseType type : VALUES) {
      if (type.item == null) {
        return null;
      }

      if (SAPUtils.areStacksEqualWithWCV(type.item, stack)) {
        return type;
      }
    }

    return null;
  }