mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2025-01-08 09:27:38 +01:00
Merge branch 'develop' of https://github.com/BentoBoxWorld/BentoBox.git into develop
This commit is contained in:
commit
69b40ee141
@ -17,6 +17,7 @@ import org.bukkit.plugin.InvalidDescriptionException;
|
||||
import org.eclipse.jdt.annotation.NonNull;
|
||||
import org.eclipse.jdt.annotation.Nullable;
|
||||
|
||||
import world.bentobox.bentobox.BentoBox;
|
||||
import world.bentobox.bentobox.api.addons.exceptions.InvalidAddonDescriptionException;
|
||||
import world.bentobox.bentobox.api.addons.exceptions.InvalidAddonFormatException;
|
||||
import world.bentobox.bentobox.api.addons.exceptions.InvalidAddonInheritException;
|
||||
@ -95,9 +96,12 @@ public class AddonClassLoader extends URLClassLoader {
|
||||
|
||||
String apiVersion = data.getString("api-version");
|
||||
if (apiVersion != null) {
|
||||
if (!apiVersion.matches("^(\\d+\\.)?(\\d+\\.)?(\\*|\\d+)$")) {
|
||||
if (!apiVersion.replace("-SNAPSHOT", "").matches("^(\\d+\\.)?(\\d+\\.)?(\\*|\\d+)$")) {
|
||||
throw new InvalidAddonDescriptionException("Provided API version '" + apiVersion + "' is not valid. It must only contain digits and dots and not end with a dot.");
|
||||
}
|
||||
if (apiVersion.contains("-SNAPSHOT")) {
|
||||
BentoBox.getInstance().logWarning(data.getString("name") + " addon depends on development version of BentoBox plugin. Some functions may be not implemented.");
|
||||
}
|
||||
builder.apiVersion(apiVersion);
|
||||
}
|
||||
// Set permissions
|
||||
@ -162,5 +166,4 @@ public class AddonClassLoader extends URLClassLoader {
|
||||
public Set<String> getClasses() {
|
||||
return classes.keySet();
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user