feat: 添加PlayerPoints接口

Signed-off-by: 502647092 <admin@yumc.pw>
merge/1/MERGE
502647092 2016-11-10 16:48:26 +08:00
parent 560724dd52
commit df53b83538
4 changed files with 111 additions and 6 deletions

BIN
lib/PlayerPoints.jar Normal file

Binary file not shown.

View File

@ -125,12 +125,19 @@
<scope>system</scope>
<systemPath>${project.basedir}/lib/ProtocolLib-3.6.5-SNAPSHOT.jar</systemPath>
</dependency>
<dependency>
<dependency>
<groupId>me.clip</groupId>
<artifactId>PlaceholderAPI</artifactId>
<version>1.8.6</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/PlaceholderAPI.jar</systemPath>
</dependency>
<dependency>
<groupId>org.black_ixx</groupId>
<artifactId>PlayerPoints</artifactId>
<version>2.1.4</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/PlayerPoints.jar</systemPath>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,99 @@
package pw.yumc.YumCore.plugin.playerpoint;
import org.black_ixx.playerpoints.PlayerPoints;
import org.black_ixx.playerpoints.PlayerPointsAPI;
import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer;
import org.bukkit.plugin.Plugin;
import pw.yumc.YumCore.kit.PKit;
@SuppressWarnings("deprecation")
public class PPAPI {
private static PlayerPointsAPI api;
static {
Plugin pp = Bukkit.getServer().getPluginManager().getPlugin("PlayerPoints");
if (pp == null) {
PKit.disable("未找到 PlayerPoint 插件 停止加载...");
} else {
api = ((PlayerPoints) pp).getAPI();
}
}
/**
*
*
* @param player
*
* @param amount
*
* @return
*/
public boolean add(String player, int amount) {
return api.give(player, amount);
}
/**
*
*
* @param player
*
* @param amount
*
* @return
*/
public boolean has(String player, int amount) {
return api.look(player) >= amount;
}
/**
*
*
* @param player
*
* @param amount
*
* @return
*/
public boolean remove(String player, int amount) {
return api.take(player, amount);
}
/**
*
*
* @param player
*
* @param amount
*
* @return
*/
public boolean add(OfflinePlayer player, int amount) {
return api.give(player.getUniqueId(), amount);
}
/**
*
*
* @param player
*
* @param amount
*
* @return
*/
public boolean has(OfflinePlayer player, int amount) {
return api.look(player.getUniqueId()) >= amount;
}
/**
*
*
* @param player
*
* @param amount
*
* @return
*/
public boolean remove(OfflinePlayer player, int amount) {
return api.take(player.getUniqueId(), amount);
}
}

View File

@ -1,11 +1,10 @@
package pw.yumc.YumCore.plugin.vault;
import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer;
import org.bukkit.plugin.RegisteredServiceProvider;
import net.milkbowl.vault.economy.Economy;
import net.milkbowl.vault.economy.EconomyResponse;
import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer;
import org.bukkit.plugin.RegisteredServiceProvider;
import pw.yumc.YumCore.bukkit.Log;
import pw.yumc.YumCore.kit.PKit;
@ -58,7 +57,7 @@ public class VaultEconomy extends VaultBase {
*
* @return
*/
public static boolean had(OfflinePlayer oPlayer, double amont) {
public static boolean has(OfflinePlayer oPlayer, double amont) {
return economy.has(oPlayer, amont);
}