1
0
mirror of https://e.coding.net/circlecloud/YumCore.git synced 2024-11-22 01:48:50 +00:00

refactor: 重构点券代理方法

Signed-off-by: 502647092 <admin@yumc.pw>
This commit is contained in:
502647092 2016-11-10 16:50:38 +08:00
parent df53b83538
commit e56523ab95

View File

@ -1,4 +1,4 @@
package pw.yumc.YumCore.plugin.playerpoint; package pw.yumc.YumCore.plugin.playerpoints;
import org.black_ixx.playerpoints.PlayerPoints; import org.black_ixx.playerpoints.PlayerPoints;
import org.black_ixx.playerpoints.PlayerPointsAPI; import org.black_ixx.playerpoints.PlayerPointsAPI;
@ -8,7 +8,7 @@ import org.bukkit.plugin.Plugin;
import pw.yumc.YumCore.kit.PKit; import pw.yumc.YumCore.kit.PKit;
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
public class PPAPI { public class PointAPI {
private static PlayerPointsAPI api; private static PlayerPointsAPI api;
static { static {
Plugin pp = Bukkit.getServer().getPluginManager().getPlugin("PlayerPoints"); Plugin pp = Bukkit.getServer().getPluginManager().getPlugin("PlayerPoints");
@ -28,7 +28,7 @@ public class PPAPI {
* 数量 * 数量
* @return 是否成功 * @return 是否成功
*/ */
public boolean add(String player, int amount) { public static boolean add(String player, int amount) {
return api.give(player, amount); return api.give(player, amount);
} }
@ -41,7 +41,7 @@ public class PPAPI {
* 数量 * 数量
* @return 是否有 * @return 是否有
*/ */
public boolean has(String player, int amount) { public static boolean has(String player, int amount) {
return api.look(player) >= amount; return api.look(player) >= amount;
} }
@ -54,7 +54,7 @@ public class PPAPI {
* 数量 * 数量
* @return 是否成功 * @return 是否成功
*/ */
public boolean remove(String player, int amount) { public static boolean remove(String player, int amount) {
return api.take(player, amount); return api.take(player, amount);
} }
@ -67,7 +67,7 @@ public class PPAPI {
* 数量 * 数量
* @return 是否成功 * @return 是否成功
*/ */
public boolean add(OfflinePlayer player, int amount) { public static boolean add(OfflinePlayer player, int amount) {
return api.give(player.getUniqueId(), amount); return api.give(player.getUniqueId(), amount);
} }
@ -80,7 +80,7 @@ public class PPAPI {
* 数量 * 数量
* @return 是否有 * @return 是否有
*/ */
public boolean has(OfflinePlayer player, int amount) { public static boolean has(OfflinePlayer player, int amount) {
return api.look(player.getUniqueId()) >= amount; return api.look(player.getUniqueId()) >= amount;
} }
@ -93,7 +93,7 @@ public class PPAPI {
* 数量 * 数量
* @return 是否成功 * @return 是否成功
*/ */
public boolean remove(OfflinePlayer player, int amount) { public static boolean remove(OfflinePlayer player, int amount) {
return api.take(player.getUniqueId(), amount); return api.take(player.getUniqueId(), amount);
} }
} }