mirror of
https://github.com/ViaVersion/ViaProxy.git
synced 2024-11-26 17:36:21 -05:00
Cleaned up some code
This commit is contained in:
parent
1fbfc2765f
commit
57342c5491
3 changed files with 8 additions and 8 deletions
|
@ -44,7 +44,7 @@ public class VersionEnumConverter implements ValueConverter<VersionEnum> {
|
||||||
public String valuePattern() {
|
public String valuePattern() {
|
||||||
StringBuilder s = new StringBuilder();
|
StringBuilder s = new StringBuilder();
|
||||||
for (VersionEnum version : VersionEnum.getAllVersions()) {
|
for (VersionEnum version : VersionEnum.getAllVersions()) {
|
||||||
s.append((s.length() == 0) ? "" : ", ").append(version.getName());
|
s.append((s.isEmpty()) ? "" : ", ").append(version.getName());
|
||||||
}
|
}
|
||||||
return "[" + s + "]";
|
return "[" + s + "]";
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,7 @@ public class ViaProxyClassicCustomCommandProvider extends ClassicCustomCommandPr
|
||||||
if (message.startsWith("/")) {
|
if (message.startsWith("/")) {
|
||||||
message = message.substring(1);
|
message = message.substring(1);
|
||||||
final String[] args = message.split(" ");
|
final String[] args = message.split(" ");
|
||||||
if (args.length <= 0) return super.handleChatMessage(user, message);
|
if (args.length == 0) return super.handleChatMessage(user, message);
|
||||||
if (args[0].equals("settime")) {
|
if (args[0].equals("settime")) {
|
||||||
try {
|
try {
|
||||||
if (args.length > 1) {
|
if (args.length > 1) {
|
||||||
|
|
|
@ -346,23 +346,23 @@ public class ArrayHelper {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
String out = "";
|
StringBuilder out = new StringBuilder();
|
||||||
for (int i = start; i <= end; i++) {
|
for (int i = start; i <= end; i++) {
|
||||||
if (out.isEmpty()) {
|
if (out.isEmpty()) {
|
||||||
out = this.getString(i);
|
out = new StringBuilder(this.getString(i));
|
||||||
} else {
|
} else {
|
||||||
out += combiner + this.getString(i);
|
out.append(combiner).append(this.getString(i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return out;
|
return out.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
String complete = "";
|
StringBuilder complete = new StringBuilder();
|
||||||
for (String t : this.array) {
|
for (String t : this.array) {
|
||||||
complete += (complete.isEmpty() ? "" : ", ") + t;
|
complete.append((complete.isEmpty()) ? "" : ", ").append(t);
|
||||||
}
|
}
|
||||||
return "[" + complete + "]";
|
return "[" + complete + "]";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue