Code Monkey home page Code Monkey logo

customrecipe's Introduction

download b Codacy Badge a

FrameWork

  • Version Support: 1.13.2 Below
  • Frameworks: Bukkit, Lombok

Craft with custom items

Only specific items to craft

Tutorial

  • Add CustomRecipe.jar in libraries (how you add bukkit)
  • In artifacts (without the CustomRecipe in folder plugins)
  • In artifacts (with the CustomRecipe in folder plugins)
  • In plugin.yml (with the CustomRecipe in folder plugins)
  • Create a new instance of 'CustomRecipe' in your JavaPlugin (Main).
  • Create a new instance of 'Recipe' add to 'CustomRecipe'.
  • Execute method 'addRecipe' with the arguments.
  • Compile your plugin with CustomRecipe.jar inside.
  • :) Finish! Example? BELOW!

In Main

public class Main extends JavaPlugin {
    public static CustomRecipe customRecipe;
    public void onEnable(){
        customRecipe = new CustomRecipe(this);
    }
}

Example Short

  • To empty spaces, use null instead new MatrixItem(new ItemStack(Material.AIR),SLOT)
Recipe recipe = new Recipe();
recipe.setLoose(false);
recipe.setResult(new ItemStack(Material.DIAMOND));
        
final ItemStack REDSTONE = new ItemStack(Material.REDSTONE);
recipe.setRecipe(
     new MatrixItem(REDSTONE, 0),
     null,
     new MatrixItem(REDSTONE, 2),
     null,
     new MatrixItem(REDSTONE, 4)
);
     
customRecipe.addRecipe("REDSTONE_TO_DIAMOND", recipe);

Example "Bigger"

Recipe recipe = new Recipe();
recipe.setLoose(false);
recipe.setResult(result);
        
recipe.setRecipe(
     new MatrixItem(red, 0),
     new MatrixItem(red, 1),
     new MatrixItem(red, 2),
     new MatrixItem(red, 3),
     new MatrixItem(new ItemStack(Material.APPLE), 4),
     new MatrixItem(red, 5),
     new MatrixItem(red, 6),
     new MatrixItem(red, 7),
     new MatrixItem(red, 8)
);
     
customRecipe.addRecipe("APPLE_REDSTONE", recipe);

Items used

// Item Result
ItemStack result = new ItemStack(Material.APPLE);
ItemMeta itemMeta = result.getItemMeta();
itemMeta.setDisplayName("§cMaça de Redstone");
result.addUnsafeEnchantment(Enchantment.LUCK,1);
itemMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
result.setItemMeta(itemMeta);

// Item Craft
ItemStack redstone = new ItemStack(Material.REDSTONE);
itemMeta = red.getItemMeta();
itemMeta.setDisplayName("§c§lRedstone");
redstone.addUnsafeEnchantment(Enchantment.LUCK,1);
itemMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
redstone.setItemMeta(itemMeta);

Result

customrecipe's People

Contributors

nonopichy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.