change votes requirements to use total votes, add points requirement
This commit is contained in:
+4
-7
@@ -4,19 +4,16 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
group 'sh.okx'
|
group 'sh.okx'
|
||||||
version '3.8'
|
version '3.8.1'
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
mavenLocal()
|
mavenLocal()
|
||||||
maven {
|
|
||||||
url 'http://nexus.hc.to/content/repositories/pub_releases'
|
|
||||||
}
|
|
||||||
maven {
|
maven {
|
||||||
url 'https://hub.spigotmc.org/nexus/content/groups/public/'
|
url 'https://hub.spigotmc.org/nexus/content/groups/public/'
|
||||||
}
|
}
|
||||||
maven {
|
maven {
|
||||||
url 'http://repo.extendedclip.com/content/repositories/placeholderapi/'
|
url 'https://repo.extendedclip.com/content/repositories/placeholderapi/'
|
||||||
}
|
}
|
||||||
maven {
|
maven {
|
||||||
url 'https://raw.github.com/PyvesB/AdvancedAchievements/mvn-repo/'
|
url 'https://raw.github.com/PyvesB/AdvancedAchievements/mvn-repo/'
|
||||||
@@ -35,7 +32,7 @@ dependencies {
|
|||||||
transitive = false
|
transitive = false
|
||||||
}
|
}
|
||||||
|
|
||||||
implementation('net.milkbowl.vault:VaultAPI:1.7') {
|
implementation('com.github.MilkBowl:VaultAPI:1.7') {
|
||||||
exclude group: 'org.bukkit'
|
exclude group: 'org.bukkit'
|
||||||
}
|
}
|
||||||
implementation 'me.clip:placeholderapi:2.9.2'
|
implementation 'me.clip:placeholderapi:2.9.2'
|
||||||
@@ -43,7 +40,7 @@ dependencies {
|
|||||||
implementation('com.github.mcMMO-Dev:mcMMO:601297') {
|
implementation('com.github.mcMMO-Dev:mcMMO:601297') {
|
||||||
exclude group: 'com.sk89q.worldguard'
|
exclude group: 'com.sk89q.worldguard'
|
||||||
}
|
}
|
||||||
implementation 'com.github.Ben12345rocks:VotingPlugin:5.18.2'
|
implementation 'com.github.Ben12345rocks:VotingPlugin:5.21.1'
|
||||||
implementation 'com.github.LlmDl:Towny:25fc18a'
|
implementation 'com.github.LlmDl:Towny:25fc18a'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -70,6 +70,8 @@ import sh.okx.rankup.requirements.requirement.towny.TownyKingRequirement;
|
|||||||
import sh.okx.rankup.requirements.requirement.towny.TownyMayorNumberResidentsRequirement;
|
import sh.okx.rankup.requirements.requirement.towny.TownyMayorNumberResidentsRequirement;
|
||||||
import sh.okx.rankup.requirements.requirement.towny.TownyMayorRequirement;
|
import sh.okx.rankup.requirements.requirement.towny.TownyMayorRequirement;
|
||||||
import sh.okx.rankup.requirements.requirement.towny.TownyResidentRequirement;
|
import sh.okx.rankup.requirements.requirement.towny.TownyResidentRequirement;
|
||||||
|
import sh.okx.rankup.requirements.requirement.votingplugin.VotingPluginPointsDeductibleRequirement;
|
||||||
|
import sh.okx.rankup.requirements.requirement.votingplugin.VotingPluginPointsRequirement;
|
||||||
import sh.okx.rankup.requirements.requirement.votingplugin.VotingPluginVotesRequirement;
|
import sh.okx.rankup.requirements.requirement.votingplugin.VotingPluginVotesRequirement;
|
||||||
import sh.okx.rankup.util.UpdateNotifier;
|
import sh.okx.rankup.util.UpdateNotifier;
|
||||||
import sh.okx.rankup.util.VersionChecker;
|
import sh.okx.rankup.util.VersionChecker;
|
||||||
@@ -349,7 +351,9 @@ public class RankupPlugin extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
if (pluginManager.isPluginEnabled("VotingPlugin")) {
|
if (pluginManager.isPluginEnabled("VotingPlugin")) {
|
||||||
requirements.addRequirements(
|
requirements.addRequirements(
|
||||||
new VotingPluginVotesRequirement(this));
|
new VotingPluginVotesRequirement(this),
|
||||||
|
new VotingPluginPointsRequirement(this, "votingplugin-pointsh"),
|
||||||
|
new VotingPluginPointsDeductibleRequirement(this, "votingplugin-points"));
|
||||||
}
|
}
|
||||||
if (Bukkit.getPluginManager().isPluginEnabled("Towny")) {
|
if (Bukkit.getPluginManager().isPluginEnabled("Towny")) {
|
||||||
requirements.addRequirements(
|
requirements.addRequirements(
|
||||||
|
|||||||
+32
@@ -0,0 +1,32 @@
|
|||||||
|
package sh.okx.rankup.requirements.requirement.votingplugin;
|
||||||
|
|
||||||
|
import com.Ben12345rocks.VotingPlugin.Objects.User;
|
||||||
|
import com.Ben12345rocks.VotingPlugin.UserManager.UserManager;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import sh.okx.rankup.RankupPlugin;
|
||||||
|
import sh.okx.rankup.requirements.DeductibleRequirement;
|
||||||
|
import sh.okx.rankup.requirements.Requirement;
|
||||||
|
|
||||||
|
public class VotingPluginPointsDeductibleRequirement extends VotingPluginPointsRequirement implements DeductibleRequirement {
|
||||||
|
|
||||||
|
public VotingPluginPointsDeductibleRequirement(RankupPlugin plugin, String name) {
|
||||||
|
super(plugin, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected VotingPluginPointsDeductibleRequirement(Requirement clone) {
|
||||||
|
super(clone);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void apply(Player player, double multiplier) {
|
||||||
|
User user = UserManager.getInstance().getVotingPluginUser(player);
|
||||||
|
if(!user.removePoints(getValueInt())) {
|
||||||
|
plugin.getLogger().warning("Unable to remove VotingPlugin points");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Requirement clone() {
|
||||||
|
return new VotingPluginPointsDeductibleRequirement(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
+28
@@ -0,0 +1,28 @@
|
|||||||
|
package sh.okx.rankup.requirements.requirement.votingplugin;
|
||||||
|
|
||||||
|
import com.Ben12345rocks.VotingPlugin.UserManager.UserManager;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import sh.okx.rankup.RankupPlugin;
|
||||||
|
import sh.okx.rankup.requirements.ProgressiveRequirement;
|
||||||
|
import sh.okx.rankup.requirements.Requirement;
|
||||||
|
|
||||||
|
public class VotingPluginPointsRequirement extends ProgressiveRequirement {
|
||||||
|
|
||||||
|
public VotingPluginPointsRequirement(RankupPlugin plugin, String name) {
|
||||||
|
super(plugin, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected VotingPluginPointsRequirement(Requirement clone) {
|
||||||
|
super(clone);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public double getProgress(Player player) {
|
||||||
|
return UserManager.getInstance().getVotingPluginUser(player).getPoints();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Requirement clone() {
|
||||||
|
return new VotingPluginPointsRequirement(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
+2
-1
@@ -1,5 +1,6 @@
|
|||||||
package sh.okx.rankup.requirements.requirement.votingplugin;
|
package sh.okx.rankup.requirements.requirement.votingplugin;
|
||||||
|
|
||||||
|
import com.Ben12345rocks.VotingPlugin.TopVoter.TopVoter;
|
||||||
import com.Ben12345rocks.VotingPlugin.UserManager.UserManager;
|
import com.Ben12345rocks.VotingPlugin.UserManager.UserManager;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import sh.okx.rankup.RankupPlugin;
|
import sh.okx.rankup.RankupPlugin;
|
||||||
@@ -17,7 +18,7 @@ public class VotingPluginVotesRequirement extends ProgressiveRequirement {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public double getProgress(Player player) {
|
public double getProgress(Player player) {
|
||||||
return UserManager.getInstance().getVotingPluginUser(player).getPoints();
|
return UserManager.getInstance().getVotingPluginUser(player).getTotal(TopVoter.AllTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ Aexample:
|
|||||||
next: 'B'
|
next: 'B'
|
||||||
# List of requirements to go to the next rank
|
# List of requirements to go to the next rank
|
||||||
# This example will charge 1000 money to rankup from A to B.
|
# This example will charge 1000 money to rankup from A to B.
|
||||||
# https://github.com/okx-code/Rankup3/wiki/Requirements
|
# https://github.com/okx-code/Rankup3/wiki/List-of-Requirements
|
||||||
# custom requirements can also be added by other plugins.
|
# custom requirements can also be added by other plugins.
|
||||||
requirements:
|
requirements:
|
||||||
- 'money 1000'
|
- 'money 1000'
|
||||||
|
|||||||
Reference in New Issue
Block a user