Use utility method for team-join display. Fixes BUKKIT-3997

The method to make a string from a collection of strings already exists
and should be used when adding multiple players to a team.

By: Wesley Wolfe <weswolf@aol.com>
This commit is contained in:
Bukkit/Spigot
2013-04-05 12:40:03 -05:00
parent 2436d2b3f8
commit 0716e7a635
2 changed files with 2 additions and 24 deletions

View File

@@ -59,7 +59,7 @@ public final class FireworkEffect implements ConfigurationSerializable {
public static final class Builder {
boolean flicker = false;
boolean trail = false;
ImmutableList.Builder<Color> colors = ImmutableList.builder();
final ImmutableList.Builder<Color> colors = ImmutableList.builder();
ImmutableList.Builder<Color> fadeColors = null;
Type type = Type.BALL;
@@ -130,10 +130,6 @@ public final class FireworkEffect implements ConfigurationSerializable {
public Builder withColor(Color color) throws IllegalArgumentException {
Validate.notNull(color, "Cannot have null color");
if (colors == null) {
colors = ImmutableList.builder();
}
colors.add(color);
return this;
@@ -154,10 +150,6 @@ public final class FireworkEffect implements ConfigurationSerializable {
}
ImmutableList.Builder<Color> list = this.colors;
if (list == null) {
list = this.colors = ImmutableList.builder();
}
for (Color color : colors) {
Validate.notNull(color, "Color cannot be null");
list.add(color);
@@ -178,10 +170,6 @@ public final class FireworkEffect implements ConfigurationSerializable {
Validate.notNull(colors, "Cannot have null colors");
ImmutableList.Builder<Color> list = this.colors;
if (list == null) {
list = this.colors = ImmutableList.builder();
}
for (Object color : colors) {
if (!(color instanceof Color)) {
throw new IllegalArgumentException(color + " is not a Color in " + colors);