private void resetRecipe() { if (currentRecipe == null) { currentProduct = null; productionTime = 0; timePerItem = 0; } else { currentProduct = currentRecipe.getProduct(); productionTime = currentRecipe.getTimePerItem(); timePerItem = currentRecipe.getTimePerItem(); } }
@Override protected String getRecipeInfo() { return recipe.getCraftingGridRecipe().getOutput().getDisplayName(); } }
public CarpenterRecipeWrapper(ICarpenterRecipe recipe) { super(recipe); IDescriptiveRecipe craftingGridRecipe = recipe.getCraftingGridRecipe(); NonNullList<NonNullList<ItemStack>> inputs = craftingGridRecipe.getRawIngredients(); this.inputStacks = new ArrayList<>(); for (List<ItemStack> stacks : inputs) { List<ItemStack> copy = new ArrayList<>(); copy.addAll(stacks); this.inputStacks.add(copy); } }
public static void getCentrifugeOutputs(ItemStack inputStack, NonNullList<ItemStack> outputItems) { for (ICentrifugeRecipe recipe : RecipeManagers.centrifugeManager.recipes()) { if (inputStack.isItemEqual(recipe.getInput())) { outputItems.addAll(recipe.getAllProducts().keySet()); } } }
public static void getSqueezerFluidOutputs(ItemStack inputStack, NonNullList<FluidStack> outputFluids) { for (ISqueezerRecipe recipe : RecipeManagers.squeezerManager.recipes()) { if (matches(recipe, inputStack)) { outputFluids.add(recipe.getFluidOutput()); } } }
@Override public boolean checkIsRecipe(ICarpenterRecipe recipe) { if(recipe.getCraftingGridRecipe().getOutput().isItemEqual(output)) { if(fluidInput == null) { return true; } else { return fluidInput.isFluidEqual(recipe.getFluidResource()); } } return false; }
public static void getSqueezerOutputs(ItemStack inputStack, NonNullList<ItemStack> outputItems) { for (ISqueezerRecipe recipe : RecipeManagers.squeezerManager.recipes()) { if (matches(recipe, inputStack)) { if (!recipe.getRemnants().isEmpty()) { outputItems.add(recipe.getRemnants()); } } } }
private static void addUncrating(ItemStack crateStack, ItemStack uncrated) { ItemStack product = new ItemStack(uncrated.getItem(), 9, uncrated.getItemDamage()); RecipeManagers.carpenterManager.addRecipe(Constants.CARPENTER_UNCRATING_CYCLES, ItemStack.EMPTY, product, "#", '#', crateStack); } }
private static boolean matches(ISqueezerRecipe recipe, ItemStack inputStack) { for (ItemStack obj : recipe.getResources()) { if (inputStack.isItemEqual(obj)) { return true; } } return false; } }
@Override public String getRecipeInfo() { return LogHelper.getStackDescription(recipe.getFluidOutput()); } }
@Override protected String getRecipeInfo() { return LogHelper.getStackDescription(recipe.getInput()); } }
@Override public String getRecipeInfo() { return LogHelper.getStackDescription(recipe.getProduct()); } }
@Override public String getRecipeInfo() { return LogHelper.getStackDescription(recipe.getResource()); } }
@Override public String getRecipeInfo() { return recipe.getOutput().getName(); } }
@Override public String getRecipeInfo() { return LogHelper.getStackDescription(recipe.getRecipeOutput()); } }
public void addRecipe() { if (isActive()) { RecipeManagers.centrifugeManager.addRecipe(20, this.get(1), this.products); } }
@Override public float getRemnantsChance() { return getRecipe().getRemnantsChance(); } }
public static boolean isPlan(ItemStack plan) { for (IFabricatorRecipe recipe : recipes) { if (ItemStackUtil.isIdenticalItem(recipe.getPlan(), plan)) { return true; } } return false; }
private static float determineResourceMod(ItemStack itemstack) { if (!(itemstack.getItem() instanceof IVariableFermentable)) { return 1.0f; } return ((IVariableFermentable) itemstack.getItem()).getFermentationModifier(itemstack); }
@Override public boolean workCycle() { if (!removeLiquidResources(true)) { return false; } if (!removeItemResources(true)) { return false; } if (currentRecipe != null) { ItemStack pendingProduct = currentRecipe.getCraftingGridRecipe().getOutput(); InventoryUtil.tryAddStack(this, pendingProduct, InventoryCarpenter.SLOT_PRODUCT, InventoryCarpenter.SLOT_PRODUCT_COUNT, true); } return true; }