Exemplo n.º 1
0
  @Override
  public boolean matches(InventoryCrafting inventoryCrafting, World world) {
    ItemStack biomeRadar = null;
    ItemStack biomeEssence = null;

    for (int i = 0; i < 3; ++i) {
      for (int j = 0; j < 3; ++j) {
        ItemStack itemstack = inventoryCrafting.getStackInRowAndColumn(j, i);

        if (itemstack != null) {
          if (itemstack.getItem() == BOPItemHelper.get("biomeFinder"))
            biomeRadar = itemstack.copy();
          else if (itemstack.getItem() == BOPItemHelper.get("biomeEssence"))
            biomeEssence = itemstack.copy();
        }
      }
    }

    if (biomeRadar != null && biomeEssence != null) {
      if (!biomeEssence.hasTagCompound() || !biomeEssence.getTagCompound().hasKey("biomeID"))
        return false;

      int biomeID = biomeEssence.getTagCompound().getInteger("biomeID");

      if (!biomeRadar.hasTagCompound()) biomeRadar.setTagCompound(new NBTTagCompound());

      biomeRadar.getTagCompound().setInteger("biomeIDToFind", biomeID);
      biomeRadar.getTagCompound().setBoolean("foundBiome", false);

      recipeOutput = biomeRadar;

      return true;
    } else return false;
  }
Exemplo n.º 2
0
 @Override
 public boolean getIsRepairable(ItemStack itemToRepair, ItemStack itemToRepairWith) {
   if (textureID == 1
       && itemToRepairWith.getItem() == BOPItemHelper.get("misc")
       && itemToRepairWith.getItemDamage() == 2) return true;
   else return false;
 }