diff --git a/pom.xml b/pom.xml index 2c5db5b..14898dd 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 gg.frog.mc permissionstime - 0.1.0-SNAPSHOT + 0.1.1-TEST jar PermissionsTime 支持跨服的权限限时插件 diff --git a/src/main/gg/frog/mc/permissionstime/model/cfg/PermissionPackageBean.java b/src/main/gg/frog/mc/permissionstime/model/cfg/PermissionPackageBean.java index 0504557..e431711 100644 --- a/src/main/gg/frog/mc/permissionstime/model/cfg/PermissionPackageBean.java +++ b/src/main/gg/frog/mc/permissionstime/model/cfg/PermissionPackageBean.java @@ -219,8 +219,13 @@ public class PermissionPackageBean implements IConfigBean { subPpb.getGroups().removeAll(p.getGroups()); } } - subPpb.clearPlayer(player, plugin.getServer(), plugin.getPermission()); - addPpb.givePlayer(player, plugin.getServer(), plugin.getPermission()); + plugin.getServer().getScheduler().runTask(plugin, new Runnable() { + @Override + public void run() { + subPpb.clearPlayer(player, plugin.getServer(), plugin.getPermission()); + addPpb.givePlayer(player, plugin.getServer(), plugin.getPermission()); + } + }); BukkitTask task = taskMap.get(player.getUniqueId().toString()); if (task != null) { plugin.getServer().getScheduler().cancelTask(task.getTaskId()); @@ -242,7 +247,12 @@ public class PermissionPackageBean implements IConfigBean { PermissionPackageBean subPpb = new PermissionPackageBean(); subPpb.getPermissions().addAll(PackagesCfg.allPermissions); subPpb.getGroups().addAll(PackagesCfg.allGroups); - subPpb.clearPlayer(player, plugin.getServer(), plugin.getPermission()); + plugin.getServer().getScheduler().runTask(plugin, new Runnable() { + @Override + public void run() { + subPpb.clearPlayer(player, plugin.getServer(), plugin.getPermission()); + } + }); BukkitTask task = taskMap.get(player.getUniqueId().toString()); if (task != null) { plugin.getServer().getScheduler().cancelTask(task.getTaskId());