try and clean up some of the mess from the decompiler

This commit is contained in:
Telesphoreo 2022-04-17 01:38:31 -05:00
parent 9a63b857d5
commit 449e7dce01
2 changed files with 40 additions and 40 deletions

View File

@ -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<List<EmoteVariable>, String[]> lineMap)
{
return this.command;
}
public void setCommand(String command)
{
this.command = command;
}
public HashMap<EmoteVariable, String> getVariableMap()
{
return this.variableMap;
this.lineMap = lineMap;
}
public void setVariableMap(HashMap<EmoteVariable, String> 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<EmoteVariable, String> getVariableMap()
{
return this.variableMap;
}
public HashMap<List<EmoteVariable>, String[]> getLineMap()
{
return this.lineMap;
}
public void setLineMap(HashMap<List<EmoteVariable>, String[]> lineMap)
{
this.lineMap = lineMap;
}
}

View File

@ -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<String> matches = new ArrayList<>();
List<String> 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();
}
}
}