Skip to content

Commit 1da0284

Browse files
committed
Don't load command if month date isn't enabled
1 parent c28bddd commit 1da0284

File tree

3 files changed

+15
-10
lines changed

3 files changed

+15
-10
lines changed

VotingPlugin/Resources/Config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,7 @@ DefaultRewardBlackListedWorlds: []
602602
# This setting only enables setting totals, not using them
603603
# Enabling this is pretty safe and harmless with just this setting
604604
# Essentially will just copy MonthTotal to MonthTotal-MONTH-YEAR
605+
# Can use command /vote PreviousMonthsVoters after this is enabled
605606
StoreMonthTotalsWithDate: false
606607

607608
# Experimental

VotingPlugin/Resources/bungeeconfig.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ UUIDLookup: true
161161
###########################################
162162
# Month Date Totals
163163
# Experimental feature
164+
# Settings must match on backend servers
164165
###########################################
165166

166167
# Experimental

VotingPlugin/src/com/bencodez/votingplugin/commands/CommandLoader.java

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2477,17 +2477,20 @@ public void execute(CommandSender sender, String[] args) {
24772477
});
24782478
}
24792479

2480-
plugin.getVoteCommand()
2481-
.add(new CommandHandler(plugin, new String[] { "PreviousMonthsVoters" },
2482-
"VotingPlugin.Commands.Vote.PreviousMonthsVoters",
2483-
"Open list of Top Voters from all known previous months") {
2480+
if (plugin.getConfigFile().isStoreMonthTotalsWithDate()
2481+
|| plugin.getOptions().getDebug().equals(DebugLevel.DEV)) {
2482+
plugin.getVoteCommand()
2483+
.add(new CommandHandler(plugin, new String[] { "PreviousMonthsVoters" },
2484+
"VotingPlugin.Commands.Vote.PreviousMonthsVoters",
2485+
"Open list of Top Voters from all known previous months") {
24842486

2485-
@Override
2486-
public void execute(CommandSender sender, String[] args) {
2487-
new VoteTopVoterPreviousMonths(plugin, sender,
2488-
plugin.getVotingPluginUserManager().getVotingPluginUser((Player) sender), 0).open();
2489-
}
2490-
});
2487+
@Override
2488+
public void execute(CommandSender sender, String[] args) {
2489+
new VoteTopVoterPreviousMonths(plugin, sender,
2490+
plugin.getVotingPluginUserManager().getVotingPluginUser((Player) sender), 0).open();
2491+
}
2492+
});
2493+
}
24912494

24922495
plugin.getVoteCommand().add(new CommandHandler(plugin, new String[] { "Top" },
24932496
"VotingPlugin.Commands.Vote.Top|" + playerPerm, "Open list of Top Voters") {

0 commit comments

Comments
 (0)