Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update VotingPlugin hook #94

Closed
wants to merge 1 commit into from
Closed
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
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@

<!-- Adds voting plugin support -->
<dependency>
<groupId>com.github.Ben12345rocks</groupId>
<groupId>com.github.BenCodez</groupId>
<artifactId>VotingPlugin</artifactId>
<version>LATEST</version>
<scope>provided</scope>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.black_ixx.bossshop.pointsystem;

import com.Ben12345rocks.VotingPlugin.Objects.User;
import com.bencodez.votingplugin.user.UserManager;
import org.bukkit.OfflinePlayer;
import org.bukkit.entity.Player;

Expand All @@ -14,8 +14,7 @@ public BSPointsPluginVotingPlugin() {
@Override
public double getPoints(OfflinePlayer player) {
if (player instanceof Player) {
User user = new User((Player) player);
return user.getPoints();
return UserManager.getInstance().getVotingPluginUser((Player) player).getPoints();
} else {
return 0;
}
Expand All @@ -24,8 +23,7 @@ public double getPoints(OfflinePlayer player) {
@Override
public double setPoints(OfflinePlayer player, double points) {
if (player instanceof Player) {
User user = new User((Player) player);
user.setPoints((int) points);
UserManager.getInstance().getVotingPluginUser((Player) player).setPoints((int) points);
return points;
} else {
return 0;
Expand All @@ -35,8 +33,7 @@ public double setPoints(OfflinePlayer player, double points) {
@Override
public double takePoints(OfflinePlayer player, double points) {
if (player instanceof Player) {
User user = new User((Player) player);
user.removePoints((int) points);
UserManager.getInstance().getVotingPluginUser((Player) player).removePoints((int) points);
return getPoints(player);
} else {
return 0;
Expand All @@ -46,8 +43,7 @@ public double takePoints(OfflinePlayer player, double points) {
@Override
public double givePoints(OfflinePlayer player, double points) {
if (player instanceof Player) {
User user = new User((Player) player);
user.addPoints((int) points);
UserManager.getInstance().getVotingPluginUser((Player) player).addPoints((int) points);
return getPoints(player);
} else {
return 0;
Expand Down