public static ComparableItemStackValidatedNBT convertInput(ItemStack stack) { return new ComparableItemStackValidatedNBT(stack, oreValidator); }
public ComparableItemStackValidatedNBT(ItemStack stack) { super(stack); this.validator = DEFAULT_VALIDATOR; this.oreID = getOreID(stack); this.oreName = ItemHelper.oreProxy.getOreName(oreID); }
public static TransposerRecipe removeFillRecipe(ItemStack input, FluidStack fluid) { return recipeMapFill.remove(asList(convertInput(input).hashCode(), FluidHelper.getFluidHash(fluid))); }
public static BrewerRecipe removeRecipe(ItemStack input, FluidStack fluid) { return recipeMap.remove(asList(convertInput(input).hashCode(), FluidHelper.getFluidHash(fluid))); }
public static ComparableItemStackValidatedNBT convertInput(ItemStack stack) { return new ComparableItemStackValidatedNBT(stack, oreValidator); }
public static void refresh() { Map<List<Integer>, BrewerRecipe> tempMap = new Object2ObjectOpenHashMap<>(recipeMap.size()); Set<ComparableItemStackValidatedNBT> tempSet = new ObjectOpenHashSet<>(); BrewerRecipe tempRecipe; for (Entry<List<Integer>, BrewerRecipe> entry : recipeMap.entrySet()) { tempRecipe = entry.getValue(); ComparableItemStackValidatedNBT input = convertInput(tempRecipe.input); tempMap.put(asList(input.hashCode(), FluidHelper.getFluidHash(tempRecipe.inputFluid)), tempRecipe); tempSet.add(input); } recipeMap.clear(); recipeMap = tempMap; validationSet.clear(); validationSet = tempSet; }
public ComparableItemStackValidatedNBT(ItemStack stack, @Nonnull OreValidator validator) { super(stack); this.validator = validator; this.oreID = getOreID(stack); this.oreName = ItemHelper.oreProxy.getOreName(oreID); }
public static ComparableItemStackValidatedNBT convertInput(ItemStack stack) { return new ComparableItemStackValidatedNBT(stack, oreValidator); }
public static BrewerRecipe getRecipe(ItemStack input, FluidStack fluid) { return input.isEmpty() || fluid == null ? null : recipeMap.get(asList(convertInput(input).hashCode(), FluidHelper.getFluidHash(fluid))); }
public static ComparableItemStackValidatedNBT convertInput(ItemStack stack) { return new ComparableItemStackValidatedNBT(stack, oreValidator); }
public static TransposerRecipe getFillRecipe(ItemStack input, FluidStack fluid) { return input.isEmpty() || fluid == null ? null : recipeMapFill.get(asList(convertInput(input).hashCode(), FluidHelper.getFluidHash(fluid))); }
public static ComparableItemStackValidatedNBT convertInput(ItemStack stack) { return new ComparableItemStackValidatedNBT(stack); }
tempRecipe = entry.getValue(); ComparableItemStackValidatedNBT input = convertInput(tempRecipe.input); tempFill.put(asList(input.hashCode(), FluidHelper.getFluidHash(tempRecipe.fluid)), tempRecipe); tempSet.add(input);
public static CrucibleRecipe removeRecipe(ItemStack input) { ComparableItemStackValidatedNBT inputCrucible = new ComparableItemStackValidatedNBT(input); lavaSet.remove(inputCrucible); return recipeMap.remove(inputCrucible); }
public static BrewerRecipe addRecipe(int energy, ItemStack input, FluidStack inputFluid, FluidStack outputFluid) { if (input.isEmpty() || inputFluid == null || outputFluid == null || energy <= 0 || recipeExists(input, inputFluid)) { return null; } BrewerRecipe recipe = new BrewerRecipe(input, inputFluid, outputFluid, energy); recipeMap.put(asList(convertInput(input).hashCode(), FluidHelper.getFluidHash(inputFluid)), recipe); validationSet.add(convertInput(input)); validationFluids.add(inputFluid.getFluid().getName()); return recipe; }
public static CrucibleRecipe getRecipe(ItemStack input) { return input.isEmpty() ? null : recipeMap.get(new ComparableItemStackValidatedNBT(input)); }
public static TransposerRecipe addFillRecipe(int energy, ItemStack input, ItemStack output, FluidStack fluid, boolean reversible) { if (input.isEmpty() || output.isEmpty() || fluid == null || fluid.amount <= 0 || energy <= 0) { return null; } if (fillRecipeExists(input, fluid)) { return null; } TransposerRecipe recipeFill = new TransposerRecipe(input, output, fluid, energy, 100); recipeMapFill.put(asList(convertInput(input).hashCode(), FluidHelper.getFluidHash(fluid)), recipeFill); validationSet.add(convertInput(input)); if (reversible) { addExtractRecipe(energy, output, input, fluid, 100, false); } return recipeFill; }
public static boolean isLava(ItemStack input) { return !input.isEmpty() && lavaSet.contains(new ComparableItemStackValidatedNBT(input)); }
public static void refresh() { Map<ComparableItemStackValidatedNBT, CrucibleRecipe> tempMap = new Object2ObjectOpenHashMap<>(recipeMap.size()); Set<ComparableItemStackValidatedNBT> tempSet = new ObjectOpenHashSet<>(); CrucibleRecipe tempRecipe; for (Entry<ComparableItemStackValidatedNBT, CrucibleRecipe> entry : recipeMap.entrySet()) { tempRecipe = entry.getValue(); ComparableItemStackValidatedNBT input = new ComparableItemStackValidatedNBT(tempRecipe.input); tempMap.put(input, tempRecipe); if (FluidRegistry.LAVA.equals(tempRecipe.getOutput().getFluid())) { tempSet.add(input); } } recipeMap.clear(); recipeMap = tempMap; lavaSet.clear(); lavaSet = tempSet; }
public static CrucibleRecipe addRecipe(int energy, ItemStack input, FluidStack output) { if (input.isEmpty() || output == null || output.amount <= 0 || energy <= 0 || recipeExists(input)) { return null; } ComparableItemStackValidatedNBT inputCrucible = new ComparableItemStackValidatedNBT(input); CrucibleRecipe recipe = new CrucibleRecipe(input, output, energy); recipeMap.put(inputCrucible, recipe); if (FluidRegistry.LAVA.equals(output.getFluid())) { lavaSet.add(inputCrucible); } return recipe; }