Sueta
IT

ItemBuilder

1.1

Simple ItemBuilder utilizing lambdas.

·Plugin

This little resource allows you to build items using lambdas.

You are already using an ItemBuilder which works by chaining the calls? Great! Then you probably don't need this, unless you want to try something new. ;)

Usage:

ItemStack itemStack = ItemBuilder.buildItem(new ItemStack(Material.SKULL_ITEM,1,(byte)3), head -> { 
            head.setOwner(e.getPlayer().getName()); 
            head.setDisplayName(ChatColor.GOLD + "Your head :3"); 
            head.setAmount(42); 
            head.setLore(ChatColor.RESET + "" + ChatColor.GRAY + "Many " + e.getPlayer().getName() + "'s had to be killed to get these heads!"); 
        }); 

        ItemStack anotherItemStack = ItemBuilder.buildItem(item -> { 
            item.setMaterial(Material.DIAMOND); 
            item.setDisplayName("A really rare diamond"); 
        });

Now you might think "Awesome! How do I install this?", and here's the answer!

Either you add the .jar as a dependency to your project (if you always want to be up-to-date you should check out the GitHub and/or bintray page ;) ) or you use Maven (which will always contain bleeding-edge releases). If you go the Maven way you should use the shade plugin, unless you know that the ItemBuilder will be present.

<repository>  
             <id>  laklaklak-nexus  <  /  id>  
             <url>  http://nexus-h4x0rz.rhcloud.com/repository/maven-snapshots  <  /  url>  
         <  /  repository>
<dependency>  
             <groupId>  me.niobium.util.itembuilder  <  /  groupId>  
             <artifactId>  ItemBuilder  <  /  artifactId>  
             <version>  1.1-SNAPSHOT  <  /  version>  
             <scope>  compile  <  /  scope>  
         <  /  dependency>

Similar projects

Plugin →