Skip to content

Commit 691d475

Browse files
committed
fix votingplugin + stop people using permission-rankup
1 parent abd4365 commit 691d475

File tree

6 files changed

+10
-37
lines changed

6 files changed

+10
-37
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ dependencies {
6262
compileOnly('com.github.mcMMO-Dev:mcMMO:601297') {
6363
exclude group: 'com.sk89q.worldguard'
6464
}
65-
compileOnly ('com.bencodez:votingplugin:6.13.1') {
65+
compileOnly ('com.bencodez:votingplugin:6.14.1') {
6666
transitive = false
6767
}
6868

src/main/java/sh/okx/rankup/requirements/requirement/votingplugin/VotingPluginPointsDeductibleRequirement.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package sh.okx.rankup.requirements.requirement.votingplugin;
22

3+
import com.bencodez.votingplugin.VotingPluginMain;
34
import com.bencodez.votingplugin.user.VotingPluginUser;
45
import org.bukkit.entity.Player;
56
import sh.okx.rankup.RankupPlugin;
@@ -18,7 +19,7 @@ protected VotingPluginPointsDeductibleRequirement(Requirement clone) {
1819

1920
@Override
2021
public void apply(Player player, double multiplier) {
21-
VotingPluginUser user = VotingPluginUtil.getInstance().getUserManager().getVotingPluginUser(player);
22+
VotingPluginUser user = VotingPluginMain.getPlugin().getVotingPluginUserManager().getVotingPluginUser(player);
2223
if(!user.removePoints(getValueInt())) {
2324
plugin.getLogger().warning("Unable to remove VotingPlugin points");
2425
}

src/main/java/sh/okx/rankup/requirements/requirement/votingplugin/VotingPluginPointsRequirement.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package sh.okx.rankup.requirements.requirement.votingplugin;
22

3+
import com.bencodez.votingplugin.VotingPluginMain;
34
import org.bukkit.entity.Player;
45
import sh.okx.rankup.RankupPlugin;
56
import sh.okx.rankup.requirements.ProgressiveRequirement;
@@ -17,7 +18,7 @@ protected VotingPluginPointsRequirement(Requirement clone) {
1718

1819
@Override
1920
public double getProgress(Player player) {
20-
return VotingPluginUtil.getInstance().getUserManager().getVotingPluginUser(player).getPoints();
21+
return VotingPluginMain.getPlugin().getVotingPluginUserManager().getVotingPluginUser(player).getPoints();
2122
}
2223

2324
@Override

src/main/java/sh/okx/rankup/requirements/requirement/votingplugin/VotingPluginUtil.java

Lines changed: 0 additions & 33 deletions
This file was deleted.

src/main/java/sh/okx/rankup/requirements/requirement/votingplugin/VotingPluginVotesRequirement.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package sh.okx.rankup.requirements.requirement.votingplugin;
22

3+
import com.bencodez.votingplugin.VotingPluginMain;
34
import com.bencodez.votingplugin.topvoter.TopVoter;
45
import org.bukkit.entity.Player;
56
import sh.okx.rankup.RankupPlugin;
@@ -17,7 +18,7 @@ protected VotingPluginVotesRequirement(Requirement clone) {
1718

1819
@Override
1920
public double getProgress(Player player) {
20-
return VotingPluginUtil.getInstance().getUserManager().getVotingPluginUser(player).getTotal(TopVoter.AllTime);
21+
return VotingPluginMain.getPlugin().getVotingPluginUserManager().getVotingPluginUser(player).getTotal(TopVoter.AllTime);
2122
}
2223

2324
@Override

src/main/resources/config.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ notify-update: true
4444
# if true, players will be checked for the permission rankup.rank.RANK, where RANK
4545
# is the rankup in rankups.yml. Nothing will automatically happen on rankup, so you must
4646
# use commands to change a player's group or permission.
47+
# THIS IS MORE DIFFICULT TO USE. DO NOT ENABLE THIS UNLESS YOU ARE HAPPY TO ACKNOWLEDGE THAT IT MAKES MORE WORK FOR YOU.
48+
# By default, Rankup will automatically change groups when someone ranks up, using your permissions plugin.
49+
# You only need to enable this if you really need the flexibility.
4750
permission-rankup: false
4851

4952
# if not empty, these are the contexts to use when modifying groups if LuckPerms is enabled

0 commit comments

Comments
 (0)