Giter Club home page Giter Club logo

itembuilder's Introduction

ItemBuilder

Create advanced ItemStacks with just one line of code.

Standart ItemBuilder API Usage

  1. Create a Instance of the ItemBuilder: ItemBuilder builder = new ItemBuilder(Material.GLOWSTONE);
  2. Modify the ItemStack using one of the many methods, for example: builder.displayname("§6ItemBuiler Glowstone");
  3. When you are finish modifing it, use builder.build(); to get the Bukkit ItemStack back
    You can also do all steps in just one line: ItemStack item = new ItemBuilder(Material.GLOWSTONE).displayname("§6ItemBuilder Glowstone").build();

NBT Tags Writing / Reading (Advanced)

  1. Create a Instance of the ItemBuilder ItemBuilder builder = new ItemBuilder(Material.DIAMOND_SWORD);
  2. Access the Unsafe Class using the builder.unsafe(); Method
  3. Add/Remove NBT Tags using builder.unsafe().addString("Key", "Value"); or builder.unsafe().removeString("Key", "Value");
  4. Go back to the ItemBuilder Class using the builder(); Method in Unsafe and build(); the ItemStack.
    You can also do all steps in just one line: ItemStack item = new ItemBuilder(Material.DIAMOND_SWORD).unsafe().addString("Key", "Value").builder().build();

Json and Config Writing / Reading (Advanced)

  1. Create a Instance of the ItemBuilder and set anything you need.
  2. Convert it to a JSON String using builder.toJson() or to a Config Path using builder.toConfig(MyPlugin.getInstance().getConfig(), "my.custom.item").
  3. TIP! The Methods fromJson, toJson, fromConfig and toConfig are static. You can access them all using ItemBuilder.<Method> without creating a Instance of the ItemBuilder.

Maven

Repository:

<repositories>
    <repository>
        <id>acquized-repo</id>
        <url>http://repo.acquized.pw/maven/</url>
    </repository>
</repositories>

Dependency:

<dependencies>
    <dependency>
        <groupId>cc.acquized</groupId>
        <artifactId>ItemBuilder</artifactId>
        <version>1.8</version>
    </dependency>
</dependencies>

itembuilder's People

Contributors

acquized avatar kev575 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.