From b5878783ad27ea17421faee92bb9a43b3ef8ef37 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sun, 6 Aug 2017 09:07:24 +1000 Subject: SPIGOT-3491: Add option to bypass permissions in advancements --- src/main/java/org/bukkit/craftbukkit/CraftServer.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/main/java') 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 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); } -- cgit v1.2.3