1
1
mirror of https://github.com/geekfrog/PermissionsTime.git synced 2024-11-22 07:28:47 +00:00

2652146617 提交的BUG,修复了op无法打开权限仓库

This commit is contained in:
GeekFrog 2018-04-18 20:54:37 +08:00
parent a6b2d621ab
commit 11330ece35
2 changed files with 5 additions and 2 deletions

View File

@ -164,6 +164,8 @@ public class PluginMain extends JavaPlugin {
public OfflinePlayer getOfflinePlayer(String name) { public OfflinePlayer getOfflinePlayer(String name) {
for (OfflinePlayer p : getServer().getOfflinePlayers()) { for (OfflinePlayer p : getServer().getOfflinePlayers()) {
if(p==null)
continue;
if (p.getName().equalsIgnoreCase(name)) { if (p.getName().equalsIgnoreCase(name)) {
return p; return p;
} }

View File

@ -2,6 +2,7 @@ package gg.frog.mc.permissionstime.command;
import java.util.List; import java.util.List;
import org.bukkit.OfflinePlayer;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -34,9 +35,9 @@ public class MeCmd implements Runnable {
if (isPlayer) { if (isPlayer) {
if (args.length == 1) { if (args.length == 1) {
sender.sendMessage(StrUtil.messageFormat(PluginCfg.PLUGIN_PREFIX + LangCfg.MSG_PROCESSING)); sender.sendMessage(StrUtil.messageFormat(PluginCfg.PLUGIN_PREFIX + LangCfg.MSG_PROCESSING));
Player p = (Player) sender; OfflinePlayer p = this.pm.getOfflinePlayer(sender.getName());
List<PlayerDataBean> ps = sm.getTime(p.getUniqueId().toString()); List<PlayerDataBean> ps = sm.getTime(p.getUniqueId().toString());
PlayerPermissionShow.show(p, ps); PlayerPermissionShow.show((Player) sender, ps);
} else { } else {
sender.sendMessage(StrUtil.messageFormat(PluginCfg.PLUGIN_PREFIX + LangCfg.MSG_PARAMETER_MISMATCH)); sender.sendMessage(StrUtil.messageFormat(PluginCfg.PLUGIN_PREFIX + LangCfg.MSG_PARAMETER_MISMATCH));
sender.sendMessage(StrUtil.messageFormat(LangCfg.CMD_ME, pm.PLUGIN_NAME_LOWER_CASE)); sender.sendMessage(StrUtil.messageFormat(LangCfg.CMD_ME, pm.PLUGIN_NAME_LOWER_CASE));