Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -938,9 +938,9 @@ public void execute(CommandSender sender, String[] args) {
}

if (plugin.getVoteStreakHandler().resetVoteStreak(user, target)) {
sendMessage(sender, "&cReset VoteStreak '" + target + "' for '" + args[1] + "'");
sendMessage(sender, "&cReset VoteStreak state '" + target + "' for '" + args[1] + "'");
} else {
sendMessage(sender, "&cVoteStreak not found: &e" + target);
sendMessage(sender, "&cVoteStreak or progress group not found: &e" + target);
}
}
});
Expand Down Expand Up @@ -2826,6 +2826,7 @@ public void updateReplacements() {
for (VoteStreakDefinition def : plugin.getVoteStreakHandler().getDefinitions()) {
voteStreaks.add(def.getId());
}
voteStreaks.addAll(plugin.getVoteStreakHandler().getProgressGroups());

TabCompleteHandler.getInstance().addTabCompleteOption(new TabCompleteHandle("(votestreak)", voteStreaks) {

Expand All @@ -2835,6 +2836,7 @@ public void reload() {
for (VoteStreakDefinition def : plugin.getVoteStreakHandler().getDefinitions()) {
voteStreaks.add(def.getId());
}
voteStreaks.addAll(plugin.getVoteStreakHandler().getProgressGroups());
setReplace(voteStreaks);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,25 @@ public final class VoteStreakDefinition {

@Getter
private final boolean recurring;
@Getter
private final String progressGroup;
@Getter
private final String rewardPath;

public VoteStreakDefinition(String id, VoteStreakType type, boolean enabled, int requiredAmount, int votesRequired,
int allowMissedAmount, int allowMissedPeriod, boolean recurring) {
this(id, type, enabled, requiredAmount, votesRequired, allowMissedAmount, allowMissedPeriod, recurring, "",
"VoteStreaks." + id + ".Rewards");
}

public VoteStreakDefinition(String id, VoteStreakType type, boolean enabled, int requiredAmount, int votesRequired,
int allowMissedAmount, int allowMissedPeriod, boolean recurring, String progressGroup) {
this(id, type, enabled, requiredAmount, votesRequired, allowMissedAmount, allowMissedPeriod, recurring,
progressGroup, "VoteStreaks." + id + ".Rewards");
}

public VoteStreakDefinition(String id, VoteStreakType type, boolean enabled, int requiredAmount, int votesRequired,
int allowMissedAmount, int allowMissedPeriod, boolean recurring, String progressGroup, String rewardPath) {
this.id = id;
this.type = type;
this.enabled = enabled;
Expand All @@ -34,6 +50,9 @@ public VoteStreakDefinition(String id, VoteStreakType type, boolean enabled, int
this.allowMissedPeriod = Math.max(0, allowMissedPeriod);
this.votesRequired = Math.max(1, votesRequired);
this.recurring = recurring;
this.progressGroup = progressGroup == null ? "" : progressGroup.trim();
this.rewardPath = rewardPath == null || rewardPath.trim().isEmpty() ? "VoteStreaks." + id + ".Rewards"
: rewardPath.trim();
}

}
Loading
Loading