Skip to content

Commit

Permalink
fix permission manage bug
Browse files Browse the repository at this point in the history
  • Loading branch information
KunoSayo committed Oct 24, 2018
1 parent 8489eba commit 9ba3d3a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=NewHonor
group=com.github.euonmyoji.newhonor
spongeVersion=2.4.1
spongeVersion=2.4.2
bukkitVersion=0.1.0
spongeapi=7.1.0
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ default void checkPermission() {
try {
List<String> ownedHonors = getOwnHonors().orElseGet(ArrayList::new);
//如果移除没权限的头衔
if (PluginConfig.cfg.getNode(PluginConfig.PERMISSION_MANAGE).getBoolean() && !player.hasPermission(checkPrefix + id)) {
if (PluginConfig.permissionManageHonors() && !player.hasPermission(checkPrefix + id)) {
if (takeHonor(id)) {
Log.info(String.format("[Cause:permission not pass]Player %s lost honor: %s", player.getName(), id));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,11 @@ public static int getIntervalTicks() {
return cfg.getNode("extra", INTERVAL_TICKS).getInt(8);
}


public static boolean permissionManageHonors() {
return generalNode.getNode(PERMISSION_MANAGE).getBoolean(false);
}

private static void loadNode() {
try {
cfg = loader.load(ConfigurationOptions.defaults().setShouldCopyDefaults(true));
Expand Down

0 comments on commit 9ba3d3a

Please sign in to comment.