请问一下怎么获取一个玩家的金币,点卷数量代码,Vault经济插件和PlayerPoints点卷插件
- RegisteredServiceProvider<Economy> rsp = Bukkit.getServer().getServicesManager().getRegistration(Economy.class);
- Economy eco = rsp.getProvider();
- eco.getBalance(p)
- PlayerPoints points = (PlayerPoints)Bukkit.getPluginManager().getPlugin(getPlugin());
- points.getAPI().look(p.getUniqueId())
参照了对应的 papi 变量扩展的实现。
使用pap变量
%vault_eco_balance_fixed% 金币
%playerpoints_points% 点券
%vault_eco_balance_fixed% 金币
%playerpoints_points% 点券
もぺもぺ 发表于 2021-7-22 19:44
参照了对应的 papi 变量扩展的实现。
points.getAPI().look(e.getPlayer().getUniqueId());
服务器执行时会报错null,我是判断的玩家退出服务器 PlayerQuitEvent e
@阳菜 发表于 2021-7-22 20:39
points.getAPI().look(e.getPlayer().getUniqueId());
服务器执行时会报错null,我是判断的玩家退出服务 ...
PlayerPoints points = (PlayerPoints)Bukkit.getPluginManager().getPlugin("PlayerPoints");
以及 getPlugin 可能返回 null 的。
もぺもぺ 发表于 2021-7-22 20:42
PlayerPoints points = (PlayerPoints)Bukkit.getPluginManager().getPlugin("PlayerPoints");
以及 get ...
这个我加上了的
@阳菜 发表于 2021-7-22 20:43
这个我加上了的
import org.black_ixx.playerpoints.PlayerPoints;
import org.black_ixx.playerpoints.PlayerPointsAPI;
PlayerPointsAPI api = PlayerPoints.getInstance().getAPI();
CompletableFuture<Integer> r = api.lookAsync(e.getPlayer().getUniqueId());
r.get();