remove ability to download unverified expansions

This commit is contained in:
PiggyPiglet 2023-10-28 21:42:18 +08:00
parent d35a499e31
commit c7a4900aa3
No known key found for this signature in database
GPG Key ID: A72C64D3A21D0C06
4 changed files with 2 additions and 16 deletions

View File

@ -24,7 +24,7 @@ repositories {
dependencies { dependencies {
implementation("org.bstats:bstats-bukkit:3.0.1") 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") compileOnly("org.spigotmc:spigot-api:1.20-R0.1-SNAPSHOT")
compileOnlyApi("org.jetbrains:annotations:23.0.0") compileOnlyApi("org.jetbrains:annotations:23.0.0")

View File

@ -48,15 +48,6 @@ public final class CommandECloudDownload extends PlaceholderCommand {
.anyMatch(s -> s.equalsIgnoreCase(name)); .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 @Override
public void evaluate(@NotNull final PlaceholderAPIPlugin plugin, public void evaluate(@NotNull final PlaceholderAPIPlugin plugin,
@NotNull final CommandSender sender, @NotNull final String alias, @NotNull final CommandSender sender, @NotNull final String alias,
@ -81,7 +72,7 @@ public final class CommandECloudDownload extends PlaceholderCommand {
return; 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"); 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; return;
} }

View File

@ -38,10 +38,6 @@ public final class PlaceholderAPIConfig {
return plugin.getConfig().getBoolean("check_updates"); return plugin.getConfig().getBoolean("check_updates");
} }
public boolean cloudAllowUnverifiedExpansions() {
return plugin.getConfig().getBoolean("cloud_allow_unverified_expansions");
}
public boolean isCloudEnabled() { public boolean isCloudEnabled() {
return plugin.getConfig().getBoolean("cloud_enabled"); return plugin.getConfig().getBoolean("cloud_enabled");

View File

@ -11,7 +11,6 @@
check_updates: true check_updates: true
cloud_enabled: true cloud_enabled: true
cloud_sorting: "name" cloud_sorting: "name"
cloud_allow_unverified_expansions: false
boolean: boolean:
'true': 'yes' 'true': 'yes'
'false': 'no' 'false': 'no'