Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package org.brokenarrow.storage.Crafting;
- import org.brokenarrow.storage.Crafting.RecipeCache.RecipeData;
- import org.brokenarrow.storage.CustomContainersMainClass;
- import org.brokenarrow.storage.Settings.LogTimingsReport;
- import org.brokenarrow.storage.Settings.MainSettings;
- import org.brokenarrow.storage.util.ItemUtily;
- import org.bukkit.Bukkit;
- import org.bukkit.Location;
- import org.bukkit.Material;
- import org.bukkit.inventory.Inventory;
- import org.bukkit.inventory.ItemStack;
- import java.util.*;
- import java.util.logging.Level;
- public class CraftingUtilitycopy {
- private static final Map<Location, Map<ItemStack, ItemStack>> craftedItems = new HashMap<>();
- private final HashMap<ItemStack, ItemStack> itemStacksList = new HashMap<>();
- private static final HashMap<Location, Boolean> noMatchRecipe = new HashMap<>();
- private final RecipeCache recipeChache = CustomContainersMainClass.getInstance().getRecipeCache();
- private Inventory inventory;
- private Location location;
- private List<ItemStack> listOfOutputRecipes;
- private boolean ifChestFull = false;
- private boolean noMatch;
- public CraftingUtilitycopy(Inventory inventory, Location location, List<ItemStack> listOfItemsToCraft) {
- this.inventory = inventory;
- this.location = location;
- this.listOfOutputRecipes = listOfItemsToCraft;
- }
- public HashMap<Integer, ItemStack> checkCraftingRecipeExist() {
- HashMap<Integer, ItemStack> outputItemsIfNoSpaceInChest = new HashMap<>();
- int itemAmont = 0;
- boolean noMatch = true;
- long timess = System.nanoTime();
- //for (Map.Entry<ItemStack, RecipeCache.RecipeData> craftingRecipe : recipeChache.getRecipe().entrySet()) {
- for (ItemStack recipeOutputItemList : listOfOutputRecipes) {
- Map<Material, Integer> amountOfItemsInventory = getItemsAmount(recipeOutputItemList, this.inventory);
- Material recipeOutputMaterial = recipeOutputItemList.getType();
- RecipeData recipeData = this.recipeChache.getRecipe(recipeOutputItemList);
- if (recipeData == null) {
- CustomContainersMainClass.getInstance().sendLogMsg(Level.WARNING, "You has " + recipeOutputItemList.getAmount() + " of item " + recipeOutputItemList.getType() + " on location " + this.location);
- continue;
- }
- Set<ItemStack> matrialNameFirst = recipeData.getMatrial1();
- Set<ItemStack> matrialNameSecond = recipeData.getMatrial2();
- Set<ItemStack> matrialNameThird = recipeData.getMatrial3();
- Set<ItemStack> matrialNameFourth = recipeData.getMatrial4();
- Set<ItemStack> matrialNameFifth = recipeData.getMatrial5();
- if (!amountOfItemsInventory.isEmpty()) {
- Map<Material, ItemStack> itemStacks = setItemstacksAmount(amountOfItemsInventory, recipeOutputItemList);
- if (ifItAreColor(recipeOutputItemList, recipeOutputItemList, itemStacks) || (matrialNameFirst != null &&
- matrialNameSecond != null && matrialNameSecond.contains(ItemUtily.createItemStack()) && matrialNameThird != null && matrialNameThird.contains(ItemUtily.createItemStack()) &&
- matrialNameFourth != null && matrialNameFourth.contains(ItemUtily.createItemStack()) && matrialNameFifth != null && matrialNameFifth.contains(ItemUtily.createItemStack()))) {
- if (!itemStacks.isEmpty() && checkAmountForRecipeFirst(itemStacks, recipeOutputItemList, returnItemToRecipe(matrialNameFirst, amountOfItemsInventory))) {
- Material material = returnItemToRecipe(matrialNameFirst, amountOfItemsInventory);
- Material getmatrialName = recipeOutputItemList.getType();
- outputItemsIfNoSpaceInChest = inventory.addItem(new ItemStack(getmatrialName, checkIfItTallFlowers(material) ? recipeChache.getRecipe().get(recipeOutputItemList).getTotalAmount() + 1 : recipeChache.getRecipe().get(recipeOutputItemList).getTotalAmount()));
- if (outputItemsIfNoSpaceInChest.isEmpty()) {
- if (craftedItems.containsKey(this.location) && craftedItems.get(this.location).containsKey(ItemUtily.createItemStackAsOne(new ItemStack(material)))) {
- itemAmont = craftedItems.get(this.location).get(ItemUtily.createItemStackAsOne(new ItemStack(material))).getAmount();
- ItemStack items = craftedItems.get(this.location).get(ItemUtily.createItemStackAsOne(new ItemStack(material)));
- items.clone().setAmount(itemAmont);
- this.itemStacksList.put(ItemUtily.createItemStackAsOne(new ItemStack(material)), items);
- }
- this.itemStacksList.put(ItemUtily.createItemStackAsOne(new ItemStack(material)), ItemUtily.createItemStackWhitAmount(getmatrialName, (checkIfItTallFlowers(material) ? recipeChache.getRecipe().get(recipeOutputItemList).getTotalAmount() + 1 + (craftedItems.isEmpty() ? 0 : recipeChache.getRecipe().get(recipeOutputItemList).getTotalAmount()) : recipeChache.getRecipe().get(recipeOutputItemList).getTotalAmount() + (craftedItems.isEmpty() ? 0 : itemAmont))));
- craftedItems.put(this.location, this.itemStacksList);
- takeItemsRecipeIngrediens(inventory, recipeOutputItemList, itemStacks, material);
- }
- }
- } else if (ifItAreColorMatchTwoItems(recipeOutputItemList, recipeOutputItemList, itemStacks) || (!ifItAreColor(recipeOutputItemList, recipeOutputItemList, itemStacks) && matrialNameFirst != null &&
- matrialNameSecond != null && matrialNameThird != null && matrialNameThird.contains(ItemUtily.createItemStack()) && matrialNameFourth != null
- && matrialNameFourth.contains(ItemUtily.createItemStack()) && matrialNameFifth != null && matrialNameFifth.contains(ItemUtily.createItemStack()))) {
- if (!itemStacks.isEmpty() && checkAmountForRecipeFirst(itemStacks, recipeOutputItemList, returnItemToRecipe(this.recipeChache.getRecipe(recipeOutputItemList).getMatrial2(), amountOfItemsInventory)) &&
- checkAmountForRecipeSecond(itemStacks, recipeOutputItemList)) {
- Material material = returnItemToRecipe(matrialNameFirst, amountOfItemsInventory);
- Material materialSecond = returnItemToRecipe(matrialNameSecond, amountOfItemsInventory);
- outputItemsIfNoSpaceInChest = inventory.addItem(ItemUtily.createItemStackWhitAmount(recipeOutputMaterial, isAColor(recipeOutputMaterial) ? (recipeOutputMaterial == Material.LIGHT_BLUE_DYE ? this.recipeChache.getRecipe(recipeOutputItemList).getTotalAmount() : recipeChache.getRecipe().get(recipeOutputItemList).getTotalAmount() * 2) + addExtraIfSpecialcolor(materialSecond, recipeOutputMaterial) : recipeChache.getRecipe().get(recipeOutputItemList).getTotalAmount()));
- if (outputItemsIfNoSpaceInChest.isEmpty()) {
- if (craftedItems.containsKey(this.location) && craftedItems.get(this.location).containsKey(ItemUtily.createItemStackAsOne(new ItemStack(material)))) {
- itemAmont = craftedItems.get(this.location).get(ItemUtily.createItemStackAsOne(new ItemStack(material))).getAmount();
- ItemStack items = craftedItems.get(this.location).get(ItemUtily.createItemStackAsOne(new ItemStack(material)));
- this.itemStacksList.put(ItemUtily.createItemStackAsOne(new ItemStack(material)), items);
- }
- this.itemStacksList.put(ItemUtily.createItemStackAsOne(new ItemStack(material)), ItemUtily.createItemStackWhitAmount(recipeOutputMaterial, isAColor(recipeOutputMaterial) ? ((recipeOutputMaterial == Material.LIGHT_BLUE_DYE ? this.recipeChache.getRecipe(recipeOutputItemList).getTotalAmount() : this.recipeChache.getRecipe(recipeOutputItemList).getTotalAmount() * 2) + (craftedItems.isEmpty() ? 0 : itemAmont) + addExtraIfSpecialcolor(materialSecond, recipeOutputMaterial)) : (this.recipeChache.getRecipe(recipeOutputItemList).getTotalAmount() + (craftedItems.isEmpty() ? 0 : itemAmont))));
- craftedItems.put(this.location, this.itemStacksList);
- takeItemsRecipeIngrediens(inventory, recipeOutputItemList, itemStacks, materialSecond);
- }
- }
- } else if ((!ifItAreColor(recipeOutputItemList, recipeOutputItemList, itemStacks) && matrialNameSecond != null && matrialNameThird != null && matrialNameFourth != null
- && matrialNameFourth.contains(ItemUtily.createItemStack()) && matrialNameFifth != null && matrialNameFifth.contains(ItemUtily.createItemStack()))) {
- if (/*isItemsMatch(recipeKeyitem, itemListForCrafting) &&*/
- !itemStacks.isEmpty() && checkAmountForRecipeFirst(itemStacks, recipeOutputItemList, returnItemToRecipe(this.recipeChache.getRecipe(recipeOutputItemList).getMatrial1(), amountOfItemsInventory)) &&
- checkAmountForRecipeSecond(itemStacks, recipeOutputItemList) && checkAmountForRecipeThird(itemStacks, recipeOutputItemList, returnItemToRecipe(this.recipeChache.getRecipe(recipeOutputItemList).getMatrial2(), amountOfItemsInventory))) {
- Material material = returnItemToRecipe(matrialNameFirst, amountOfItemsInventory);
- Material materialSecond = returnItemToRecipe(matrialNameSecond, amountOfItemsInventory);
- Material matrialThird = returnItemToRecipe(this.recipeChache.getRecipe(recipeOutputItemList).getMatrial3(), amountOfItemsInventory);
- outputItemsIfNoSpaceInChest = inventory.addItem(new ItemStack(recipeOutputMaterial, isAColor(recipeOutputMaterial) ? (recipeChache.getRecipe().get(recipeOutputItemList).getTotalAmount() + 1) + addExtraIfSpecialcolor(materialSecond, recipeOutputMaterial) : recipeChache.getRecipe().get(recipeOutputItemList).getTotalAmount()));
- if (outputItemsIfNoSpaceInChest.isEmpty()) {
- if (craftedItems.containsKey(this.location) && craftedItems.get(this.location).containsKey(ItemUtily.createItemStackAsOne(new ItemStack(material)))) {
- itemAmont = craftedItems.get(this.location).get(ItemUtily.createItemStackAsOne(new ItemStack(material))).getAmount();
- ItemStack items = craftedItems.get(this.location).get(ItemUtily.createItemStackAsOne(new ItemStack(material)));
- items.clone().setAmount(itemAmont);
- this.itemStacksList.put(ItemUtily.createItemStackAsOne(new ItemStack(material)), items);
- }
- this.itemStacksList.put(ItemUtily.createItemStackAsOne(new ItemStack(material)), ItemUtily.createItemStackWhitAmount(recipeOutputMaterial, isAColor(recipeOutputMaterial) ? (recipeChache.getRecipe().get(recipeOutputItemList).getTotalAmount() + 2) + addExtraIfSpecialcolor(materialSecond, recipeOutputMaterial) : (recipeChache.getRecipe().get(recipeOutputItemList).getTotalAmount() + (craftedItems.isEmpty() ? 0 : itemAmont))));
- craftedItems.put(this.location, this.itemStacksList);
- takeItemsRecipeIngrediens(inventory, recipeOutputItemList, itemStacks, materialSecond);
- }
- }
- } else if ((!ifItAreColor(recipeOutputItemList, recipeOutputItemList, itemStacks) && matrialNameSecond != null && matrialNameThird != null && matrialNameFourth != null
- && matrialNameFifth != null && matrialNameFifth.contains(ItemUtily.createItemStack()))) {
- if (/*isItemsMatch(recipeKeyitem, itemListForCrafting) &&*/
- !itemStacks.isEmpty() && checkAmountForRecipeFirst(itemStacks, recipeOutputItemList, returnItemToRecipe(this.recipeChache.getRecipe(recipeOutputItemList).getMatrial1(), amountOfItemsInventory)) &&
- checkAmountForRecipeSecond(itemStacks, recipeOutputItemList) && checkAmountForRecipeThird(itemStacks, recipeOutputItemList) &&
- checkAmountForRecipeFourth(itemStacks, recipeOutputItemList)) {
- Material material = returnItemToRecipe(matrialNameFirst, amountOfItemsInventory);
- Material materialSecond = returnItemToRecipe(matrialNameSecond, amountOfItemsInventory);
- outputItemsIfNoSpaceInChest = inventory.addItem(new ItemStack(recipeOutputMaterial, isAColor(recipeOutputMaterial) ? (recipeChache.getRecipe().get(recipeOutputItemList).getTotalAmount() + 2) + addExtraIfSpecialcolor(materialSecond, recipeOutputMaterial) : recipeChache.getRecipe().get(recipeOutputItemList).getTotalAmount()));
- if (outputItemsIfNoSpaceInChest.isEmpty()) {
- if (craftedItems.containsKey(this.location) && craftedItems.get(this.location).containsKey(ItemUtily.createItemStackAsOne(new ItemStack(material)))) {
- itemAmont = craftedItems.get(this.location).get(ItemUtily.createItemStackAsOne(new ItemStack(material))).getAmount();
- ItemStack items = craftedItems.get(this.location).get(ItemUtily.createItemStackAsOne(new ItemStack(material)));
- items.clone().setAmount(itemAmont);
- this.itemStacksList.put(ItemUtily.createItemStackAsOne(new ItemStack(material)), items);
- }
- this.itemStacksList.put(ItemUtily.createItemStackAsOne(new ItemStack(material)), ItemUtily.createItemStackWhitAmount(recipeOutputMaterial, isAColor(recipeOutputMaterial) ? (recipeChache.getRecipe().get(recipeOutputItemList).getTotalAmount() + 2) + addExtraIfSpecialcolor(materialSecond, recipeOutputMaterial) : (recipeChache.getRecipe().get(recipeOutputItemList).getTotalAmount() + (craftedItems.isEmpty() ? 0 : itemAmont))));
- craftedItems.put(this.location, this.itemStacksList);
- takeItemsRecipeIngrediens(inventory, recipeOutputItemList, itemStacks, null);
- }
- }
- } else if ((!ifItAreColor(recipeOutputItemList, recipeOutputItemList, itemStacks) && matrialNameFirst != null && matrialNameSecond != null && matrialNameThird != null && matrialNameFourth != null && matrialNameFifth != null)) {
- if (/*isItemsMatch(recipeKeyitem, itemListForCrafting) &&*/
- !itemStacks.isEmpty() && checkAmountForRecipeFirst(itemStacks, recipeOutputItemList, returnItemToRecipe(this.recipeChache.getRecipe(recipeOutputItemList).getMatrial1(), amountOfItemsInventory)) &&
- checkAmountForRecipeSecond(itemStacks, recipeOutputItemList) && checkAmountForRecipeThird(itemStacks, recipeOutputItemList) &&
- checkAmountForRecipeFourth(itemStacks, recipeOutputItemList) && checkAmountForRecipeFifth(itemStacks, recipeOutputItemList)) {
- Material material = returnItemToRecipe(matrialNameFirst, amountOfItemsInventory);
- Material materialSecond = returnItemToRecipe(matrialNameSecond, amountOfItemsInventory);
- outputItemsIfNoSpaceInChest = inventory.addItem(new ItemStack(recipeOutputMaterial, isAColor(recipeOutputMaterial) ? (recipeChache.getRecipe().get(recipeOutputItemList).getTotalAmount() + 2) + addExtraIfSpecialcolor(materialSecond, recipeOutputMaterial) : recipeChache.getRecipe().get(recipeOutputItemList).getTotalAmount()));
- if (outputItemsIfNoSpaceInChest.isEmpty()) {
- if (craftedItems.containsKey(this.location) && craftedItems.get(this.location).containsKey(ItemUtily.createItemStackAsOne(new ItemStack(material)))) {
- itemAmont = craftedItems.get(this.location).get(ItemUtily.createItemStackAsOne(new ItemStack(material))).getAmount();
- ItemStack items = craftedItems.get(this.location).get(ItemUtily.createItemStackAsOne(new ItemStack(material)));
- items.clone().setAmount(itemAmont);
- this.itemStacksList.put(ItemUtily.createItemStackAsOne(new ItemStack(material)), items);
- }
- this.itemStacksList.put(ItemUtily.createItemStackAsOne(new ItemStack(material)), ItemUtily.createItemStackWhitAmount(recipeOutputMaterial, isAColor(recipeOutputMaterial) ? (recipeChache.getRecipe().get(recipeOutputItemList).getTotalAmount() + 2) + addExtraIfSpecialcolor(materialSecond, recipeOutputMaterial) : (recipeChache.getRecipe().get(recipeOutputItemList).getTotalAmount() + (craftedItems.isEmpty() ? 0 : itemAmont))));
- craftedItems.put(this.location, this.itemStacksList);
- takeItemsRecipeIngrediens(inventory, recipeOutputItemList, itemStacks, null);
- }
- }
- } else {
- noMatch = false;
- }
- }
- //if (!noMatch) break;
- }
- //}
- if (MainSettings.getInstance().getSettings().isDebugCrafting()) {
- double time = Math.round(((double) (System.nanoTime() - timess) / 1000000) * 1000.0) / 1000.0;
- Bukkit.getScheduler().runTaskAsynchronously(CustomContainersMainClass.getInstance(), () ->
- LogTimingsReport.getInstance().setTimeListQueue("checkCraftingRecipeExist", time));
- }
- return outputItemsIfNoSpaceInChest;
- }
- /**
- * Check if it a color recipe, is for bypass the check if the recipe has more an one matral to use and the
- * items you has added only demand 1 for the recipe, it will dynamicly chose right type after amount items
- * for the recipe.
- * <p>
- * So for example light_gray_dye has two diffrent type of recipe one ony need one item and second need two diffrent item.
- * It will shose that type some fith the cuurent added items.
- *
- * @param craftingRecipe the recipe you whant to check aginst.
- * @param itemListForCrafting the list of items you want to craft too.
- * @param inventoryItems the items inside the inventory
- * @return if the item inside the inventory match the items inside the recipe
- */
- public boolean ifItAreColor(ItemStack craftingRecipe, ItemStack itemListForCrafting, Map<Material, ItemStack> inventoryItems) {
- if (craftingRecipe.isSimilar(ItemUtily.createItemStackAsOne(Material.LIGHT_BLUE_DYE)) && itemListForCrafting.isSimilar(ItemUtily.createItemStackAsOne(Material.LIGHT_BLUE_DYE)))
- for (ItemStack recipe : recipeChache.getRecipe().get(craftingRecipe).getMatrial1()) {
- for (ItemStack items : inventoryItems.values()) {
- if (items.isSimilar(ItemUtily.createItemStackAsOne(Material.BLUE_ORCHID)))
- if (recipe.isSimilar(items)) {
- return true;
- }
- }
- }
- else if (craftingRecipe.isSimilar(ItemUtily.createItemStackAsOne(Material.LIGHT_GRAY_DYE)) && itemListForCrafting.isSimilar(ItemUtily.createItemStackAsOne(Material.LIGHT_GRAY_DYE)))
- for (ItemStack recipe : recipeChache.getRecipe().get(craftingRecipe).getMatrial1()) {
- for (ItemStack items : inventoryItems.values()) {
- if (items.isSimilar(ItemUtily.createItemStackAsOne(Material.WHITE_TULIP)) || items.isSimilar(ItemUtily.createItemStackAsOne(Material.OXEYE_DAISY)) || items.isSimilar(ItemUtily.createItemStackAsOne(Material.AZURE_BLUET)))
- if (recipe.isSimilar(items)) {
- return true;
- }
- }
- }
- else if (craftingRecipe.isSimilar(ItemUtily.createItemStackAsOne(Material.MAGENTA_DYE)) && itemListForCrafting.isSimilar(ItemUtily.createItemStackAsOne(Material.MAGENTA_DYE)))
- for (ItemStack recipe : recipeChache.getRecipe().get(craftingRecipe).getMatrial1()) {
- for (ItemStack items : inventoryItems.values()) {
- if (items.isSimilar(ItemUtily.createItemStackAsOne(Material.ALLIUM)) || items.isSimilar(ItemUtily.createItemStackAsOne(Material.LILAC)))
- if (recipe.isSimilar(items)) {
- return true;
- }
- }
- }
- else if (craftingRecipe.isSimilar(ItemUtily.createItemStackAsOne(Material.PINK_DYE)) && itemListForCrafting.isSimilar(ItemUtily.createItemStackAsOne(Material.PINK_DYE)))
- for (ItemStack recipe : recipeChache.getRecipe().get(craftingRecipe).getMatrial1()) {
- for (ItemStack items : inventoryItems.values()) {
- if (items.isSimilar(ItemUtily.createItemStackAsOne(Material.PINK_TULIP)) || items.isSimilar(ItemUtily.createItemStackAsOne(Material.PEONY)))
- if (recipe.isSimilar(items)) {
- return true;
- }
- }
- }
- else if (craftingRecipe.isSimilar(ItemUtily.createItemStackAsOne(Material.RED_DYE)) && itemListForCrafting.isSimilar(ItemUtily.createItemStackAsOne(Material.RED_DYE)))
- for (ItemStack recipe : recipeChache.getRecipe().get(craftingRecipe).getMatrial1()) {
- for (ItemStack items : inventoryItems.values()) {
- if (items.isSimilar(ItemUtily.createItemStackAsOne(Material.RED_TULIP)) || items.isSimilar(ItemUtily.createItemStackAsOne(Material.BEETROOT)) || items.isSimilar(ItemUtily.createItemStackAsOne(Material.POPPY)) || items.isSimilar(ItemUtily.createItemStackAsOne(Material.ROSE_BUSH)))
- if (recipe.isSimilar(items)) {
- System.out.println("items " + items);
- return true;
- }
- }
- }
- return false;
- }
- /**
- * Check if it a tall flower
- *
- * @param itemUsecrafting the item you added inside the inventory to check
- * @return true if the item are a tall flower.
- */
- public boolean checkIfItTallFlowers(Material itemUsecrafting) {
- if (itemUsecrafting != null)
- return itemUsecrafting == Material.LILAC || itemUsecrafting == Material.PEONY || itemUsecrafting == Material.ROSE_BUSH;
- return false;
- }
- /**
- * check if colors match if the recipe has more an 2 diffrent recipe ingredens and bypass the check.
- * Is for recipe some has 1,2 and 3 diffreent items, but only added 2 matched items inside the inventory.
- *
- * @param craftingRecipe the recipe you want to check against
- * @param itemListForCrafting the list of items you has added you want to craft.
- * @param inventoryItems the contents of the inventory
- * @return true if the items match the recipe demand.
- */
- public boolean ifItAreColorMatchTwoItems(ItemStack craftingRecipe, ItemStack itemListForCrafting, Map<Material, ItemStack> inventoryItems) {
- if (craftingRecipe.isSimilar(ItemUtily.createItemStackAsOne(Material.MAGENTA_DYE)) && itemListForCrafting.isSimilar(ItemUtily.createItemStackAsOne(Material.MAGENTA_DYE)))
- for (ItemStack recipe : this.recipeChache.getRecipe().get(craftingRecipe).getMatrial1()) {
- for (ItemStack items : inventoryItems.values()) {
- if (items.isSimilar(ItemUtily.createItemStackAsOne(Material.PINK_DYE)) || items.isSimilar(ItemUtily.createItemStackAsOne(Material.PURPLE_DYE)))
- if (recipe.isSimilar(items)) {
- System.out.println("items are " + items);
- return true;
- }
- }
- }
- return false;
- }
- /**
- * Simpel check if it a color.
- *
- * @param outputItem the item you want to make.
- * @return true if it a color recipe.
- */
- public boolean isAColor(Material outputItem) {
- switch (outputItem) {
- case BLACK_DYE:
- case CYAN_DYE:
- case LIGHT_BLUE_DYE:
- case LIGHT_GRAY_DYE:
- case MAGENTA_DYE:
- case ORANGE_DYE:
- case PINK_DYE:
- case RED_DYE:
- return true;
- default:
- return false;
- }
- }
- /**
- * Check if it a color and add extra item if it is a special color some has more items as output.
- *
- * @param itemToTake the item you has added to the inventory
- * @param outputItem the recipe output.
- * @return a number if it a match or 0 if not.
- */
- public int addExtraIfSpecialcolor(Material itemToTake, Material outputItem) {
- switch (outputItem) {
- case LIGHT_GRAY_DYE:
- if (itemToTake == Material.BLACK_DYE)
- return 1;
- case BLACK_DYE:
- case CYAN_DYE:
- case LIGHT_BLUE_DYE:
- return 1;
- case MAGENTA_DYE:
- if (itemToTake == Material.WHITE_DYE)
- return 1;
- case ORANGE_DYE:
- case PINK_DYE:
- case RED_DYE:
- default:
- return 0;
- }
- }
- public boolean checkIfChestFull() {
- if (checkCraftingRecipeExist().isEmpty()) {
- ifChestFull = !checkCraftingRecipeExist().isEmpty();
- }
- return ifChestFull;
- }
- /**
- * Will set amount of items inside the inventory after the matched recipe ingredens.
- *
- * @param ingrediensMap the items inside the inventory.
- * @param recipeOutputItem the recipe you want to make.
- * @return a map with the items and the amount is set inside the stack
- */
- public Map<Material, ItemStack> setItemstacksAmount(Map<Material, Integer> ingrediensMap, ItemStack recipeOutputItem) {
- Map<Material, ItemStack> map = new HashMap<>();
- ItemStack recipeMatrial;
- ItemStack recipeMatrialSecond;
- ItemStack recipeMatrialThird;
- ItemStack recipeMatrialFourth;
- ItemStack recipeMatrialFifth;
- RecipeData outputRecipeItem = this.recipeChache.getRecipe(recipeOutputItem);
- if (returnItemToRecipe(outputRecipeItem.getMatrial1(), ingrediensMap) != null)
- if (outputRecipeItem.getMatrial1() != null && isMapContainsRecipeIngrediens(outputRecipeItem.getMatrial1(), ingrediensMap)) {
- for (Map.Entry<Material, Integer> item : ingrediensMap.entrySet())
- if (isMatrial1Match(outputRecipeItem, ItemUtily.createItemStack(item.getKey()))) {
- Material matrialNameFirst = item.getKey();
- int itemAmountSecond = ingrediensMap.get(matrialNameFirst);
- recipeMatrial = new ItemStack(matrialNameFirst, itemAmountSecond);
- map.put(matrialNameFirst, recipeMatrial);
- }
- }
- if (returnItemToRecipe(outputRecipeItem.getMatrial2(), ingrediensMap) != null)
- if (outputRecipeItem.getMatrial2() != null && isMapContainsRecipeIngrediens(outputRecipeItem.getMatrial2(), ingrediensMap)) {
- for (Map.Entry<Material, Integer> item : ingrediensMap.entrySet())
- if (isMatrial2Match(outputRecipeItem, ItemUtily.createItemStack(item.getKey()))) {
- Material matrialNameSecond = item.getKey();
- int itemAmountSecond = ingrediensMap.get(matrialNameSecond);
- recipeMatrialSecond = new ItemStack(matrialNameSecond, itemAmountSecond);
- map.put(matrialNameSecond, recipeMatrialSecond);
- }
- }
- if (returnItemToRecipe(outputRecipeItem.getMatrial3(), ingrediensMap) != null)
- if (outputRecipeItem.getMatrial3() != null && isMapContainsRecipeIngrediens(outputRecipeItem.getMatrial3(), ingrediensMap)) {
- Material matrialNameThird = returnItemToRecipe(outputRecipeItem.getMatrial3(), ingrediensMap);
- int itemAmountThird = ingrediensMap.get(matrialNameThird);
- recipeMatrialThird = new ItemStack(matrialNameThird, itemAmountThird);
- map.put(matrialNameThird, recipeMatrialThird);
- }
- if (returnItemToRecipe(outputRecipeItem.getMatrial4(), ingrediensMap) != null)
- if (outputRecipeItem.getMatrial4() != null && isMapContainsRecipeIngrediens(outputRecipeItem.getMatrial4(), ingrediensMap)) {
- Material matrialNameFourth = returnItemToRecipe(outputRecipeItem.getMatrial4(), ingrediensMap);
- int itemAmountFourth = ingrediensMap.get(matrialNameFourth);
- recipeMatrialFourth = new ItemStack(matrialNameFourth, itemAmountFourth);
- map.put(matrialNameFourth, recipeMatrialFourth);
- }
- if (returnItemToRecipe(outputRecipeItem.getMatrial5(), ingrediensMap) != null)
- if (outputRecipeItem.getMatrial5() != null && isMapContainsRecipeIngrediens(outputRecipeItem.getMatrial5(), ingrediensMap)) {
- Material matrialNameFifth = returnItemToRecipe(outputRecipeItem.getMatrial5(), ingrediensMap);
- int itemAmountFifth = ingrediensMap.get(matrialNameFifth);
- recipeMatrialFifth = new ItemStack(matrialNameFifth, itemAmountFifth);
- map.put(matrialNameFifth, recipeMatrialFifth);
- }
- return map;
- }
- /**
- * Count items inside the inventory, some match the recipe ingredens.
- * It will compere the recipe you want to makw with the list of recipe
- * some exist in Crafting.
- *
- * @param recipeYouWhantToMatch the recipe you want to match.
- * @param inventory the inventory you match the items from.
- * @return a map with the Matrial and amount of this type inside the inventory.
- */
- public Map<Material, Integer> getItemsAmount(ItemStack recipeYouWhantToMatch, Inventory inventory) {
- Map<Material, Integer> map = new HashMap<>();
- ItemStack[] itemStacks = inventory.getContents();
- int amountFirst = 0;
- int amountSecond = 0;
- int amountThird = 0;
- int amountFourt = 0;
- int amountFifth = 0;
- RecipeCache.RecipeData recipeItem = this.recipeChache.getRecipe(recipeYouWhantToMatch);
- for (ItemStack itemStack : itemStacks) {
- if (recipeItem != null && itemStack != null) {
- if (isMatrial1Match(recipeItem, itemStack)) {
- amountFirst += itemStack.getAmount();
- map.put(itemStack.getType(), ItemUtily.countItemStacks(itemStacks, itemStack));
- } else if (isMatrial2Match(recipeItem, itemStack)) {
- amountSecond += itemStack.getAmount();
- map.put(itemStack.getType(), ItemUtily.countItemStacks(itemStacks, itemStack));
- } else if (isMatrial3Match(recipeItem, itemStack)) {
- amountThird += itemStack.getAmount();
- map.put(itemStack.getType(), ItemUtily.countItemStacks(itemStacks, itemStack));
- } else if (isMatrial4Match(recipeItem, itemStack)) {
- amountFourt += itemStack.getAmount();
- map.put(itemStack.getType(), ItemUtily.countItemStacks(itemStacks, itemStack));
- } else if (isMatrial5Match(recipeItem, itemStack)) {
- amountFifth += itemStack.getAmount();
- map.put(itemStack.getType(), ItemUtily.countItemStacks(itemStacks, itemStack));
- }
- }
- }
- return map;
- }
- /**
- * Remove the items inside the inventory if it exist inbside the inventory
- *
- * @param inventory the inventory the items shall be removed from.
- * @param itemStack the item you want to remove.
- */
- public void removeItems(Inventory inventory, ItemStack itemStack) {
- for (int i = 0; i < inventory.getSize(); i++) {
- ItemStack itemStacks = inventory.getContents()[i];
- if (itemStacks != null && itemStacks.isSimilar(itemStack)) {
- inventory.setItem(i, new ItemStack(Material.AIR));
- }
- }
- }
- /**
- * Check to remove right item from the inventory and amount it shall be removed.
- * It will add new amount inside the inventory.
- *
- * @param inventory some you remove and add items too.
- * @param recipeOutputItem the craftingrecipes it vill check items to remove against.
- * @param itemStacks the itemstacks some the inventory contains and amount.
- * @param itemToTake the item you want to check from the inventory match some conditons
- * (in this case if it a color, soo it to remove right amount).
- */
- public void takeItemsRecipeIngrediens(Inventory inventory, ItemStack recipeOutputItem, Map<Material, ItemStack> itemStacks, Material itemToTake) {
- Set<ItemStack> ifItHasRemovedSameItem = new HashSet<>();
- for (Map.Entry<Material, ItemStack> item : itemStacks.entrySet()) {
- ItemStack itemStack = item.getValue();
- RecipeData outputRecipeItem = this.recipeChache.getRecipe(recipeOutputItem);
- if (itemStack != null && isMatrial1Match(outputRecipeItem, itemStack)) {
- if (itemStack.getAmount() >= this.recipeChache.getRecipe(recipeOutputItem).getAmount1() && !ifItHasRemovedSameItem.isEmpty()) {
- if (ifItHasRemovedSameItem.size() == ItemUtily.countItemStacks(inventory, itemStack))
- ifItHasRemovedSameItem.clear();
- ifItHasRemovedSameItem.add(itemStack);
- continue;
- }
- removeItems(inventory, itemStack);
- itemStack.setAmount(checkAdvanceColorRecipes(recipeOutputItem, itemToTake) ? itemStack.getAmount() - (this.recipeChache.getRecipe(recipeOutputItem).getAmount1() + 1) : itemStack.getAmount() - this.recipeChache.getRecipe(recipeOutputItem).getAmount1());
- inventory.addItem(itemStack);
- ifItHasRemovedSameItem.add(itemStack);
- } else if (itemStack != null && isMatrial2Match(outputRecipeItem, itemStack)) {
- if (checkAdvanceColorRecipes(recipeOutputItem, itemToTake) && itemStack.getType() == Material.PINK_DYE)
- continue;
- if (!checkAdvanceColorRecipes(recipeOutputItem, itemToTake) && itemStack.getType() == Material.WHITE_DYE)
- continue;
- removeItems(inventory, itemStack);
- itemStack.setAmount(itemStack.getAmount() - this.recipeChache.getRecipe(recipeOutputItem).getAmount2());
- inventory.addItem(itemStack);
- } else if (itemStack != null && isMatrial3Match(outputRecipeItem, itemStack)) {
- removeItems(inventory, itemStack);
- itemStack.setAmount(checkAdvanceColorRecipes(recipeOutputItem, itemToTake) ? itemStack.getAmount() - (this.recipeChache.getRecipe(recipeOutputItem).getAmount3() + 1) : itemStack.getAmount() - this.recipeChache.getRecipe(recipeOutputItem).getAmount3());
- inventory.addItem(itemStack);
- } else if (itemStack != null && isMatrial4Match(outputRecipeItem, itemStack)) {
- removeItems(inventory, itemStack);
- itemStack.setAmount(itemStack.getAmount() - this.recipeChache.getRecipe(recipeOutputItem).getAmount4());
- inventory.addItem(itemStack);
- } else if (itemStack != null && isMatrial5Match(outputRecipeItem, itemStack)) {
- removeItems(inventory, itemStack);
- itemStack.setAmount(itemStack.getAmount() - this.recipeChache.getRecipe(recipeOutputItem).getAmount5());
- inventory.addItem(itemStack);
- }
- }
- }
- /**
- * check if it a special color and return true if it is.
- *
- * @param recipeOutput the recipe it curently try to make
- * @param itemUsedInrecipe the item you want to check if the recipe contains the item.
- * @return true if it match a special color.
- */
- private boolean checkAdvanceColorRecipes(ItemStack recipeOutput, Material itemUsedInrecipe) {
- if (itemUsedInrecipe != null)
- if (recipeOutput.getType() == Material.LIGHT_GRAY_DYE && itemUsedInrecipe == Material.LIGHT_GRAY_DYE)
- return true;
- else if (recipeOutput.getType() == Material.MAGENTA_DYE && (itemUsedInrecipe == Material.WHITE_DYE || itemUsedInrecipe == Material.BONE_MEAL))
- return true;
- else if (recipeOutput.getType() == Material.LIGHT_BLUE_DYE && (itemUsedInrecipe == Material.WHITE_DYE || itemUsedInrecipe == Material.BONE_MEAL))
- return true;
- return false;
- }
- /**
- * Check if a item match the item demanded for the recipe.
- *
- * @param outputRecipe the recipe item you want to make
- * @param itemYoucraft the items you want to check if it match the curent recipe
- * @return true if the items match the curent recipe.
- */
- public boolean isMatrial1Match(RecipeData outputRecipe, ItemStack itemYoucraft) {
- if (outputRecipe != null && itemYoucraft != null) {
- for (ItemStack recipe : outputRecipe.getMatrial1())
- if (recipe.isSimilar(itemYoucraft)) {
- return true;
- }
- }
- return false;
- }
- /**
- * Check if a item match the item demanded for the recipe.
- *
- * @param outputRecipe the recipe item you want to make
- * @param itemYoucraft the items you want to check if it match the curent recipe
- * @return true if the items match the curent recipe.
- */
- public boolean isMatrial2Match(RecipeData outputRecipe, ItemStack itemYoucraft) {
- if (outputRecipe != null && itemYoucraft != null) {
- for (ItemStack recipess : outputRecipe.getMatrial2())
- if (recipess.isSimilar(itemYoucraft)) {
- return true;
- }
- }
- return false;
- }
- /**
- * Check if a item match the item demanded for the recipe.
- *
- * @param outputRecipe the recipe item you want to make
- * @param itemYoucraft the items you want to check if it match the curent recipe
- * @return true if the items match the curent recipe.
- */
- public boolean isMatrial3Match(RecipeData outputRecipe, ItemStack itemYoucraft) {
- if (outputRecipe != null && itemYoucraft != null) {
- for (ItemStack recipesss : outputRecipe.getMatrial3())
- if (recipesss.isSimilar(itemYoucraft)) {
- return true;
- }
- }
- return false;
- }
- /**
- * Check if a item match the item demanded for the recipe.
- *
- * @param outputRecipe the recipe item you want to make
- * @param itemYoucraft the items you want to check if it match the curent recipe
- * @return true if the items match the curent recipe.
- */
- public boolean isMatrial4Match(RecipeData outputRecipe, ItemStack itemYoucraft) {
- if (outputRecipe != null && itemYoucraft != null) {
- for (ItemStack recipe : outputRecipe.getMatrial4())
- if (recipe.isSimilar(itemYoucraft)) {
- return true;
- }
- }
- return false;
- }
- /**
- * Check if a item match the item demanded for the recipe.
- *
- * @param outputRecipe the recipe item you want to make
- * @param itemYoucraft the items you want to check if it match the curent recipe
- * @return true if the items match the curent recipe.
- */
- public boolean isMatrial5Match(RecipeData outputRecipe, ItemStack itemYoucraft) {
- if (outputRecipe != null && itemYoucraft != null) {
- for (ItemStack recipe : outputRecipe.getMatrial5())
- if (recipe.isSimilar(itemYoucraft)) {
- return true;
- }
- }
- return false;
- }
- /**
- * Check recipe ingrediens to the items inside the inventory.
- *
- * @param ingrediens the recipe ingridens.
- * @param map the contents of your inventory.
- * @return a item if it match or null if it not find any match.
- */
- public Material returnItemToRecipe(Set<ItemStack> ingrediens, Map<Material, Integer> map) {
- for (Map.Entry<Material, Integer> itemStack : map.entrySet())
- if (ingrediens != null && itemStack != null)
- for (ItemStack recipe : ingrediens) {
- if (recipe.getType() == itemStack.getKey()) {
- return itemStack.getKey();
- }
- }
- return null;
- }
- /**
- * Check if the map contains the needed recipe ingrediens.
- *
- * @param ingrediens the curent recipe ingredins to check.
- * @param map the inventory contents
- * @return true if the item match recipe ingredien.
- */
- public boolean isMapContainsRecipeIngrediens(Set<ItemStack> ingrediens, Map<Material, Integer> map) {
- for (Map.Entry<Material, Integer> itemStack : map.entrySet())
- if (ingrediens != null && itemStack != null)
- for (ItemStack recipe : ingrediens) {
- if (recipe.getType() == itemStack.getKey()) {
- return true;
- }
- }
- return false;
- }
- /**
- * Some recipe has several diffrent items you can choose from, this will split up the recipe ingrediens
- * and check every one aginst the item inside the inventory and return a item if it match.
- *
- * @param itemFromInventory the item inside the inventory
- * @param ingrediensFromRecipe the recipe ingridens some it deamand
- * @return the matching item if it exist or return null if it not a match.
- */
- public Material splitIngrediens(Material itemFromInventory, Set<ItemStack> ingrediensFromRecipe) {
- if (itemFromInventory != null && ingrediensFromRecipe != null)
- for (ItemStack ingredien : ingrediensFromRecipe)
- if (ingredien.getType() == itemFromInventory) {
- return itemFromInventory;
- }
- return null;
- }
- /**
- * Check the amount of item one type or if recipe has several diffrent matrial it can use
- * it include even this from the inventory.
- * <p>
- * Like for example planks has several wood types, but you can use several diffrent type´s to craft
- * an item.
- *
- * @param itemsInsideInventory the items you have inside the inventory
- * @param craftingRecipes the recipe ingridient you want to match aginst.
- * @param itemUsedToCrafting the item some you want to check (in this case I use it for colors some has diffrent recipe)
- * @return true if it equal or more items inside the inventory.
- */
- public boolean checkAmountForRecipeFirst(Map<Material, ItemStack> itemsInsideInventory, ItemStack craftingRecipes, Material... itemUsedToCrafting) {
- int itemAmount = 0;
- boolean matchedItem = false;
- if (itemUsedToCrafting != null)
- for (Material items : itemUsedToCrafting)
- if (items == Material.BLACK_DYE) {
- matchedItem = true;
- break;
- }
- if (itemsInsideInventory != null && craftingRecipes != null)
- for (Map.Entry<Material, ItemStack> item : itemsInsideInventory.entrySet()) {
- if (item.getValue().getType() == splitIngrediens(item.getValue().getType(), this.recipeChache.getRecipe().get(craftingRecipes).getMatrial1())) {
- itemAmount += item.getValue().getAmount();
- if (itemAmount >= ((craftingRecipes.isSimilar(ItemUtily.createItemStackAsOne(Material.LIGHT_GRAY_DYE)) && matchedItem) ?
- this.recipeChache.getRecipe().get(craftingRecipes).getAmount1() + 1 : this.recipeChache.getRecipe().get(craftingRecipes).getAmount1())) {
- return true;
- }
- }
- }
- return false;
- }
- /**
- * Check the amount of item one type or if recipe has several diffrent matrial it can use
- * it include even this from the inventory.
- * <p>
- * Like for example planks has several wood types, but you can use several diffrent type´s to craft
- * an item.
- *
- * @param itemsInsideInventory the items you have inside the inventory
- * @param craftingRecipes the recipe ingridient you want to match aginst.
- * @param itemUsedToCrafting the item some you want to check (in this case I use it for colors some has diffrent recipe)
- * @return true if it equal or more items inside the inventory.
- */
- public boolean checkAmountForRecipeSecond(Map<Material, ItemStack> itemsInsideInventory, ItemStack craftingRecipes, Material... itemUsedToCrafting) {
- int itemSecondAmount = 0;
- boolean matchedItem = false;
- if (itemUsedToCrafting != null)
- for (Material items : itemUsedToCrafting)
- if (items == Material.MAGENTA_DYE) {
- matchedItem = true;
- break;
- }
- if (itemsInsideInventory != null && craftingRecipes != null)
- for (Map.Entry<Material, ItemStack> item : itemsInsideInventory.entrySet()) {
- if (item.getValue().getType() == splitIngrediens(item.getValue().getType(), this.recipeChache.getRecipe().get(craftingRecipes).getMatrial2())) {
- itemSecondAmount += item.getValue().getAmount();
- if (itemSecondAmount >= this.recipeChache.getRecipe().get(craftingRecipes).getAmount2())
- return true;
- }
- }
- return false;
- }
- /**
- * Check the amount of item one type or if recipe has several diffrent matrial it can use
- * it include even this from the inventory.
- * <p>
- * Like for example planks has several wood types, but you can use several diffrent type´s to craft
- * an item.
- *
- * @param itemsInsideInventory the items you have inside the inventory
- * @param craftingRecipes the recipe ingridient you want to match aginst.
- * @param itemUsedToCrafting the item some you want to check (in this case I use it fot colors some has diffrent recipe)
- * @return true if it equal or more items inside the inventory.
- */
- public boolean checkAmountForRecipeThird(Map<Material, ItemStack> itemsInsideInventory, ItemStack craftingRecipes, Material... itemUsedToCrafting) {
- int itemAmount = 0;
- boolean matchedItem = false;
- if (itemUsedToCrafting != null)
- for (Material items : itemUsedToCrafting)
- if (items == Material.WHITE_DYE || items == Material.BONE_MEAL) {
- matchedItem = true;
- break;
- }
- if (itemsInsideInventory != null && craftingRecipes != null)
- for (Map.Entry<Material, ItemStack> item : itemsInsideInventory.entrySet()) {
- if (item.getValue().getType() == splitIngrediens(item.getValue().getType(), this.recipeChache.getRecipe().get(craftingRecipes).getMatrial3())) {
- itemAmount += item.getValue().getAmount();
- if (itemAmount >= ((craftingRecipes.isSimilar(ItemUtily.createItemStackAsOne(Material.MAGENTA_DYE)) && matchedItem) ?
- this.recipeChache.getRecipe().get(craftingRecipes).getAmount3() + 1 : this.recipeChache.getRecipe().get(craftingRecipes).getAmount3()))
- return true;
- }
- }
- return false;
- }
- /**
- * Check the amount of item one type or if recipe has several diffrent matrial it can use
- * it include even this from the inventory.
- * <p>
- * Like for example planks has several wood types, but you can use several diffrent type´s to craft
- * an item.
- *
- * @param itemsInsideInventory the items you have inside the inventory
- * @param craftingRecipes the recipe ingridient you want to match aginst.
- * @param itemUsedToCrafting the item some you want to check (in this case I use it fot colors some has diffrent recipe)
- * @return true if it equal or more items inside the inventory.
- */
- public boolean checkAmountForRecipeFourth(Map<Material, ItemStack> itemsInsideInventory, ItemStack craftingRecipes, Material... itemUsedToCrafting) {
- int itemAmount = 0;
- boolean matchedItem = false;
- if (itemUsedToCrafting != null)
- for (Material items : itemUsedToCrafting)
- if (items == Material.WHITE_DYE || items == Material.BONE_MEAL) {
- matchedItem = true;
- break;
- }
- if (itemsInsideInventory != null && craftingRecipes != null)
- for (Map.Entry<Material, ItemStack> item : itemsInsideInventory.entrySet()) {
- if (item.getValue().getType() == splitIngrediens(item.getValue().getType(), this.recipeChache.getRecipe().get(craftingRecipes).getMatrial4())) {
- itemAmount += item.getValue().getAmount();
- if (itemAmount >= this.recipeChache.getRecipe().get(craftingRecipes).getAmount4())
- return true;
- }
- }
- return false;
- }
- /**
- * Check the amount of item one type or if recipe has several diffrent matrial it can use
- * it include even this from the inventory.
- * <p>
- * Like for example planks has several wood types, but you can use several diffrent type´s to craft
- * an item.
- *
- * @param itemsInsideInventory the items you have inside the inventory
- * @param craftingRecipes the recipe ingridient you want to match aginst.
- * @param itemUsedToCrafting the item some you want to check (in this case I use it fot colors some has diffrent recipe)
- * @return true if it equal or more items inside the inventory.
- */
- public boolean checkAmountForRecipeFifth(Map<Material, ItemStack> itemsInsideInventory, ItemStack craftingRecipes, Material... itemUsedToCrafting) {
- int itemAmount = 0;
- boolean matchedItem = false;
- if (itemUsedToCrafting != null)
- for (Material items : itemUsedToCrafting)
- if (items == Material.WHITE_DYE || items == Material.BONE_MEAL) {
- matchedItem = true;
- break;
- }
- if (itemsInsideInventory != null && craftingRecipes != null)
- for (Map.Entry<Material, ItemStack> item : itemsInsideInventory.entrySet()) {
- if (item.getValue().getType() == splitIngrediens(item.getValue().getType(), this.recipeChache.getRecipe().get(craftingRecipes).getMatrial5())) {
- itemAmount += item.getValue().getAmount();
- if (itemAmount >= this.recipeChache.getRecipe().get(craftingRecipes).getAmount5())
- return true;
- }
- }
- return false;
- }
- /**
- * Get the contents of a specific location and see what was crafted.
- *
- * @param location of the container some crafted the items.
- * @return Itemstack of the crafted items.
- */
- public Map<ItemStack, ItemStack> getCraftedItems(Location location) {
- return craftedItems.get(location);
- }
- /**
- * Get all the contents crafted on all locations.
- *
- * @return The map contents.
- */
- public Map<Location, Map<ItemStack, ItemStack>> getCraftedItems() {
- return craftedItems;
- }
- /**
- * Remove crafted items on one location.
- *
- * @param location of the container some crafted the items.
- */
- public void removeCraftedItems(Location location) {
- craftedItems.remove(location);
- }
- /**
- * if it not match a recipe.
- *
- * @return
- */
- public static boolean isNoMatchRecipe(Location location) {
- return noMatchRecipe.get(location) == null || noMatchRecipe.get(location);
- }
- public static void setNoMatchRecipe(Location location) {
- noMatchRecipe.put(location, true);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement