1313import tc .oc .commons .core .commands .TranslatableCommandException ;
1414import tc .oc .commons .core .formatting .StringUtils ;
1515import tc .oc .commons .core .restart .RestartManager ;
16- import tc .oc .pgm .Config ;
1716import tc .oc .pgm .commands .CommandUtils ;
1817import tc .oc .pgm .map .PGMMap ;
1918import tc .oc .pgm .match .MatchManager ;
2019import tc .oc .pgm .mutation .Mutation ;
2120import tc .oc .pgm .mutation .MutationQueue ;
22- import tc .oc .pgm .mutation .command .MutationCommands ;
2321import tc .oc .pgm .polls .PollBlacklist ;
22+ import tc .oc .pgm .polls .PollConfig ;
2423import tc .oc .pgm .polls .types .PollCustom ;
2524import tc .oc .pgm .polls .types .PollKick ;
2625import tc .oc .pgm .polls .PollManager ;
2726import tc .oc .pgm .polls .types .PollMutation ;
2827import tc .oc .pgm .polls .types .PollNextMap ;
2928
3029import javax .inject .Inject ;
31- import java .util .Collection ;
3230import java .util .List ;
3331
3432public class PollSubCommands {
@@ -44,19 +42,21 @@ public class PollSubCommands {
4442 private final UserStore userStore ;
4543 private final OnlinePlayers onlinePlayers ;
4644 private final MatchManager matchManager ;
45+ private final PollConfig pollConfig ;
4746
4847 @ Inject
4948 PollSubCommands (RestartManager restartManager ,
50- MutationQueue mutationQueue ,
51- PollManager pollManager ,
52- PollCustom .Factory pollCustomFactory ,
53- PollNextMap .Factory pollMapFactory ,
54- PollMutation .Factory pollMutationFactory ,
55- PollKick .Factory pollKickFactory ,
56- PollBlacklist pollBlacklist ,
57- UserStore userStore ,
58- OnlinePlayers onlinePlayers ,
59- MatchManager matchManager ) {
49+ MutationQueue mutationQueue ,
50+ PollManager pollManager ,
51+ PollCustom .Factory pollCustomFactory ,
52+ PollNextMap .Factory pollMapFactory ,
53+ PollMutation .Factory pollMutationFactory ,
54+ PollKick .Factory pollKickFactory ,
55+ PollBlacklist pollBlacklist ,
56+ UserStore userStore ,
57+ OnlinePlayers onlinePlayers ,
58+ MatchManager matchManager ,
59+ PollConfig pollConfig ) {
6060 this .restartManager = restartManager ;
6161 this .mutationQueue = mutationQueue ;
6262 this .pollManager = pollManager ;
@@ -68,6 +68,7 @@ public class PollSubCommands {
6868 this .userStore = userStore ;
6969 this .onlinePlayers = onlinePlayers ;
7070 this .matchManager = matchManager ;
71+ this .pollConfig = pollConfig ;
7172 }
7273
7374
@@ -105,7 +106,7 @@ public List<String> pollNext(CommandContext args, CommandSender sender) throws C
105106 return CommandUtils .completeMapName (mapName );
106107 }
107108
108- if (!Config . Poll .enabled ()) {
109+ if (!pollConfig .enabled ()) {
109110 throw new TranslatableCommandException ("poll.disabled" );
110111 }
111112
@@ -147,7 +148,7 @@ public List<String> pollMutation(CommandContext args, CommandSender sender) thro
147148 return StringUtils .complete (args .getSuggestionContext ().getPrefix (), mutationQueue .mutationsAvailable ().stream ().map (mutation -> mutation .name ().toLowerCase ()));
148149 }
149150
150- if (!Config . Poll .enabled ()) {
151+ if (!pollConfig .enabled ()) {
151152 throw new TranslatableCommandException ("poll.disabled" );
152153 }
153154
@@ -161,7 +162,7 @@ public List<String> pollMutation(CommandContext args, CommandSender sender) thro
161162 if (mutation == null ) {
162163 throw new TranslatableCommandException ("command.mutation.error.find" , mutationString );
163164 } else if (mutationQueue .mutations ().contains (mutation )) {
164- throw new TranslatableCommandException (true ? "command.mutation.error.enabled" : "command.mutation.error.disabled " , mutation .getComponent (net .md_5 .bungee .api .ChatColor .RED ));
165+ throw new TranslatableCommandException ("command.mutation.error.enabled" , mutation .getComponent (net .md_5 .bungee .api .ChatColor .RED ));
165166 } else if (!mutation .isPollable () && !sender .hasPermission ("poll.mutation.override" )) {
166167 throw new TranslatableCommandException ("command.mutation.error.illegal" , mutationString );
167168 }
0 commit comments