1
1
mirror of https://github.com/geekfrog/PermissionsTime.git synced 2024-11-22 15:48:51 +00:00
This commit is contained in:
GeekFrog 2017-07-15 07:27:47 +08:00
parent c884400781
commit 06c6c9af63
2 changed files with 10 additions and 6 deletions

View File

@ -41,8 +41,10 @@ public class MeCmd implements Runnable {
sender.sendMessage(StrUtil.messageFormat(PluginCfg.PLUGIN_PREFIX + "=====你共有{0}种权限包=====", ps.size())); sender.sendMessage(StrUtil.messageFormat(PluginCfg.PLUGIN_PREFIX + "=====你共有{0}种权限包=====", ps.size()));
for (PlayerDataBean pdb : ps) { for (PlayerDataBean pdb : ps) {
PermissionPackageBean pc = PackagesCfg.PACKAGES.get(pdb.getPackageName()); PermissionPackageBean pc = PackagesCfg.PACKAGES.get(pdb.getPackageName());
String expireString = StrUtil.timestampToString(pdb.getExpire()); if (pc != null) {
sender.sendMessage(StrUtil.messageFormat(PluginCfg.PLUGIN_PREFIX + "权限包: {0}({1}), 到期时间: {2}", pc.getDisplayName(), pdb.getPackageName(), expireString)); String expireString = StrUtil.timestampToString(pdb.getExpire());
sender.sendMessage(StrUtil.messageFormat(PluginCfg.PLUGIN_PREFIX + "权限包: {0}({1}), 到期时间: {2}", pc.getDisplayName(), pdb.getPackageName(), expireString));
}
} }
} else { } else {
sender.sendMessage(StrUtil.messageFormat(PluginCfg.PLUGIN_PREFIX + "暂时无数据")); sender.sendMessage(StrUtil.messageFormat(PluginCfg.PLUGIN_PREFIX + "暂时无数据"));

View File

@ -176,10 +176,12 @@ public class PermissionPackageBean implements IConfigBean {
} }
} }
PermissionPackageBean p = PackagesCfg.PACKAGES.get(pdb.getPackageName()); PermissionPackageBean p = PackagesCfg.PACKAGES.get(pdb.getPackageName());
addPpb.getPermissions().addAll(p.getPermissions()); if (p != null) {
subPpb.getPermissions().removeAll(p.getPermissions()); addPpb.getPermissions().addAll(p.getPermissions());
addPpb.getGroups().addAll(p.getGroups()); subPpb.getPermissions().removeAll(p.getPermissions());
subPpb.getGroups().removeAll(p.getGroups()); addPpb.getGroups().addAll(p.getGroups());
subPpb.getGroups().removeAll(p.getGroups());
}
} }
subPpb.clearPlayer(player, plugin.getServer(), plugin.getPermission()); subPpb.clearPlayer(player, plugin.getServer(), plugin.getPermission());
addPpb.givePlayer(player, plugin.getServer(), plugin.getPermission()); addPpb.givePlayer(player, plugin.getServer(), plugin.getPermission());