diff --git a/src/main/java/me/clip/placeholderapi/commands/impl/cloud/CommandECloudDownload.java b/src/main/java/me/clip/placeholderapi/commands/impl/cloud/CommandECloudDownload.java index 060d56c..2df77fb 100644 --- a/src/main/java/me/clip/placeholderapi/commands/impl/cloud/CommandECloudDownload.java +++ b/src/main/java/me/clip/placeholderapi/commands/impl/cloud/CommandECloudDownload.java @@ -48,6 +48,24 @@ public final class CommandECloudDownload extends PlaceholderCommand { .anyMatch(s -> s.equalsIgnoreCase(name)); } + private boolean areUnverifiedExpansionsAllowed(@NotNull final PlaceholderAPIPlugin plugin) { + String env = System.getenv("PAPI_ALLOW_UNVERIFIED_EXPANSIONS"); + if (env != null) { + switch (env.toLowerCase()) { + case "true": + case "yes": + case "1": + return true; + case "false": + case "no": + case "0": + return false; + } + } + + return plugin.getPlaceholderAPIConfig().cloudAllowUnverifiedExpansions(); + } + @Override public void evaluate(@NotNull final PlaceholderAPIPlugin plugin, @NotNull final CommandSender sender, @NotNull final String alias, @@ -72,7 +90,7 @@ public final class CommandECloudDownload extends PlaceholderCommand { return; } - if (!expansion.isVerified() && !plugin.getPlaceholderAPIConfig().cloudAllowUnverifiedExpansions()) { + if (!expansion.isVerified() && !this.areUnverifiedExpansionsAllowed(plugin)) { Msg.msg(sender, "&cThe expansion '&f" + params.get(0) + "&c' is not verified and can only be downloaded manually from &fhttps://placeholderapi.com/ecloud"); return; }