private void processItem(int i) { ItemStack itemstack = RecipesExtractor.getRecipes().getExtractionResult(inv[i]); // ReikaJavaLibrary.pConsole("sSmelt :"+(inv[i+4] == null)+" - // "+ReikaItemHelper.matchStacks(inv[i+4], itemstack)); // ReikaOreHelper ore = i == 0 ? ReikaOreHelper.getFromVanillaOre(inv[i].getItem()) : // this.getVanillaOreByItem(inv[i]); OreType ore = this.getOreType(inv[i]); // ReikaJavaLibrary.pConsole(ore, Side.SERVER); int num = this.getSmeltNumber(i, ore, inv[i]); if (inv[i + 4] == null) { inv[i + 4] = itemstack.copy(); inv[i + 4].stackSize *= num; } else if (ReikaItemHelper.matchStacks(inv[i + 4], itemstack)) inv[i + 4].stackSize += num; if (i == 0 && !bedrock && drillTime > 0 && ConfigRegistry.EXTRACTORMAINTAIN.getState()) { drillTime--; } if (i == 3) { this.bonusItems(inv[i]); RotaryAchievements.EXTRACTOR.triggerAchievement(this.getPlacer()); if (ore.getRarity() == OreRarity.RARE) RotaryAchievements.RAREEXTRACT.triggerAchievement(this.getPlacer()); } inv[i].stackSize--; if (i == 1 || i == 2) tank.removeLiquid(125); if (inv[i].stackSize <= 0) inv[i] = null; }
private int getSmeltNumber(int stage, OreType ore, ItemStack is) { if (bedrock && stage == 0) return 2; // ReikaJavaLibrary.pConsole(RotaryConfig.getDifficulty()); if (ore != null) { if (ore.getRarity() == OreRarity.RARE) { if (ReikaRandomHelper.doWithChance(oreCopyRare / 100D)) return 2; else return 1; } boolean nether = ore instanceof ModOreList && ((ModOreList) ore).isNetherOres(); if (is.getItemDamage() == 1 && (ore == ModOreList.FORCE || ore == ModOreList.MIMICHITE)) nether = true; if (ReikaItemHelper.matchStackWithBlock(is, MagicCropHandler.getInstance().netherOreID)) nether = true; if (nether) { // .isNetherOres() if (ReikaRandomHelper.doWithChance(oreCopyNether / 100D)) return 2; else return 1; } } return ReikaRandomHelper.doWithChance(oreCopy / 100D) ? 2 : 1; }