From 267bb78cf38c93cbbbf4db9590f28d3b59752f05 Mon Sep 17 00:00:00 2001 From: Silent Date: Thu, 17 Jun 2021 10:49:25 +0200 Subject: [PATCH] Remove array casting and use lists --- pom.xml | 2 +- src/main/java/tsp/headdb/api/Head.java | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index c74dcb0..dd2781b 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ tsp.headdb HeadDB - 2.3 + 2.3.1 jar HeadDB diff --git a/src/main/java/tsp/headdb/api/Head.java b/src/main/java/tsp/headdb/api/Head.java index 5fc5fff..df95b05 100644 --- a/src/main/java/tsp/headdb/api/Head.java +++ b/src/main/java/tsp/headdb/api/Head.java @@ -53,7 +53,7 @@ public class Head { } meta.setLore(Arrays.asList( Utils.colorize("&cID: " + id), - Utils.colorize("&e" + buildTagLore((String[]) tags.toArray())), + Utils.colorize("&e" + buildTagLore(tags)), "", Utils.colorize("&8Right-Click to add/remove from favorites.") )); @@ -116,11 +116,11 @@ public class Head { return this; } - private String buildTagLore(String... tags) { + private String buildTagLore(List tags) { StringBuilder builder = new StringBuilder(); - for (int i = 0; i < tags.length; i++) { - builder.append(tags[i]); - if (i != tags.length - 1) { + for (int i = 0; i < tags.size(); i++) { + builder.append(tags.get(i)); + if (i != tags.size() - 1) { builder.append(","); } }