From c7a4900aa316dc1a7ee94772e8894d15e2520264 Mon Sep 17 00:00:00 2001 From: PiggyPiglet Date: Sat, 28 Oct 2023 21:42:18 +0800 Subject: [PATCH] remove ability to download unverified expansions --- build.gradle.kts | 2 +- .../commands/impl/cloud/CommandECloudDownload.java | 11 +---------- .../configuration/PlaceholderAPIConfig.java | 4 ---- src/main/resources/config.yml | 1 - 4 files changed, 2 insertions(+), 16 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 159dd02..68d7ae5 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -24,7 +24,7 @@ repositories { dependencies { implementation("org.bstats:bstats-bukkit:3.0.1") - implementation("net.kyori:adventure-platform-bukkit:4.3.0") + implementation("net.kyori:adventure-platform-bukkit:4.3.1") compileOnly("org.spigotmc:spigot-api:1.20-R0.1-SNAPSHOT") compileOnlyApi("org.jetbrains:annotations:23.0.0") 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 c34bf89..7e30cdc 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,15 +48,6 @@ 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) { - return env.equalsIgnoreCase("true"); - } - - return plugin.getPlaceholderAPIConfig().cloudAllowUnverifiedExpansions(); - } - @Override public void evaluate(@NotNull final PlaceholderAPIPlugin plugin, @NotNull final CommandSender sender, @NotNull final String alias, @@ -81,7 +72,7 @@ public final class CommandECloudDownload extends PlaceholderCommand { return; } - if (!expansion.isVerified() && !this.areUnverifiedExpansionsAllowed(plugin)) { + if (!expansion.isVerified()) { 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; } diff --git a/src/main/java/me/clip/placeholderapi/configuration/PlaceholderAPIConfig.java b/src/main/java/me/clip/placeholderapi/configuration/PlaceholderAPIConfig.java index e10733e..1b355dc 100644 --- a/src/main/java/me/clip/placeholderapi/configuration/PlaceholderAPIConfig.java +++ b/src/main/java/me/clip/placeholderapi/configuration/PlaceholderAPIConfig.java @@ -38,10 +38,6 @@ public final class PlaceholderAPIConfig { return plugin.getConfig().getBoolean("check_updates"); } - public boolean cloudAllowUnverifiedExpansions() { - return plugin.getConfig().getBoolean("cloud_allow_unverified_expansions"); - } - public boolean isCloudEnabled() { return plugin.getConfig().getBoolean("cloud_enabled"); diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 6fa0861..5d1b8f2 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -11,7 +11,6 @@ check_updates: true cloud_enabled: true cloud_sorting: "name" -cloud_allow_unverified_expansions: false boolean: 'true': 'yes' 'false': 'no'