mirror of
https://github.com/PlaceholderAPI/PlaceholderAPI.git
synced 2024-12-25 18:37:42 +01:00
remove ability to download unverified expansions
This commit is contained in:
parent
d35a499e31
commit
c7a4900aa3
@ -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")
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
@ -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");
|
||||||
|
@ -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'
|
||||||
|
Loading…
Reference in New Issue
Block a user