Skip to content

Commit

Permalink
Add lastmonth position placeholder
Browse files Browse the repository at this point in the history
  • Loading branch information
BenCodez committed May 2, 2024
1 parent 5a61400 commit 86cba23
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions VotingPlugin/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
/*.iml
/.settings/
/.classpath
/.factorypath
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,21 @@ public String placeholderRequest(VotingPluginUser user, String identifier) {
}.withDescription("Get user top voter position"));

if (plugin.getGui().isLastMonthGUI()) {
placeholders.add(new PlaceHolder<VotingPluginUser>("Top_LastMonth_Position") {

@Override
public String placeholderRequest(VotingPluginUser user, String identifier) {
int num = 1;
UUID toMatch = UUID.fromString(user.getUUID());
for (Entry<TopVoterPlayer, Integer> entry : plugin.getLastMonthTopVoter().entrySet()) {
if (entry.getKey().getUuid().equals(toMatch)) {
return "" + num;
}
num++;
}
return "";
}
}.withDescription("Get user top voter position for lastmonth"));
nonPlayerPlaceholders.add(new NonPlayerPlaceHolder<VotingPluginUser>("Top_LastMonth_") {

@Override
Expand Down Expand Up @@ -666,6 +681,7 @@ public String placeholderRequest(String identifier) {
return "";
}
}.useStartsWith().withDescription("Get user votes at position in last month top voter"));

}

nonPlayerPlaceholders.add(new NonPlayerPlaceHolder<VotingPluginUser>("Top_Month_") {
Expand Down

0 comments on commit 86cba23

Please sign in to comment.