11package me .xginko .aef .commands .aef ;
22
3+ import com .google .common .collect .ImmutableList ;
4+ import com .google .common .collect .ImmutableSet ;
35import me .xginko .aef .AnarchyExploitFixes ;
46import me .xginko .aef .commands .AEFCommand ;
57import me .xginko .aef .commands .SubCommand ;
6- import me .xginko .aef .commands .aef .subcommands .DataValueSubCmd ;
78import me .xginko .aef .commands .aef .subcommands .DisableSubCmd ;
89import me .xginko .aef .commands .aef .subcommands .ElytraSubCmd ;
910import me .xginko .aef .commands .aef .subcommands .GearedSubCmd ;
1011import me .xginko .aef .commands .aef .subcommands .LagSubCmd ;
1112import me .xginko .aef .commands .aef .subcommands .ReloadSubCmd ;
1213import me .xginko .aef .commands .aef .subcommands .VersionSubCmd ;
13- import me .xginko .aef .commands .aef .subcommands .bytesize .ByteSizeSubCmd ;
1414import org .bukkit .ChatColor ;
1515import org .bukkit .command .Command ;
1616import org .bukkit .command .CommandException ;
1717import org .bukkit .command .CommandSender ;
1818import org .jetbrains .annotations .NotNull ;
1919
20- import java .util .Arrays ;
2120import java .util .Collections ;
2221import java .util .List ;
2322import java .util .Locale ;
23+ import java .util .Set ;
2424import java .util .stream .Collectors ;
2525import java .util .stream .Stream ;
2626
2727public class AEFCmd extends Command implements AEFCommand {
2828
29- private final List <SubCommand > subCommands ;
30- private final List <String > tabCompletes ;
31- private final List <String > overview ;
29+ private final Set <SubCommand > subCommands ;
30+ private final List <String > tabCompletes , overview ;
3231
3332 public AEFCmd () {
3433 super (
@@ -51,18 +50,17 @@ public AEFCmd() {
5150 " &b/aef bytesize <mainhand/inventory> (player) (utf8/utf16)" ,
5251 " &8- &fGet the byte size of an item or inventory." ,
5352 ""
54- ).map (line -> ChatColor .translateAlternateColorCodes ('&' , line )).collect (Collectors .toList ());
55- this .subCommands = Arrays .asList (
53+ ).map (line -> ChatColor .translateAlternateColorCodes ('&' , line ))
54+ .collect (Collectors .collectingAndThen (Collectors .toList (), ImmutableList ::copyOf ));
55+ this .subCommands = ImmutableSet .of (
5656 new ReloadSubCmd (),
5757 new VersionSubCmd (),
5858 new DisableSubCmd (),
5959 new LagSubCmd (),
6060 new ElytraSubCmd (),
61- new GearedSubCmd (),
62- new DataValueSubCmd (),
63- new ByteSizeSubCmd ()
64- );
65- this .tabCompletes = subCommands .stream ().map (SubCommand ::label ).sorted ().collect (Collectors .toList ());
61+ new GearedSubCmd ());
62+ this .tabCompletes = subCommands .stream ().map (SubCommand ::label ).sorted ()
63+ .collect (Collectors .collectingAndThen (Collectors .toList (), ImmutableList ::copyOf ));
6664 }
6765
6866 @ Override
0 commit comments