Fixed flag static init order leading to null pointer exeption
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Dieser Commit ist enthalten in:
Ursprung
e4346a36e1
Commit
ccf155d500
@ -34,6 +34,7 @@ import org.bukkit.entity.Player;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Linked
|
||||
@ -111,11 +112,10 @@ public class TraceCommand extends SWCommand {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<String> tabCompletes(CommandSender sender, PreviousArguments previousArguments, String s) {
|
||||
return ViewFlag.flags.stream()
|
||||
.map(viewFlag -> viewFlag.name)
|
||||
.map(flag -> flag.name)
|
||||
.map(name -> "--" + name)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
@ -30,6 +30,10 @@ import java.util.function.UnaryOperator;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public abstract class ViewFlag {
|
||||
/**
|
||||
* Static registry of static flags
|
||||
*/
|
||||
public static final List<ViewFlag> flags = new ArrayList<>();
|
||||
|
||||
public static ViewFlag EXPLOSION = new ViewFlag(true,"explosion") {
|
||||
@Override
|
||||
@ -53,11 +57,6 @@ public abstract class ViewFlag {
|
||||
*/
|
||||
public final String[] aliases;
|
||||
|
||||
/**
|
||||
* Static registry of static flags
|
||||
*/
|
||||
public static final List<ViewFlag> flags = new ArrayList<>();
|
||||
|
||||
public ViewFlag(boolean isStatic, String name, String... aliases) {
|
||||
this.name = name;
|
||||
this.aliases = aliases;
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren