Update VotingPlugin
This commit is contained in:
+32
-32
@@ -1,32 +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);
|
||||
}
|
||||
}
|
||||
package sh.okx.rankup.requirements.requirement.votingplugin;
|
||||
|
||||
import com.bencodez.votingplugin.user.UserManager;
|
||||
import com.bencodez.votingplugin.user.VotingPluginUser;
|
||||
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) {
|
||||
VotingPluginUser 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
-28
@@ -1,28 +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);
|
||||
}
|
||||
}
|
||||
package sh.okx.rankup.requirements.requirement.votingplugin;
|
||||
|
||||
import com.bencodez.votingplugin.user.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);
|
||||
}
|
||||
}
|
||||
|
||||
+28
-28
@@ -1,28 +1,28 @@
|
||||
package sh.okx.rankup.requirements.requirement.votingplugin;
|
||||
|
||||
import com.Ben12345rocks.VotingPlugin.TopVoter.TopVoter;
|
||||
import com.Ben12345rocks.VotingPlugin.UserManager.UserManager;
|
||||
import org.bukkit.entity.Player;
|
||||
import sh.okx.rankup.RankupPlugin;
|
||||
import sh.okx.rankup.requirements.Requirement;
|
||||
import sh.okx.rankup.requirements.ProgressiveRequirement;
|
||||
|
||||
public class VotingPluginVotesRequirement extends ProgressiveRequirement {
|
||||
public VotingPluginVotesRequirement(RankupPlugin plugin) {
|
||||
super(plugin, "votingplugin-votes");
|
||||
}
|
||||
|
||||
protected VotingPluginVotesRequirement(Requirement clone) {
|
||||
super(clone);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getProgress(Player player) {
|
||||
return UserManager.getInstance().getVotingPluginUser(player).getTotal(TopVoter.AllTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Requirement clone() {
|
||||
return new VotingPluginVotesRequirement(this);
|
||||
}
|
||||
}
|
||||
package sh.okx.rankup.requirements.requirement.votingplugin;
|
||||
|
||||
import com.bencodez.votingplugin.topvoter.TopVoter;
|
||||
import com.bencodez.votingplugin.user.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 VotingPluginVotesRequirement extends ProgressiveRequirement {
|
||||
public VotingPluginVotesRequirement(RankupPlugin plugin) {
|
||||
super(plugin, "votingplugin-votes");
|
||||
}
|
||||
|
||||
protected VotingPluginVotesRequirement(Requirement clone) {
|
||||
super(clone);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getProgress(Player player) {
|
||||
return UserManager.getInstance().getVotingPluginUser(player).getTotal(TopVoter.AllTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Requirement clone() {
|
||||
return new VotingPluginVotesRequirement(this);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user