Package org.bukkit.inventory

Examples of org.bukkit.inventory.ShapelessRecipe


    pm.registerEvents(new EffectsListener(this), this);
    pm.registerEvents(new SetListener(this), this);

    getCommand("diablodrops").setExecutor(new DiabloDropCommand(this));

    ShapelessRecipe re = new ShapelessRecipe(new IdentifyTome());
    re.addIngredient(3, Material.BOOK);
    re.addIngredient(Material.EYE_OF_ENDER);
    this.getServer().addRecipe(re);

    if (config.getBoolean("Plugin.AutoUpdate", true)) {
      getServer().getScheduler().runTask(this, new Runnable() {
        @Override
View Full Code Here


    public static ShapelessRecipe getChimaeraWingRecipe() {
        Material ingredient = Config.getInstance().getChimaeraItem();
        int amount = Config.getInstance().getChimaeraRecipeCost();

        ShapelessRecipe chimeraWing = new ShapelessRecipe(getChimaeraWing(1));
        chimeraWing.addIngredient(amount, ingredient);
        return chimeraWing;
    }
View Full Code Here

                    }
                }
            } else if(rec1 instanceof ShapelessRecipe && rec2 instanceof ShapelessRecipe) {

                CraftBookPlugin.logDebugMessage("Shapeless Recipe!", "advanced-data.compare-recipes.shapeless");
                ShapelessRecipe recipe1 = (ShapelessRecipe) rec1;
                ShapelessRecipe recipe2 = (ShapelessRecipe) rec2;

                if(VerifyUtil.withoutNulls(recipe1.getIngredientList()).size() != VerifyUtil.withoutNulls(recipe2.getIngredientList()).size()) {
                    CraftBookPlugin.logDebugMessage("Recipes have different amounts of ingredients!", "advanced-data.compare-recipes.shapeless");
                    return false;
                }

                CraftBookPlugin.logDebugMessage("Same Size!", "advanced-data.compare-recipes.shapeless");

                List<ItemStack> test = new ArrayList<ItemStack>();
                test.addAll(VerifyUtil.<ItemStack>withoutNulls(recipe1.getIngredientList()));
                if(test.size() == 0) {
                    CraftBookPlugin.logDebugMessage("Recipes are the same!", "advanced-data.compare-recipes.shapeless");
                    return true;
                }
                if(!test.removeAll(VerifyUtil.<ItemStack>withoutNulls(recipe2.getIngredientList())) && test.size() > 0) {
                    CraftBookPlugin.logDebugMessage("Recipes are NOT the same!", "advanced-data.compare-recipes.shapeless");
                    return false;
                }
                if(test.size() > 0) {
                    CraftBookPlugin.logDebugMessage("Recipes are NOT the same!", "advanced-data.compare-recipes.shapeless");
View Full Code Here

    public boolean addRecipe(RecipeManager.Recipe r) {
        try {
            Recipe sh = null;

            if (r.getType() == RecipeManager.RecipeType.SHAPELESS) {
                sh = new ShapelessRecipe(r.getResult().getItemStack());
                for (CraftingItemStack is : r.getIngredients())
                    ((ShapelessRecipe) sh).addIngredient(is.getItemStack().getAmount(), is.getItemStack().getData());
            } else if (r.getType() == RecipeManager.RecipeType.SHAPED) {
                sh = new ShapedRecipe(r.getResult().getItemStack());
                ((ShapedRecipe) sh).shape(r.getShape());
View Full Code Here

    }

    @Override
    public void addRecipe() {

        recipe = new ShapelessRecipe(new ItemStack(Material.ARROW, 4));
        recipe.addIngredient(4, Material.ARROW);
        recipe.addIngredient(1, Material.FIREBALL);
        Bukkit.addRecipe(recipe);
    }
View Full Code Here

                    return false;
                }
            }
            return true;
        } else if (r instanceof ShapelessRecipe && (recipe == null || recipe instanceof ShapelessRecipe)) {
            ShapelessRecipe shape = (ShapelessRecipe) r;
            List<ItemStack> ing = new ArrayList<ItemStack>(VerifyUtil.withoutNulls(shape.getIngredientList()));
            for (ItemStack it : inv.getContents()) {
                if (!ItemUtil.isStackValid(it)) continue;
                if(ing.isEmpty())
                    return false;
                Iterator<ItemStack> ingIterator = ing.iterator();
View Full Code Here

TOP

Related Classes of org.bukkit.inventory.ShapelessRecipe

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.