diff --git a/src/main/kotlin/com/demonwav/mcdev/platform/bukkit/BukkitTemplate.kt b/src/main/kotlin/com/demonwav/mcdev/platform/bukkit/BukkitTemplate.kt index 12cd8fbd2..d40bc8f7b 100644 --- a/src/main/kotlin/com/demonwav/mcdev/platform/bukkit/BukkitTemplate.kt +++ b/src/main/kotlin/com/demonwav/mcdev/platform/bukkit/BukkitTemplate.kt @@ -101,6 +101,14 @@ object BukkitTemplate { properties.setProperty("HAS_WEBSITE", "true") } + // Plugins targeting 1.13 or newer need an explicit api declaration flag + // Unfortunately this flag has no contract to match any specific API version + val mcVer = settings.minecraftVersion.substring(0, 4).toDoubleOrNull() + if (mcVer != null && mcVer >= 1.13) { + properties.setProperty("API_VERSION", "1.13") + properties.setProperty("HAS_API_VERSION", "true") + } + BaseTemplate.applyTemplate(project, file, MinecraftFileTemplateGroupFactory.BUKKIT_PLUGIN_YML_TEMPLATE, properties, true) } } diff --git a/src/main/resources/fileTemplates/j2ee/bukkit_plugin_description_file.yml.ft b/src/main/resources/fileTemplates/j2ee/bukkit_plugin_description_file.yml.ft index 1db7ea2e8..fcbb600a9 100644 --- a/src/main/resources/fileTemplates/j2ee/bukkit_plugin_description_file.yml.ft +++ b/src/main/resources/fileTemplates/j2ee/bukkit_plugin_description_file.yml.ft @@ -1,6 +1,9 @@ name: ${NAME} version: ${VERSION} main: ${MAIN} +#if (${HAS_API_VERSION}) +api-version: ${API_VERSION} +#end #if (${HAS_PREFIX}) prefix: ${PREFIX} #end