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:
parent
df53b83538
commit
e56523ab95
@ -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.PlayerPointsAPI;
|
||||
@ -8,7 +8,7 @@ import org.bukkit.plugin.Plugin;
|
||||
import pw.yumc.YumCore.kit.PKit;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public class PPAPI {
|
||||
public class PointAPI {
|
||||
private static PlayerPointsAPI api;
|
||||
static {
|
||||
Plugin pp = Bukkit.getServer().getPluginManager().getPlugin("PlayerPoints");
|
||||
@ -28,7 +28,7 @@ public class PPAPI {
|
||||
* 数量
|
||||
* @return 是否成功
|
||||
*/
|
||||
public boolean add(String player, int amount) {
|
||||
public static boolean add(String player, int amount) {
|
||||
return api.give(player, amount);
|
||||
}
|
||||
|
||||
@ -41,7 +41,7 @@ public class PPAPI {
|
||||
* 数量
|
||||
* @return 是否有
|
||||
*/
|
||||
public boolean has(String player, int amount) {
|
||||
public static boolean has(String player, int amount) {
|
||||
return api.look(player) >= amount;
|
||||
}
|
||||
|
||||
@ -54,7 +54,7 @@ public class PPAPI {
|
||||
* 数量
|
||||
* @return 是否成功
|
||||
*/
|
||||
public boolean remove(String player, int amount) {
|
||||
public static boolean remove(String player, int amount) {
|
||||
return api.take(player, amount);
|
||||
}
|
||||
|
||||
@ -67,7 +67,7 @@ public class PPAPI {
|
||||
* 数量
|
||||
* @return 是否成功
|
||||
*/
|
||||
public boolean add(OfflinePlayer player, int amount) {
|
||||
public static boolean add(OfflinePlayer player, int amount) {
|
||||
return api.give(player.getUniqueId(), amount);
|
||||
}
|
||||
|
||||
@ -80,7 +80,7 @@ public class PPAPI {
|
||||
* 数量
|
||||
* @return 是否有
|
||||
*/
|
||||
public boolean has(OfflinePlayer player, int amount) {
|
||||
public static boolean has(OfflinePlayer player, int amount) {
|
||||
return api.look(player.getUniqueId()) >= amount;
|
||||
}
|
||||
|
||||
@ -93,7 +93,7 @@ public class PPAPI {
|
||||
* 数量
|
||||
* @return 是否成功
|
||||
*/
|
||||
public boolean remove(OfflinePlayer player, int amount) {
|
||||
public static boolean remove(OfflinePlayer player, int amount) {
|
||||
return api.take(player.getUniqueId(), amount);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user