mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-08-06 04:23:02 +00:00
updated to use corrected joinList function.
This commit is contained in:
parent
c374f474ed
commit
1a2fc307fd
5 changed files with 20 additions and 33 deletions
|
@ -11,7 +11,6 @@ import java.net.URL;
|
|||
import java.text.DecimalFormat;
|
||||
import java.text.DecimalFormatSymbols;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Enumeration;
|
||||
import java.util.GregorianCalendar;
|
||||
|
@ -470,22 +469,34 @@ public class Util
|
|||
}
|
||||
|
||||
public static String joinList(Object... list)
|
||||
{
|
||||
return joinList(", ", list);
|
||||
}
|
||||
|
||||
public static String joinList(String seperator, Object... list)
|
||||
{
|
||||
StringBuilder buf = new StringBuilder();
|
||||
for (Object each : list)
|
||||
{
|
||||
if (buf.length() > 0)
|
||||
{
|
||||
buf.append(", ");
|
||||
buf.append(seperator);
|
||||
}
|
||||
|
||||
if(each instanceof List)
|
||||
{
|
||||
buf.append(joinList(((List)each).toArray()));
|
||||
buf.append(joinList(seperator, ((List)each).toArray()));
|
||||
}
|
||||
else
|
||||
{
|
||||
buf.append(each.toString());
|
||||
try
|
||||
{
|
||||
buf.append(each.toString());
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
buf.append(each.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
return buf.toString();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue