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 →Let Me Despawn
Improves performance by tweaking mob despawn rules. Say bye to pesky unintentional persistent mobs.
25MSueta
JourneyMap
Real-time map used for mapping in-game or your browser as you explore.
14.7MSueta
Emotecraft
Create your own emotes in Minecraft.
7.5MSueta
Simple Tpa
A simple tpa plugin which sends requests
5.4MSueta
Common Network
Forge and Fabric Unified Networking Solution
3.9MSueta
Set Home
A lightweight plugin for players to set their homes.
3.8MSueta