1.0.1:Fix error:[DirectoryProviderSource] Error loading plugin: name is not defined
This commit is contained in:
@@ -23,10 +23,9 @@ public class AdminCommands implements CommandExecutor {
|
||||
}
|
||||
|
||||
if (command.getName().equalsIgnoreCase("pblreload")) {
|
||||
plugin.reloadConfig();
|
||||
plugin.getBlockManager().loadData();
|
||||
plugin.getSkinManager().loadAllSkins();
|
||||
sender.sendMessage("§a插件配置已重载!");
|
||||
// 调用插件的完整重载方法
|
||||
plugin.reloadPluginConfig();
|
||||
sender.sendMessage("§a插件配置已完全重载!");
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -44,7 +43,12 @@ public class AdminCommands implements CommandExecutor {
|
||||
targetId = target.getUniqueId();
|
||||
} else {
|
||||
// 尝试从离线玩家获取UUID
|
||||
targetId = Bukkit.getOfflinePlayer(targetName).getUniqueId();
|
||||
try {
|
||||
targetId = Bukkit.getOfflinePlayer(targetName).getUniqueId();
|
||||
} catch (Exception e) {
|
||||
sender.sendMessage("§c找不到玩家: " + targetName);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
plugin.getBlockManager().clearPlayerBlocks(targetId);
|
||||
@@ -69,12 +73,21 @@ public class AdminCommands implements CommandExecutor {
|
||||
}
|
||||
}
|
||||
|
||||
plugin.getLifeSystem().revivePlayer(target);
|
||||
sender.sendMessage("§a玩家 " + target.getName() + " 已复活!");
|
||||
if (plugin.getLifeSystem() != null) {
|
||||
plugin.getLifeSystem().revivePlayer(target);
|
||||
sender.sendMessage("§a玩家 " + target.getName() + " 已复活!");
|
||||
} else {
|
||||
sender.sendMessage("§c复活失败:生命系统未初始化");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
if (command.getName().equalsIgnoreCase("pblstats")) {
|
||||
if (plugin.getBlockManager() == null) {
|
||||
sender.sendMessage("§c方块管理器未初始化");
|
||||
return true;
|
||||
}
|
||||
|
||||
int totalPlayers = plugin.getBlockManager().getPlayerBlocksCount();
|
||||
int totalBlocks = plugin.getBlockManager().getTotalBlocksCount();
|
||||
|
||||
@@ -85,9 +98,11 @@ public class AdminCommands implements CommandExecutor {
|
||||
|
||||
for (Player player : Bukkit.getOnlinePlayers()) {
|
||||
int blocks = plugin.getBlockManager().getRemainingBlocks(player.getUniqueId());
|
||||
sender.sendMessage("§7- " + player.getName() + ": §e" + blocks + " §7/ §a5");
|
||||
String status = blocks > 0 ? "§a存活" : "§c已淘汰";
|
||||
sender.sendMessage("§7- " + player.getName() + ": §e" + blocks + " §7/ §a5 §7(" + status + "§7)");
|
||||
}
|
||||
|
||||
sender.sendMessage("§a=================================");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user