From 449e7dce01d6786999e60538a266df153f5a068f Mon Sep 17 00:00:00 2001 From: Telesphoreo Date: Sun, 17 Apr 2022 01:38:31 -0500 Subject: [PATCH] try and clean up some of the mess from the decompiler --- .../java/dev/plex/emotes/util/EmoteMeta.java | 72 +++++++++---------- .../dev/plex/emotes/util/StringUtils.java | 8 +-- 2 files changed, 40 insertions(+), 40 deletions(-) diff --git a/src/main/java/dev/plex/emotes/util/EmoteMeta.java b/src/main/java/dev/plex/emotes/util/EmoteMeta.java index 84583af..ed82950 100644 --- a/src/main/java/dev/plex/emotes/util/EmoteMeta.java +++ b/src/main/java/dev/plex/emotes/util/EmoteMeta.java @@ -34,9 +34,9 @@ public class EmoteMeta { } - public String getDescription() + public void setUsage(String usage) { - return this.description; + this.usage = usage; } public void setDescription(String description) @@ -44,19 +44,9 @@ public class EmoteMeta this.description = description; } - public String getUsage() + public void setCommand(String command) { - return this.usage; - } - - public void setUsage(String usage) - { - this.usage = usage; - } - - public String getName() - { - return this.name; + this.command = command; } public void setName(String name) @@ -64,29 +54,14 @@ public class EmoteMeta this.name = name; } - public String getAuthor() - { - return this.author; - } - public void setAuthor(String author) { this.author = author; } - public String getCommand() + public void setLineMap(HashMap, String[]> lineMap) { - return this.command; - } - - public void setCommand(String command) - { - this.command = command; - } - - public HashMap getVariableMap() - { - return this.variableMap; + this.lineMap = lineMap; } public void setVariableMap(HashMap variableMap) @@ -94,13 +69,38 @@ public class EmoteMeta this.variableMap = variableMap; } + public String getDescription() + { + return this.description; + } + + public String getUsage() + { + return this.usage; + } + + public String getName() + { + return this.name; + } + + public String getAuthor() + { + return this.author; + } + + public String getCommand() + { + return this.command; + } + + public HashMap getVariableMap() + { + return this.variableMap; + } + public HashMap, String[]> getLineMap() { return this.lineMap; } - - public void setLineMap(HashMap, String[]> lineMap) - { - this.lineMap = lineMap; - } } diff --git a/src/main/java/dev/plex/emotes/util/StringUtils.java b/src/main/java/dev/plex/emotes/util/StringUtils.java index b610d33..4bd57e9 100644 --- a/src/main/java/dev/plex/emotes/util/StringUtils.java +++ b/src/main/java/dev/plex/emotes/util/StringUtils.java @@ -1,7 +1,7 @@ package dev.plex.emotes.util; - import java.util.ArrayList; +import java.util.List; import java.util.Random; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -38,7 +38,7 @@ public class StringUtils extends org.apache.commons.lang.StringUtils StringBuilder outBuilder = new StringBuilder(); String toSplit = in.replaceAll(pattern, "%%spl"); String[] split = toSplit.split("%%spl"); - ArrayList matches = new ArrayList<>(); + List matches = new ArrayList<>(); Matcher m = Pattern.compile(pattern).matcher(in); while (m.find()) { @@ -47,7 +47,7 @@ public class StringUtils extends org.apache.commons.lang.StringUtils for (int i = 0; i < split.length - ((split.length > matches.size()) ? 1 : 0); i++) { outBuilder.append(split[i]); - String randoms = ((String)matches.get(i)).substring(1, ((String)matches.get(i)).length() - 1); + String randoms = matches.get(i).substring(1, matches.get(i).length() - 1); String[] splitRandoms = randoms.split("\\|"); Random rand = new Random(); outBuilder.append(splitRandoms[rand.nextInt(splitRandoms.length - 1)]); @@ -58,4 +58,4 @@ public class StringUtils extends org.apache.commons.lang.StringUtils } return outBuilder.toString(); } -} +} \ No newline at end of file