diff --git a/pom.xml b/pom.xml index 9fd4cd8..7d20e67 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ org.spigotmc plugin-annotations - 1.2.3-SNAPSHOT + 1.3-SNAPSHOT jar Plugin Annotations diff --git a/src/main/java/org/bukkit/plugin/java/annotation/PluginAnnotationProcessor.java b/src/main/java/org/bukkit/plugin/java/annotation/PluginAnnotationProcessor.java index 4d65024..67081e6 100644 --- a/src/main/java/org/bukkit/plugin/java/annotation/PluginAnnotationProcessor.java +++ b/src/main/java/org/bukkit/plugin/java/annotation/PluginAnnotationProcessor.java @@ -233,8 +233,8 @@ public class PluginAnnotationProcessor extends AbstractProcessor { // api-version if ( mainPluginType.getAnnotation( ApiVersion.class ) != null ) { ApiVersion apiVersion = mainPluginType.getAnnotation( ApiVersion.class ); - if ( apiVersion.value() != ApiVersion.Target.DEFAULT ) { - yml.put( "api-version", apiVersion.value().getVersion() ); + if ( apiVersion.value() != null ) { + yml.put( "api-version", apiVersion.value() ); } } diff --git a/src/main/java/org/bukkit/plugin/java/annotation/plugin/ApiVersion.java b/src/main/java/org/bukkit/plugin/java/annotation/plugin/ApiVersion.java index 6e368f9..31a9e9a 100644 --- a/src/main/java/org/bukkit/plugin/java/annotation/plugin/ApiVersion.java +++ b/src/main/java/org/bukkit/plugin/java/annotation/plugin/ApiVersion.java @@ -9,76 +9,17 @@ import java.lang.annotation.Target; /** * This annotation specifies the api version of the plugin. *
- * Defaults to {@link ApiVersion.Target#DEFAULT}. - *
* Pre-1.13 plugins do not need to use this annotation. + *
+ * 1.13, 1.14, 1.15, 1.16, 1.17, 1.18, 1.19 and 1.20 are the available versions. + *
+ * This doesn't include the minor version until 1.20.5. From 1.20.5 and onward, + * a minor version is supported. */ @Documented @Retention(RetentionPolicy.RUNTIME) @Target( ElementType.TYPE ) public @interface ApiVersion { - Target value() default Target.DEFAULT; - - /** - * Specifies the target api-version for this plugin. - * - * All pre-1.13 plugins must use {@link #DEFAULT}. - */ - public static enum Target { - /** - * This target version specifies that the plugin was made for pre-1.13 Spigot versions. - */ - DEFAULT( null ), - - /** - * This target version specifies that the plugin was made with 1.13+ versions in mind. - */ - v1_13( "1.13" ), - - /** - * This target version specifies that the plugin was made with 1.14+ versions in mind. - */ - v1_14( "1.14" ), - - /** - * This target version specifies that the plugin was made with 1.15+ versions in mind. - */ - v1_15( "1.15" ), - - /** - * This target version specifies that the plugin was made with 1.16+ versions in mind. - */ - v1_16("1.16"), - - /** - * This target version specifies that the plugin was made with 1.17+ versions in mind. - */ - v1_17("1.17"), - - /** - * This target version specifies that the plugin was made with 1.18+ versions in mind. - */ - v1_18("1.18"), - - /** - * This target version specifies that the plugin was made with 1.19+ versions in mind. - */ - v1_19("1.19"), - - /** - * This target version specifies that the plugin was made with 1.20+ versions in mind. - */ - v1_20("1.20"); - - private final String version; - - private Target(String version) { - this.version = version; - } - - public String getVersion() { - return version; - } - } + String value(); }