Use PluginManager to look for PlayerPoints

This commit is contained in:
Jakub Kolář 2016-12-12 13:51:56 +01:00
parent 079550c5f7
commit 2e6f5d9865
1 changed files with 11 additions and 7 deletions

View File

@ -424,6 +424,8 @@ public class BoosCoolDown extends JavaPlugin implements Runnable {
}
private boolean hookPlayerPoints() {
Plugin x = pm.getPlugin("PlayerPoints");
if (x != null & x instanceof PlayerPoints) {
RegisteredServiceProvider<PlayerPoints> playerPointsProvider = getServer()
.getServicesManager()
.getRegistration(org.black_ixx.playerpoints.PlayerPoints.class);
@ -433,4 +435,6 @@ public class BoosCoolDown extends JavaPlugin implements Runnable {
}
return playerPoints != null;
}
return false;
}
}