Exemplo n.º 1
0
 /** Check if the stack is a valid item for this slot. Always true beside for the armor slots. */
 @Override
 public boolean isItemValid(ItemStack is) {
   if (ItemRegistry.EXTRACTS.matchItem(is) && is.getItemDamage() < 24 && is.getItemDamage() >= 16)
     return true;
   if (ExtractorModOres.isModOreIngredient(is)
       && ExtractorModOres.isSolution(
           ModOreList.getEntryFromDamage(is.getItemDamage() / 4), is.getItemDamage())) return true;
   if (ItemRegistry.CUSTOMEXTRACT.matchItem(is) && is.getItemDamage() % 4 == 2) return true;
   return false;
 }
 @Override
 public boolean isItemValidForSlot(int slot, ItemStack is) {
   if (slot > 3 && slot < 9) return false;
   if (slot == 0)
     return ReikaBlockHelper.isOre(is)
         || CustomExtractLoader.instance.getEntryFromOreBlock(is) != null;
   if (ItemRegistry.EXTRACTS.matchItem(is)) {
     return slot == 1 + is.getItemDamage() / 8;
   } else if (ItemRegistry.MODEXTRACTS.matchItem(is)) {
     return slot == 1 + is.getItemDamage() % 4;
   } else if (ItemRegistry.CUSTOMEXTRACT.matchItem(is)) {
     return slot == 1 + is.getItemDamage() % 4;
   }
   if (slot == 9)
     return !bedrock
         && ConfigRegistry.EXTRACTORMAINTAIN.getState()
         && ReikaItemHelper.matchStacks(is, ItemStacks.drill);
   return false;
 }
 private OreType getOreType(ItemStack is) {
   if (is.getItem() == ItemRegistry.EXTRACTS.getItemInstance()) {
     return ReikaOreHelper.oreList[is.getItemDamage() % ReikaOreHelper.oreList.length];
   } else if (is.getItem() == ItemRegistry.MODEXTRACTS.getItemInstance()) {
     return ExtractorModOres.getOreFromExtract(is);
   } else if (is.getItem() == ItemRegistry.CUSTOMEXTRACT.getItemInstance()) {
     return ItemCustomModOre.getExtractType(is);
   } else {
     OreType ore = ReikaOreHelper.getFromVanillaOre(is);
     if (ore != null) return ore;
     ore = ReikaOreHelper.getEntryByOreDict(is);
     if (ore != null) return ore;
     ore = ModOreList.getModOreFromOre(is);
     if (ore != null) return ore;
     ore = CustomExtractLoader.instance.getEntryFromOreBlock(is);
     if (ore != null) return ore;
   }
   return null;
 }