diff options
author | md_5 <git@md-5.net> | 2017-08-06 09:07:24 +1000 |
---|---|---|
committer | md_5 <git@md-5.net> | 2017-08-06 09:07:24 +1000 |
commit | b5878783ad27ea17421faee92bb9a43b3ef8ef37 (patch) | |
tree | cb60f6c7889311b8b569378fd2419ff8f7460222 /src/main | |
parent | 571760182fb8c5326de812259ddef80564953a1d (diff) | |
download | craftbukkit-b5878783ad27ea17421faee92bb9a43b3ef8ef37.tar craftbukkit-b5878783ad27ea17421faee92bb9a43b3ef8ef37.tar.gz craftbukkit-b5878783ad27ea17421faee92bb9a43b3ef8ef37.tar.lz craftbukkit-b5878783ad27ea17421faee92bb9a43b3ef8ef37.tar.xz craftbukkit-b5878783ad27ea17421faee92bb9a43b3ef8ef37.zip |
SPIGOT-3491: Add option to bypass permissions in advancements
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/CraftServer.java | 6 | ||||
-rw-r--r-- | src/main/resources/configurations/commands.yml | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java index 0a5a11d8..1564dd71 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -169,6 +169,7 @@ public final class CraftServer implements Server { private boolean printSaveWarning; private CraftIconCache icon; private boolean overrideAllCommandBlockCommands = false; + private boolean unrestrictedAdvancements; private final Pattern validUserPattern = Pattern.compile("^[a-zA-Z0-9_]{2,16}$"); private final UUID invalidUserUUID = UUID.nameUUIDFromBytes("InvalidUsername".getBytes(Charsets.UTF_8)); private final List<CraftPlayer> playerView; @@ -247,6 +248,7 @@ public final class CraftServer implements Server { saveCommandsConfig(); overrideAllCommandBlockCommands = commandsConfiguration.getStringList("command-block-overrides").contains("*"); + unrestrictedAdvancements = commandsConfiguration.getBoolean("unrestricted-advancements"); pluginManager.useTimings(configuration.getBoolean("settings.plugin-profiling")); monsterSpawn = configuration.getInt("spawn-limits.monsters"); animalSpawn = configuration.getInt("spawn-limits.animals"); @@ -259,6 +261,10 @@ public final class CraftServer implements Server { loadIcon(); } + public boolean getPermissionOverride(ICommandListener listener) { + return unrestrictedAdvancements && listener instanceof AdvancementRewards.AdvancementCommandListener; + } + public boolean getCommandBlockOverride(String command) { return overrideAllCommandBlockCommands || commandsConfiguration.getStringList("command-block-overrides").contains(command); } diff --git a/src/main/resources/configurations/commands.yml b/src/main/resources/configurations/commands.yml index 733307c2..0491a8bb 100644 --- a/src/main/resources/configurations/commands.yml +++ b/src/main/resources/configurations/commands.yml @@ -11,6 +11,7 @@ # Bug tracker: http://www.spigotmc.org/go/bugs command-block-overrides: [] +unrestricted-advancements: false aliases: icanhasbukkit: - "version $1-" |