mirror of
https://github.com/HibiscusMC/HibiscusCommons.git
synced 2025-12-20 15:39:17 +00:00
feat: add additional way to set color
This commit is contained in:
@@ -31,7 +31,7 @@ public class ItemBuilder {
|
|||||||
private String texture;
|
private String texture;
|
||||||
@Getter
|
@Getter
|
||||||
private String skullOwner;
|
private String skullOwner;
|
||||||
private ArrayList<String> lore = new ArrayList<>();
|
private List<String> lore = new ArrayList<>();
|
||||||
private final ArrayList<String> itemFlags = new ArrayList<>();
|
private final ArrayList<String> itemFlags = new ArrayList<>();
|
||||||
private final HashMap<String, Integer> enchantments = new HashMap<>();
|
private final HashMap<String, Integer> enchantments = new HashMap<>();
|
||||||
private final HashMap<NamespacedKey, String> nbtData = new HashMap<>();
|
private final HashMap<NamespacedKey, String> nbtData = new HashMap<>();
|
||||||
@@ -135,7 +135,7 @@ public class ItemBuilder {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemBuilder setLore(@Nullable ArrayList<String> lore) {
|
public ItemBuilder setLore(@Nullable List<String> lore) {
|
||||||
this.lore = lore;
|
this.lore = lore;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -181,6 +181,18 @@ public class ItemBuilder {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the color of the item from RGB
|
||||||
|
* @param red The red value
|
||||||
|
* @param green The green value
|
||||||
|
* @param blue The blue value
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public ItemBuilder setColor(int red, int green, int blue) {
|
||||||
|
this.color = Color.fromRGB(red, green, blue);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the color of the item
|
* Sets the color of the item
|
||||||
* @param color
|
* @param color
|
||||||
|
|||||||
Reference in New Issue
Block a user