public static ComparableItemStackValidated convertInput(ItemStack stack) { return new ComparableItemStackValidated(stack, oreValidator); }
public ComparableItemStackValidated(ItemStack stack, @Nonnull OreValidator validator) { super(stack); this.validator = validator; this.oreID = getOreID(stack); this.oreName = ItemHelper.oreProxy.getOreName(oreID); }
public ComparableItemStackValidated(ItemStack stack) { super(stack); this.validator = DEFAULT_VALIDATOR; this.oreID = getOreID(stack); this.oreName = ItemHelper.oreProxy.getOreName(oreID); }
public static ComparableItemStackValidated convertInput(ItemStack stack) { return new ComparableItemStackValidated(stack); }
public static ComparableItemStackValidated convertInput(ItemStack stack) { return new ComparableItemStackValidated(stack, oreValidator); }
public static ComparableItemStackValidated convertInput(ItemStack stack) { return new ComparableItemStackValidated(stack, oreValidator); }
public static ComparableItemStackValidated convertInput(ItemStack stack) { return new ComparableItemStackValidated(stack, oreValidator); }
public static ComparableItemStackValidated convertInput(ItemStack stack) { return new ComparableItemStackValidated(stack, oreValidator); }
public static CompactorRecipe removeRecipe(ItemStack input, Mode mode) { switch (mode) { case ALL: return recipeMapAll.remove(new ComparableItemStackValidated(input)); case PLATE: return recipeMapPlate.remove(new ComparableItemStackValidated(input)); case COIN: return recipeMapCoin.remove(new ComparableItemStackValidated(input)); default: return recipeMapGear.remove(new ComparableItemStackValidated(input)); } }
public static FactorizerRecipe removeRecipe(ItemStack input, boolean reverse) { if (reverse) { return recipeMapReverse.remove(new ComparableItemStackValidated(input)); } else { return recipeMap.remove(new ComparableItemStackValidated(input)); } }
public static ChargerRecipe removeRecipe(ItemStack input) { return recipeMap.remove(new ComparableItemStackValidated(input)); }
public static void refresh() { Map<ComparableItemStackValidated, ChargerRecipe> tempMap = new Object2ObjectOpenHashMap<>(recipeMap.size()); ChargerRecipe tempRecipe; for (Entry<ComparableItemStackValidated, ChargerRecipe> entry : recipeMap.entrySet()) { tempRecipe = entry.getValue(); tempMap.put(new ComparableItemStackValidated(tempRecipe.input), tempRecipe); } recipeMap.clear(); recipeMap = tempMap; }
public static ChargerRecipe getRecipe(ItemStack input) { if (input.isEmpty()) { return null; } ComparableItemStackValidated query = new ComparableItemStackValidated(input); ChargerRecipe recipe = recipeMap.get(query); if (recipe == null) { query.metadata = OreDictionary.WILDCARD_VALUE; recipe = recipeMap.get(query); } return recipe; }
public static boolean isItemValid(ItemStack input) { return !input.isEmpty() && validationSet.contains(new ComparableItemStackValidated(input)); }
public static CompactorRecipe addRecipe(int energy, ItemStack input, ItemStack output, Mode mode) { if (input.isEmpty() || output.isEmpty() || energy <= 0 || recipeExists(input, mode)) { return null; } CompactorRecipe recipe = new CompactorRecipe(input, output, energy); switch (mode) { case ALL: recipeMapAll.put(new ComparableItemStackValidated(input), recipe); break; case PLATE: recipeMapPlate.put(new ComparableItemStackValidated(input), recipe); break; case COIN: recipeMapCoin.put(new ComparableItemStackValidated(input), recipe); break; case GEAR: recipeMapGear.put(new ComparableItemStackValidated(input), recipe); break; } validationSet.add(new ComparableItemStackValidated(input)); return recipe; }
public static void refresh() { Map<ComparableItemStackValidated, FactorizerRecipe> tempMap = new Object2ObjectOpenHashMap<>(recipeMap.size()); Map<ComparableItemStackValidated, FactorizerRecipe> tempMapReverse = new Object2ObjectOpenHashMap<>(recipeMapReverse.size()); FactorizerRecipe tempRecipe; for (Map.Entry<ComparableItemStackValidated, FactorizerRecipe> entry : recipeMap.entrySet()) { tempRecipe = entry.getValue(); ComparableItemStackValidated input = new ComparableItemStackValidated(tempRecipe.input); tempMap.put(input, tempRecipe); } for (Map.Entry<ComparableItemStackValidated, FactorizerRecipe> entry : recipeMapReverse.entrySet()) { tempRecipe = entry.getValue(); ComparableItemStackValidated input = new ComparableItemStackValidated(tempRecipe.input); tempMapReverse.put(input, tempRecipe); } recipeMap.clear(); recipeMapReverse.clear(); recipeMap = tempMap; recipeMapReverse = tempMapReverse; }
public static FactorizerRecipe getRecipe(ItemStack input, boolean reverse) { if (input.isEmpty()) { return null; } ComparableItemStackValidated query = new ComparableItemStackValidated(input); FactorizerRecipe recipe; if (reverse) { recipe = recipeMapReverse.get(query); if (recipe == null) { query.metadata = OreDictionary.WILDCARD_VALUE; recipe = recipeMapReverse.get(query); } } else { recipe = recipeMap.get(query); if (recipe == null) { query.metadata = OreDictionary.WILDCARD_VALUE; recipe = recipeMap.get(query); } } return recipe; }
public static FactorizerRecipe addRecipe(ItemStack input, ItemStack output, boolean reverse) { if (input.isEmpty() || output.isEmpty() || recipeExists(input, reverse)) { return null; } FactorizerRecipe recipe = new FactorizerRecipe(input, output); if (reverse) { recipeMapReverse.put(new ComparableItemStackValidated(input), recipe); } else { recipeMap.put(new ComparableItemStackValidated(input), recipe); } return recipe; }
return null; ComparableItemStackValidated query = new ComparableItemStackValidated(input); CompactorRecipe recipe = null;
ComparableItemStackValidated input = new ComparableItemStackValidated(tempRecipe.input); tempPlate.put(input, tempRecipe); tempSet.add(input); ComparableItemStackValidated input = new ComparableItemStackValidated(tempRecipe.input); tempPlate.put(input, tempRecipe); tempSet.add(input); ComparableItemStackValidated input = new ComparableItemStackValidated(tempRecipe.input); tempMint.put(input, tempRecipe); tempSet.add(input); ComparableItemStackValidated input = new ComparableItemStackValidated(tempRecipe.input); tempGear.put(input, tempRecipe); tempSet.add(input);