From 4335c6cbf81eb6384cc453bfc23c586599d3223b Mon Sep 17 00:00:00 2001 From: GeekFrog Date: Mon, 17 Jul 2017 09:19:03 +0800 Subject: [PATCH] =?UTF-8?q?vault=E5=A4=84=E7=90=86=E6=9D=83=E9=99=90?= =?UTF-8?q?=E4=B8=8D=E6=94=AF=E6=8C=81=E5=BC=82=E6=AD=A5=3F!=20=E9=82=A3?= =?UTF-8?q?=E5=B0=B1=E6=94=B9=E6=88=90=E5=90=8C=E6=AD=A5=E8=AF=95=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../model/cfg/PermissionPackageBean.java | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) 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());