From b716801f1e880e550329b8e31944b51b026f339a Mon Sep 17 00:00:00 2001 From: LoJoSho Date: Fri, 23 Feb 2024 15:19:45 -0600 Subject: [PATCH] feat: add additional way to set color --- .../hibiscuscommons/items/ItemBuilder.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/common/src/main/java/me/lojosho/hibiscuscommons/items/ItemBuilder.java b/common/src/main/java/me/lojosho/hibiscuscommons/items/ItemBuilder.java index 19669f2..90e287b 100644 --- a/common/src/main/java/me/lojosho/hibiscuscommons/items/ItemBuilder.java +++ b/common/src/main/java/me/lojosho/hibiscuscommons/items/ItemBuilder.java @@ -31,7 +31,7 @@ public class ItemBuilder { private String texture; @Getter private String skullOwner; - private ArrayList lore = new ArrayList<>(); + private List lore = new ArrayList<>(); private final ArrayList itemFlags = new ArrayList<>(); private final HashMap enchantments = new HashMap<>(); private final HashMap nbtData = new HashMap<>(); @@ -135,7 +135,7 @@ public class ItemBuilder { return this; } - public ItemBuilder setLore(@Nullable ArrayList lore) { + public ItemBuilder setLore(@Nullable List lore) { this.lore = lore; return this; } @@ -181,6 +181,18 @@ public class ItemBuilder { 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 * @param color