mirror of
https://github.com/PlaceholderAPI/PlaceholderAPI
synced 2024-11-18 00:46:55 +01:00
remove ability to download unverified expansions
This commit is contained in:
parent
d35a499e31
commit
c7a4900aa3
@ -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")
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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");
|
||||
|
@ -11,7 +11,6 @@
|
||||
check_updates: true
|
||||
cloud_enabled: true
|
||||
cloud_sorting: "name"
|
||||
cloud_allow_unverified_expansions: false
|
||||
boolean:
|
||||
'true': 'yes'
|
||||
'false': 'no'
|
||||
|
Loading…
Reference in New Issue
Block a user