Skip to content

Commit

Permalink
Update ItemBuilder.java
Browse files Browse the repository at this point in the history
  • Loading branch information
Oribuin committed May 30, 2024
1 parent f844d81 commit 20dc599
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions src/main/java/xyz/oribuin/eternaltags/util/ItemBuilder.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package xyz.oribuin.eternaltags.util;


import org.bukkit.Color;
import org.bukkit.Material;
import org.bukkit.OfflinePlayer;
Expand All @@ -24,19 +23,35 @@
public class ItemBuilder {

private final ItemStack item;
private ItemMeta meta;
private final ItemMeta meta;

/**
* Create a new Item Builder with a Material.
*
* @param material The Material.
*/
public ItemBuilder(Material material) {
this.item = new ItemStack(material);
this.meta = this.item.getItemMeta();
}

/**
* Create a new Item Builder with an existing ItemStack.
*
* @param item The ItemStack.
*/
public ItemBuilder(ItemStack item) {
this.item = item.clone();
this.meta = this.item.getItemMeta();
}

public ItemBuilder setMaterial(Material material) {
/**
* Set the ItemStack's Material.
*
* @param material The Material.
* @return Item.Builder.
*/
public ItemBuilder material(Material material) {
this.item.setType(material);
return this;
}
Expand Down

0 comments on commit 20dc599

Please # to comment.