diff --git a/.gitattributes.ft b/.gitattributes.ft new file mode 100644 index 0000000..a87d264 --- /dev/null +++ b/.gitattributes.ft @@ -0,0 +1,11 @@ +# +# https://help.github.com/articles/dealing-with-line-endings/ +# +# Linux start script should use lf +/gradlew text eol=lf + +# These are Windows script files and should use crlf +*.bat text eol=crlf + +# Binary files should be left untouched +*.jar binary diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..485dee6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea diff --git a/Gradle.gitignore.ft b/Gradle.gitignore.ft index 2f20d0d..9e4b940 100644 --- a/Gradle.gitignore.ft +++ b/Gradle.gitignore.ft @@ -1,124 +1,21 @@ -# User-specific stuff -.idea/ +# MacOS DS_Store files +.DS_Store -*.iml -*.ipr -*.iws +# Gradle cache folder +.gradle + +# Gradle build folder +build # IntelliJ out/ +.idea +*.iml # mpeltonen/sbt-idea plugin .idea_modules/ -# JIRA plugin -atlassian-ide-plugin.xml - -# Compiled class file -*.class - -# Log file -*.log - -# BlueJ files -*.ctxt - -# Package Files # -*.jar -*.war -*.nar -*.ear -*.zip -*.tar.gz -*.rar - # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml hs_err_pid* -### Linux ### -*~ - -# temporary files which can be created if a process still has a handle open of a deleted file -.fuse_hidden* - -# KDE directory preferences -.directory - -# Linux trash folder which might appear on any partition or disk -.Trash-* - -# .nfs files are created when an open file is removed but is still being accessed -.nfs* - -### macOS ### -# General -.DS_Store -.AppleDouble -.LSOverride - -# Icon must end with two \r -Icon - -# Thumbnails -._* - -# Files that might appear in the root of a volume -.DocumentRevisions-V100 -.fseventsd -.Spotlight-V100 -.TemporaryItems -.Trashes -.VolumeIcon.icns -.com.apple.timemachine.donotpresent - -# Directories potentially created on remote AFP share -.AppleDB -.AppleDesktop -Network Trash Folder -Temporary Items -.apdisk - -### Windows ### -# Windows thumbnail cache files -Thumbs.db -Thumbs.db:encryptable -ehthumbs.db -ehthumbs_vista.db - -# Dump file -*.stackdump - -# Folder config file -[Dd]esktop.ini - -# Recycle Bin used on file shares -$RECYCLE.BIN/ - -# Windows Installer files -*.cab -*.msi -*.msix -*.msm -*.msp - -# Windows shortcuts -*.lnk - -### Gradle ### -.gradle -build/ - -# Ignore Gradle GUI config -gradle-app.setting - -# Cache of project -.gradletasknamecache - -### Gradle Patch ### -**/build/ - # Common working directory -run/ -runs/ - -# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) -!gradle-wrapper.jar +run diff --git a/architectury/.mcdev.template.json b/architectury/.mcdev.template.json index daf093c..9f649a8 100644 --- a/architectury/.mcdev.template.json +++ b/architectury/.mcdev.template.json @@ -1,5 +1,5 @@ { - "version": 1, + "version": 2, "group": "mod", "properties": [ { diff --git a/bukkit/BootstrapClass.java.ft b/bukkit/BootstrapClass.java.ft new file mode 100644 index 0000000..42f786d --- /dev/null +++ b/bukkit/BootstrapClass.java.ft @@ -0,0 +1,12 @@ +package ${MAIN_CLASS.packageName}; + +import io.papermc.paper.plugin.bootstrap.BootstrapContext; +import io.papermc.paper.plugin.bootstrap.PluginBootstrap; + +class ${MAIN_CLASS.className}Bootstrap implements PluginBootstrap { + + @Override + public void bootstrap(final BootstrapContext context) { + // Plugin bootstrap logic + } +} diff --git a/bukkit/BootstrapClass.kt.ft b/bukkit/BootstrapClass.kt.ft new file mode 100644 index 0000000..977cc31 --- /dev/null +++ b/bukkit/BootstrapClass.kt.ft @@ -0,0 +1,11 @@ +package ${MAIN_CLASS.packageName} + +import io.papermc.paper.plugin.bootstrap.BootstrapContext +import io.papermc.paper.plugin.bootstrap.PluginBootstrap + +internal class ${MAIN_CLASS.className}Bootstrap : PluginBootstrap { + + override fun bootstrap(context: BootstrapContext) { + // Plugin bootstrap logic + } +} diff --git a/bukkit/LoaderClass.java.ft b/bukkit/LoaderClass.java.ft new file mode 100644 index 0000000..c805acd --- /dev/null +++ b/bukkit/LoaderClass.java.ft @@ -0,0 +1,12 @@ +package ${MAIN_CLASS.packageName}; + +import io.papermc.paper.plugin.loader.PluginClasspathBuilder; +import io.papermc.paper.plugin.loader.PluginLoader; + +class ${MAIN_CLASS.className}Loader implements PluginLoader { + + @Override + public void classloader(final PluginClasspathBuilder builder) { + // Add dynamically loaded libraries here + } +} diff --git a/bukkit/LoaderClass.kt.ft b/bukkit/LoaderClass.kt.ft new file mode 100644 index 0000000..f961d61 --- /dev/null +++ b/bukkit/LoaderClass.kt.ft @@ -0,0 +1,11 @@ +package ${MAIN_CLASS.packageName} + +import io.papermc.paper.plugin.loader.PluginClasspathBuilder +import io.papermc.paper.plugin.loader.PluginLoader + +internal class ${MAIN_CLASS.className}Loader : PluginLoader { + + override fun classloader(builder: PluginClasspathBuilder) { + // Add dynamically loaded libraries here + } +} diff --git a/bukkit/MainClass.java.ft b/bukkit/MainClass.java.ft index 6df4793..20c4312 100644 --- a/bukkit/MainClass.java.ft +++ b/bukkit/MainClass.java.ft @@ -7,7 +7,6 @@ public final class ${MAIN_CLASS.className} extends JavaPlugin { @Override public void onEnable() { // Plugin startup logic - } @Override diff --git a/bukkit/build.gradle.ft b/bukkit/build.gradle.ft deleted file mode 100644 index 712895f..0000000 --- a/bukkit/build.gradle.ft +++ /dev/null @@ -1,71 +0,0 @@ -plugins { - id 'java' - id("xyz.jpenilla.run-paper") version "2.3.1" -} - -group = '${BUILD_COORDS.groupId}' -version = '${BUILD_COORDS.version}' - -repositories { - mavenCentral() -#if ($IS_SPIGOT) - maven { - name = "spigotmc-repo" - url = "https://hub.spigotmc.org/nexus/content/repositories/snapshots/" - } -#elseif ($IS_PAPER) - maven { - name = "papermc-repo" - url = "https://repo.papermc.io/repository/maven-public/" - } -#end -} - -dependencies { -#if ($IS_SPIGOT) - compileOnly("org.spigotmc:spigot-api:${MC_VERSION}-R0.1-SNAPSHOT") -#elseif ($IS_PAPER) - compileOnly("io.papermc.paper:paper-api:${MC_VERSION}-R0.1-SNAPSHOT") -#end -} - -tasks { - runServer { - // Configure the Minecraft version for our task. - // This is the only required configuration besides applying the plugin. - // Your plugin's jar (or shadowJar if present) will be used automatically. - minecraftVersion("${API_VERSION}") - } -} - -def targetJavaVersion = ${JAVA_VERSION} -java { - def javaVersion = JavaVersion.toVersion(targetJavaVersion) - sourceCompatibility = javaVersion - targetCompatibility = javaVersion - if (JavaVersion.current() < javaVersion) { - toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion) - } -} - -tasks.withType(JavaCompile).configureEach { - options.encoding = 'UTF-8' - - if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) { - options.release.set(targetJavaVersion) - } -} - -#if ($USE_PAPER_MANIFEST) - #set($MANIFEST_NAME = 'paper-plugin.yml') -#else - #set($MANIFEST_NAME = 'plugin.yml') -#end -processResources { - def props = [version: version] - inputs.properties props - filteringCharset 'UTF-8' - filesMatching('${MANIFEST_NAME}') { - expand props - } -} diff --git a/bukkit/build.gradle.kts.ft b/bukkit/build.gradle.kts.ft index 039e76a..a0447ce 100644 --- a/bukkit/build.gradle.kts.ft +++ b/bukkit/build.gradle.kts.ft @@ -1,62 +1,188 @@ +#if ($USE_RESOURCE_FACTORY_PLUGIN && $LOAD_AT) +import xyz.jpenilla.resourcefactory.bukkit.BukkitPluginYaml + +#end plugins { +#if ($LANGUAGE=='Java') + id("java-library") +#else kotlin("jvm") version "${KOTLIN_VERSION}" - id("com.gradleup.shadow") version "8.3.0" - id("xyz.jpenilla.run-paper") version "2.3.1" +#end +#if ($USE_VERSION_CATALOG) +#if ($USE_PAPERWEIGHT_USERDEV) + alias(libs.plugin.paperweight.userdev) +#end +#if ($USE_GREMLIN || $INCLUDE_SHADOW_PLUGIN) + alias(libs.plugins.shadow) +#end +#if ($INCLUDE_RUN_PAPER_PLUGIN) + alias(libs.plugins.run.paper) +#end +#if ($USE_RESOURCE_FACTORY_PLUGIN && $USE_PAPER_MANIFEST) + alias(libs.plugins.resource.factory.paper) +#elseif ($USE_RESOURCE_FACTORY_PLUGIN && !$USE_PAPER_MANIFEST) + alias(libs.plugins.resource.factory.bukkit) +#end +#if ($USE_GREMLIN) + alias(libs.plugins.gremlin.gradle) +#end +#else +#if ($USE_PAPERWEIGHT_USERDEV) + id("io.papermc.paperweight.userdev") version "2.0.0-beta.19" +#end +#if ($INCLUDE_SHADOW_PLUGIN) + id("com.gradleup.shadow") version "9.3.1" +#end +#if ($INCLUDE_RUN_PAPER_PLUGIN) + id("xyz.jpenilla.run-paper") version "3.0.2" +#end +#if ($USE_RESOURCE_FACTORY_PLUGIN && $USE_PAPER_MANIFEST) + id("xyz.jpenilla.resource-factory-paper-convention") version "1.3.1" +#elseif ($USE_RESOURCE_FACTORY_PLUGIN && !$USE_PAPER_MANIFEST) + id("xyz.jpenilla.resource-factory-bukkit-convention") version "1.3.1" +#end +#if ($USE_GREMLIN) + id("xyz.jpenilla.gremlin-gradle") version "0.0.9" +#end +#end } -group = "${BUILD_COORDS.groupId}" -version = "${BUILD_COORDS.version}" - repositories { mavenCentral() #if ($IS_SPIGOT) - maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/") { - name = "spigotmc-repo" - } -#elseif ($IS_PAPER) - maven("https://repo.papermc.io/repository/maven-public/") { - name = "papermc-repo" - } + maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/") +#elseif ($IS_PAPER && !$USE_PAPERWEIGHT_USERDEV) + maven("https://repo.papermc.io/repository/maven-public/") #end } +#if ($USE_GREMLIN) + +configurations.compileOnly { + extendsFrom(configurations.runtimeDownload.get()) +} +#end dependencies { -#if ($IS_SPIGOT) +#if ($IS_SPIGOT && !$USE_VERSION_CATALOG) compileOnly("org.spigotmc:spigot-api:${MC_VERSION}-R0.1-SNAPSHOT") -#elseif ($IS_PAPER) +#elseif ($IS_SPIGOT && $USE_VERSION_CATALOG) + compileOnly(libs.spigot.api) +#elseif ($IS_PAPER && !$USE_PAPERWEIGHT_USERDEV && !$USE_VERSION_CATALOG) compileOnly("io.papermc.paper:paper-api:${MC_VERSION}-R0.1-SNAPSHOT") +#elseif ($IS_PAPER && !$USE_PAPERWEIGHT_USERDEV && $USE_VERSION_CATALOG) + compileOnly(libs.paper.api) +#elseif ($IS_PAPER && $USE_PAPERWEIGHT_USERDEV && !$USE_VERSION_CATALOG) + paperweight.paperDevBundle("${MC_VERSION}-R0.1-SNAPSHOT") +#elseif ($IS_PAPER && $USE_PAPERWEIGHT_USERDEV && $USE_VERSION_CATALOG) + paperweight.paperDevBundle(libs.versions.paper.api.get()) +#end +#if ($USE_GREMLIN && !$USE_VERSION_CATALOG) + implementation("xyz.jpenilla:gremlin-runtime:0.0.9") +#elseif ($USE_GREMLIN && $USE_VERSION_CATALOG) + implementation(libs.gremlin.runtime) #end +#if ($LANGUAGE=='Kotlin' && !$USE_VERSION_CATALOG && !$USE_GREMLIN) implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8") +#elseif ($LANGUAGE=='Kotlin' && $USE_VERSION_CATALOG && !$USE_GREMLIN) + implementation(libs.kotlin.stdlib) +#elseif ($LANGUAGE=='Kotlin' && !$USE_VERSION_CATALOG && $USE_GREMLIN) + runtimeDownload("org.jetbrains.kotlin:kotlin-stdlib-jdk8") +#elseif ($LANGUAGE=='Kotlin' && $USE_VERSION_CATALOG && $USE_GREMLIN) + runtimeDownload(libs.kotlin.stdlib) +#end } +#if ($USE_RESOURCE_FACTORY_PLUGIN) -tasks { - runServer { - // Configure the Minecraft version for our task. - // This is the only required configuration besides applying the plugin. - // Your plugin's jar (or shadowJar if present) will be used automatically. - minecraftVersion("${API_VERSION}") - } -} +#if ($USE_PAPER_MANIFEST) +paperPluginYaml { +#else +bukkitPluginYaml { +#end + name = project.name +#if ($DESCRIPTION) + description = "${DESCRIPTION}" +#end +#if ($LOG_PREFIX) + prefix = "${LOG_PREFIX}" +#end + version = project.version.toString() -val targetJavaVersion = ${JAVA_VERSION} -kotlin { - jvmToolchain(targetJavaVersion) + main = "${MAIN_CLASS}" +#if (${INCLUDE_PLUGIN_BOOTSTRAP}) + bootstrapper = "${MAIN_CLASS.packageName}.${MAIN_CLASS.className}Bootstrap" +#end +#if (${INCLUDE_PLUGIN_LOADER} && !${USE_GREMLIN} && !${USE_PAPER_MANIFEST}) + paperPluginLoader = "${MAIN_CLASS.packageName}.${MAIN_CLASS.className}Loader" +#elseif (${USE_GREMLIN} && !${USE_PAPER_MANIFEST}) + paperPluginLoader = "xyz.jpenilla.gremlin.runtime.platformsupport.DefaultsPaperPluginLoader" +#elseif (${INCLUDE_PLUGIN_LOADER} && !${USE_GREMLIN} && ${USE_PAPER_MANIFEST}) + loader = "${MAIN_CLASS.packageName}.${MAIN_CLASS.className}Loader" +#elseif (${USE_GREMLIN} && ${USE_PAPER_MANIFEST}) + loader = "xyz.jpenilla.gremlin.runtime.platformsupport.DefaultsPaperPluginLoader" +#end +#if ($API_VERSION) + apiVersion = "${API_VERSION}" +#end +#if ($LOAD_AT) + load = BukkitPluginYaml.PluginLoadOrder.${LOAD_AT.toUpperCase()} +#end +#if ($AUTHORS || $WEBSITE) + +#end +#if ($AUTHORS) + authors.addAll(${AUTHORS.toStringQuoted()}) +#end +#if ($WEBSITE) + website = "${WEBSITE}" +#end } +#end -tasks.build { - dependsOn("shadowJar") +#if ($LANGUAGE=='Java') +java { + toolchain.languageVersion = JavaLanguageVersion.of(${JAVA_VERSION}) +} +#else +kotlin { + jvmToolchain(${JAVA_VERSION}) } +#end +#if ($USE_GREMLIN || $INCLUDE_SHADOW_PLUGIN || $INCLUDE_RUN_PAPER_PLUGIN || $!USE_RESOURCE_FACTORY_PLUGIN) +tasks { +#if ($USE_GREMLIN || $INCLUDE_SHADOW_PLUGIN) + build { + dependsOn(shadowJar) + } +#end +#if ($INCLUDE_RUN_PAPER_PLUGIN) + runServer { +#if ($USE_VERSION_CATALOG) + minecraftVersion(libs.versions.minecraft.get()) +#else + // Configure the Minecraft version for our task. + // This is the only required configuration besides applying the plugin. + // Your plugin's jar (or shadowJar if present) will be used automatically. + minecraftVersion("${MC_VERSION}") +#end +#if ($ACCEPT_EULA) + jvmArgs("-Xms2G", "-Xmx2G", "-Dcom.mojang.eula.agree=true") +#else + jvmArgs("-Xms2G", "-Xmx2G") +#end + } +#end +#if (!$USE_RESOURCE_FACTORY_PLUGIN) + processResources { + val props = mapOf("version" to version) #if ($USE_PAPER_MANIFEST) - #set($MANIFEST_NAME = "paper-plugin.yml") + filesMatching("paper-plugin.yml") { #else - #set($MANIFEST_NAME = "plugin.yml") -#end -tasks.processResources { - val props = mapOf("version" to version) - inputs.properties(props) - filteringCharset = "UTF-8" - filesMatching("${MANIFEST_NAME}") { - expand(props) + filesMatching("plugin.yml") { +#end + expand(props) + } } +#end } +#end \ No newline at end of file diff --git a/bukkit/gradle.properties.ft b/bukkit/gradle.properties.ft index e69de29..b6da00d 100644 --- a/bukkit/gradle.properties.ft +++ b/bukkit/gradle.properties.ft @@ -0,0 +1,6 @@ +group=${BUILD_COORDS.groupId} +version=${BUILD_COORDS.version} + +org.gradle.configuration-cache=true +org.gradle.parallel=true +org.gradle.caching=true diff --git a/bukkit/libs.versions.toml.ft b/bukkit/libs.versions.toml.ft new file mode 100644 index 0000000..eea3557 --- /dev/null +++ b/bukkit/libs.versions.toml.ft @@ -0,0 +1,57 @@ +[versions] +#if ($IS_PAPER) +paper-api = "${MC_VERSION}-R0.1-SNAPSHOT" +#elseif ($IS_SPIGOT) +spigot-api = "${MC_VERSION}-R0.1-SNAPSHOT" +#end +#if ($INCLUDE_RUN_PAPER_PLUGIN) +minecraft = ${MC_VERSION} +#end + +#if ($USE_PAPERWEIGHT_USERDEV) +paperweight-userdev = "2.0.0-beta.19" +#end +#if ($USE_GREMLIN || $INCLUDE_SHADOW_PLUGIN) +shadow = "9.3.1" +#end +#if ($INCLUDE_RUN_PAPER_PLUGIN) +run-task = "3.0.2" +#end +#if ($USE_RESOURCE_FACTORY_PLUGIN) +resource-factory = "1.3.1" +#end +#if ($USE_GREMLIN) +gremlin = "0.0.9" +#end + +[libraries] +#if ($IS_PAPER && !$USE_PAPERWEIGHT_USERDEV) +paper-api = { module = "io.papermc.paper:paper-api", version.ref = "paper-api" } +#elseif ($IS_SPIGOT) +spigot-api = { module = "org.spigotmc:spigot-api", version.ref = "spigot-api" } +#end +#if ($LANGUAGE=='Kotlin') +kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk8" } +#end +#if ($USE_GREMLIN) +gremlin-runtime = { module = "xyz.jpenilla:gremlin-runtime", version.ref = "gremlin" } +#end + +[plugins] +#if ($USE_PAPERWEIGHT_USERDEV) +paperweight-userdev = { id = "io.papermc.paperweight.userdev", version.ref = "paperweight-userdev" } +#end +#if ($USE_GREMLIN || $INCLUDE_SHADOW_PLUGIN) +shadow = { id = "com.gradleup.shadow", version.ref = "shadow" } +#end +#if ($INCLUDE_RUN_PAPER_PLUGIN) +run-paper = { id = "xyz.jpenilla.run-paper", version.ref = "run-task" } +#end +#if ($USE_RESOURCE_FACTORY_PLUGIN && $USE_PAPER_MANIFEST) +resource-factory-paper = { id = "xyz.jpenilla.resource-factory-paper-convention", version.ref = "resource-factory" } +#elseif ($USE_RESOURCE_FACTORY_PLUGIN && !$USE_PAPER_MANIFEST) +resource-factory-bukkit = { id = "xyz.jpenilla.resource-factory-bukkit-convention", version.ref = "resource-factory" } +#end +#if ($USE_GREMLIN) +gremlin-gradle = { id = "xyz.jpenilla.gremlin-gradle", version.ref = "gremlin" } +#end diff --git a/bukkit/paper-plugin.yml.ft b/bukkit/paper-plugin.yml.ft deleted file mode 100644 index bd31545..0000000 --- a/bukkit/paper-plugin.yml.ft +++ /dev/null @@ -1,21 +0,0 @@ -name: ${PLUGIN_NAME} -version: '${BUILD_COORDS.version}' -main: ${MAIN_CLASS} -#if (${API_VERSION}) -api-version: '${API_VERSION}' -#end -#if (${LOG_PREFIX}) -prefix: ${LOG_PREFIX} -#end -#if (${LOAD_AT}) -load: ${LOAD_AT} -#end -#if (${AUTHORS}) -authors: ${AUTHORS.toString(", ", "[", "]")} -#end -#if (${DESCRIPTION}) -description: ${DESCRIPTION} -#end -#if (${WEBSITE}) -website: ${WEBSITE} -#end diff --git a/bukkit/paper.mcdev.template.json b/bukkit/paper.mcdev.template.json index 5d9fbb4..8279386 100644 --- a/bukkit/paper.mcdev.template.json +++ b/bukkit/paper.mcdev.template.json @@ -1,5 +1,5 @@ { - "version": 1, + "version": 2, "group": "plugin", "properties": [ { @@ -23,32 +23,6 @@ "Kotlin" ] }, - { - "name": "MC_VERSION", - "type": "semantic_version", - "forceDropdown": true, - "options": [ - "1.21.11", - "1.21.10", - "1.21.9", - "1.21.8", - "1.21.7", - "1.21.6", - "1.21.5", - "1.21.4", - "1.21.3", - "1.21.1", - "1.21", - "1.20.6", - "1.20.4", - "1.20.3", - "1.20.2", - "1.20.1", - "1.19.4", - "1.18.2" - ], - "default": 0 - }, { "name": "KOTLIN_VERSION", "type": "maven_artifact_version", @@ -56,24 +30,27 @@ "sourceUrl": "https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-jdk8/maven-metadata.xml" }, "visible": { - "dependsOn": ["LANGUAGE"], + "dependsOn": [ + "LANGUAGE" + ], "condition": "$LANGUAGE == 'Kotlin'" } }, + { + "name": "MC_VERSION", + "type": "paper_versions", + "forceDropdown": true, + "default": 0 + }, { "name": "API_VERSION", "type": "semantic_version", - "options": [ - "1.21", - "1.20", - "1.19", - "1.18", - "1.17" - ], "visible": false, "derives": { - "parents": ["MC_VERSION"], - "method": "extractVersionMajorMinor" + "parents": [ + "MC_VERSION" + ], + "method": "extractPaperApiVersion" } }, { @@ -85,7 +62,10 @@ "name": "MAIN_CLASS", "type": "class_fqn", "derives": { - "parents": ["BUILD_COORDS", "PLUGIN_NAME"], + "parents": [ + "BUILD_COORDS", + "PLUGIN_NAME" + ], "method": "suggestClassName" } }, @@ -134,14 +114,135 @@ } ] }, + { + "label": "creator.ui.advanced_settings.label", + "collapsible": true, + "groupProperties": [ + { + "name": "USE_VERSION_CATALOG", + "type": "boolean", + "default": false, + "visible": { + "dependsOn": [ + "BUILD_SYSTEM" + ], + "condition": "$BUILD_SYSTEM == 'Gradle'" + } + }, + { + "name": "USE_GREMLIN", + "type": "boolean", + "default": false, + "visible": { + "dependsOn": [ + "BUILD_SYSTEM" + ], + "condition": "$BUILD_SYSTEM == 'Gradle'" + } + }, + { + "name": "INCLUDE_PLUGIN_BOOTSTRAP", + "type": "boolean", + "default": false, + "visible": { + "dependsOn": [ + "USE_PAPER_MANIFEST" + ], + "condition": "$USE_PAPER_MANIFEST" + } + }, + { + "name": "INCLUDE_PLUGIN_LOADER", + "type": "boolean", + "default": "$USE_GREMLIN", + "visible": { + "dependsOn": [ + "USE_GREMLIN" + ], + "condition": "!$USE_GREMLIN" + } + }, + { + "name": "JAVA_PLUGIN_LOADER", + "type": "boolean", + "default": true, + "visible": { + "dependsOn": [ + "USE_GREMLIN", + "LANGUAGE", + "INCLUDE_PLUGIN_LOADER" + ], + "condition": "!$USE_GREMLIN && $LANGUAGE=='Kotlin' && $INCLUDE_PLUGIN_LOADER" + } + }, + { + "name": "USE_RESOURCE_FACTORY_PLUGIN", + "type": "boolean", + "default": false, + "visible": { + "dependsOn": [ + "BUILD_SYSTEM" + ], + "condition": "$BUILD_SYSTEM == 'Gradle'" + } + }, + { + "name": "USE_PAPERWEIGHT_USERDEV", + "type": "boolean", + "default": false, + "visible": { + "dependsOn": [ + "BUILD_SYSTEM" + ], + "condition": "$BUILD_SYSTEM == 'Gradle'" + } + }, + { + "name": "INCLUDE_SHADOW_PLUGIN", + "type": "boolean", + "default": "$LANGUAGE=='Kotlin'", + "visible": { + "dependsOn": [ + "LANGUAGE", + "BUILD_SYSTEM" + ], + "condition": "$LANGUAGE == 'Java' && $BUILD_SYSTEM == 'Gradle'" + } + }, + { + "name": "INCLUDE_RUN_PAPER_PLUGIN", + "type": "boolean", + "default": true, + "visible": { + "dependsOn": [ + "BUILD_SYSTEM" + ], + "condition": "$BUILD_SYSTEM == 'Gradle'" + } + }, + { + "name": "ACCEPT_EULA", + "type": "boolean", + "default": false, + "visible": { + "dependsOn": [ + "INCLUDE_RUN_PAPER_PLUGIN", + "BUILD_SYSTEM" + ], + "condition": "$INCLUDE_RUN_PAPER_PLUGIN && $BUILD_SYSTEM == 'Gradle'" + } + } + ] + }, { "name": "JAVA_VERSION", "type": "integer", "order": 20, - "default": 17, "visible": false, "derives": { - "parents": ["MC_VERSION"], + "parents": [ + "MC_VERSION" + ], "method": "recommendJavaVersionForMcVersion", "default": 17 } @@ -166,35 +267,30 @@ "condition": "$USE_GIT" }, { - "template": "build.gradle.ft", - "destination": "build.gradle", - "condition": "$BUILD_SYSTEM=='Gradle' && $LANGUAGE=='Java'" - }, - { - "template": "settings.gradle.ft", - "destination": "settings.gradle", - "condition": "$BUILD_SYSTEM=='Gradle' && $LANGUAGE=='Java'" + "template": "../.gitattributes.ft", + "destination": ".gitattributes", + "condition": "$USE_GIT" }, { "template": "build.gradle.kts.ft", "destination": "build.gradle.kts", - "condition": "$BUILD_SYSTEM=='Gradle' && $LANGUAGE=='Kotlin'" + "condition": "$BUILD_SYSTEM=='Gradle'" + }, + { + "template": "libs.versions.toml.ft", + "destination": "gradle/libs.versions.toml", + "condition": "$BUILD_SYSTEM=='Gradle' && $USE_VERSION_CATALOG" }, { "template": "settings.gradle.kts.ft", "destination": "settings.gradle.kts", - "condition": "$BUILD_SYSTEM=='Gradle' && $LANGUAGE=='Kotlin'" + "condition": "$BUILD_SYSTEM=='Gradle'" }, { "template": "gradle.properties.ft", "destination": "gradle.properties", "condition": "$BUILD_SYSTEM=='Gradle'" }, - { - "template": "../gradle-wrapper.properties.ft", - "destination": "gradle/wrapper/gradle-wrapper.properties", - "condition": "$BUILD_SYSTEM=='Gradle'" - }, { "template": "pom.xml.ft", "destination": "pom.xml", @@ -203,12 +299,12 @@ { "template": "plugin.yml.ft", "destination": "src/main/resources/plugin.yml", - "condition": "!$USE_PAPER_MANIFEST" + "condition": "!$USE_PAPER_MANIFEST && !$USE_RESOURCE_FACTORY_PLUGIN" }, { - "template": "paper-plugin.yml.ft", + "template": "plugin.yml.ft", "destination": "src/main/resources/paper-plugin.yml", - "condition": "$USE_PAPER_MANIFEST" + "condition": "$USE_PAPER_MANIFEST && !$USE_RESOURCE_FACTORY_PLUGIN" }, { "template": "MainClass.java.ft", @@ -221,9 +317,36 @@ "destination": "src/main/kotlin/${MAIN_CLASS.path}.kt", "condition": "$LANGUAGE=='Kotlin'", "openInEditor": true + }, + { + "template": "BootstrapClass.java.ft", + "destination": "src/main/java/${MAIN_CLASS.packagePath}/${MAIN_CLASS.className}Bootstrap.java", + "condition": "$INCLUDE_PLUGIN_BOOTSTRAP && $LANGUAGE=='Java'" + }, + { + "template": "BootstrapClass.kt.ft", + "destination": "src/main/kotlin/${MAIN_CLASS.packagePath}/${MAIN_CLASS.className}Bootstrap.kt", + "condition": "$INCLUDE_PLUGIN_BOOTSTRAP && $LANGUAGE=='Kotlin'" + }, + { + "template": "LoaderClass.java.ft", + "destination": "src/main/java/${MAIN_CLASS.packagePath}/${MAIN_CLASS.className}Loader.java", + "condition": "!$USE_GREMLIN && $INCLUDE_PLUGIN_LOADER && $JAVA_PLUGIN_LOADER" + }, + { + "template": "LoaderClass.kt.ft", + "destination": "src/main/kotlin/${MAIN_CLASS.packagePath}/${MAIN_CLASS.className}Loader.kt", + "condition": "!$USE_GREMLIN && $INCLUDE_PLUGIN_LOADER && !$JAVA_PLUGIN_LOADER" } ], "finalizers": [ + { + "type": "run_gradle_tasks", + "tasks": [ + "wrapper --gradle-version=latest" + ], + "condition": "$BUILD_SYSTEM=='Gradle'" + }, { "type": "import_maven_project", "condition": "$BUILD_SYSTEM=='Maven'" @@ -232,11 +355,6 @@ "type": "import_gradle_project", "condition": "$BUILD_SYSTEM=='Gradle'" }, - { - "type": "run_gradle_tasks", - "tasks": ["wrapper"], - "condition": "$BUILD_SYSTEM=='Gradle'" - }, { "type": "git_add_all", "condition": "$USE_GIT" diff --git a/bukkit/plugin.yml.ft b/bukkit/plugin.yml.ft index bd31545..b4f91ac 100644 --- a/bukkit/plugin.yml.ft +++ b/bukkit/plugin.yml.ft @@ -1,21 +1,37 @@ name: ${PLUGIN_NAME} -version: '${BUILD_COORDS.version}' -main: ${MAIN_CLASS} -#if (${API_VERSION}) -api-version: '${API_VERSION}' +#if (${DESCRIPTION}) +description: ${DESCRIPTION} #end #if (${LOG_PREFIX}) prefix: ${LOG_PREFIX} #end +version: '$version' + +main: ${MAIN_CLASS} +#if (${INCLUDE_PLUGIN_BOOTSTRAP}) +bootstrapper: ${MAIN_CLASS.packageName}.${MAIN_CLASS.className}Bootstrap +#end +#if (${INCLUDE_PLUGIN_LOADER} && !${USE_GREMLIN} && !${USE_PAPER_MANIFEST}) +paperPluginLoader: ${MAIN_CLASS.packageName}.${MAIN_CLASS.className}Loader +#elseif (${USE_GREMLIN} && !${USE_PAPER_MANIFEST}) +paperPluginLoader: xyz.jpenilla.gremlin.runtime.platformsupport.DefaultsPaperPluginLoader +#elseif (${INCLUDE_PLUGIN_LOADER} && !${USE_GREMLIN} && ${USE_PAPER_MANIFEST}) +loader: ${MAIN_CLASS.packageName}.${MAIN_CLASS.className}Loader +#elseif (${USE_GREMLIN} && ${USE_PAPER_MANIFEST}) +loader: xyz.jpenilla.gremlin.runtime.platformsupport.DefaultsPaperPluginLoader +#end +#if (${API_VERSION}) +api-version: '${API_VERSION}' +#end #if (${LOAD_AT}) load: ${LOAD_AT} #end -#if (${AUTHORS}) +#if ($AUTHORS || $WEBSITE) + +#if ($AUTHORS) authors: ${AUTHORS.toString(", ", "[", "]")} #end -#if (${DESCRIPTION}) -description: ${DESCRIPTION} -#end #if (${WEBSITE}) website: ${WEBSITE} #end +#end diff --git a/bukkit/settings.gradle.ft b/bukkit/settings.gradle.ft deleted file mode 100644 index 9e1c33f..0000000 --- a/bukkit/settings.gradle.ft +++ /dev/null @@ -1 +0,0 @@ -rootProject.name = '${PROJECT_NAME}' diff --git a/bukkit/spigot.mcdev.template.json b/bukkit/spigot.mcdev.template.json index 1e561ba..0523b6d 100644 --- a/bukkit/spigot.mcdev.template.json +++ b/bukkit/spigot.mcdev.template.json @@ -1,5 +1,5 @@ { - "version": 1, + "version": 2, "group": "plugin", "properties": [ { @@ -23,6 +23,17 @@ "Kotlin" ] }, + { + "name": "KOTLIN_VERSION", + "type": "maven_artifact_version", + "parameters": { + "sourceUrl": "https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-jdk8/maven-metadata.xml" + }, + "visible": { + "dependsOn": ["LANGUAGE"], + "condition": "$LANGUAGE == 'Kotlin'" + } + }, { "name": "MC_VERSION", "type": "semantic_version", @@ -50,17 +61,6 @@ ], "default": 0 }, - { - "name": "KOTLIN_VERSION", - "type": "maven_artifact_version", - "parameters": { - "sourceUrl": "https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-jdk8/maven-metadata.xml" - }, - "visible": { - "dependsOn": ["LANGUAGE"], - "condition": "$LANGUAGE == 'Kotlin'" - } - }, { "name": "API_VERSION", "type": "semantic_version", @@ -130,6 +130,88 @@ } ] }, + { + "label": "creator.ui.advanced_settings.label", + "collapsible": true, + "groupProperties": [ + { + "name": "USE_VERSION_CATALOG", + "type": "boolean", + "default": false, + "visible": { + "dependsOn": [ + "BUILD_SYSTEM" + ], + "condition": "$BUILD_SYSTEM == 'Gradle'" + } + }, + { + "name": "USE_GREMLIN", + "type": "boolean", + "default": false, + "visible": false + }, + { + "name": "INCLUDE_PLUGIN_BOOTSTRAP", + "type": "boolean", + "default": false, + "visible": false + }, + { + "name": "INCLUDE_PLUGIN_LOADER", + "type": "boolean", + "default": false, + "visible": false + }, + { + "name": "JAVA_PLUGIN_LOADER", + "type": "boolean", + "default": true, + "visible": false + }, + { + "name": "USE_RESOURCE_FACTORY_PLUGIN", + "type": "boolean", + "default": false, + "visible": { + "dependsOn": [ + "BUILD_SYSTEM" + ], + "condition": "$BUILD_SYSTEM == 'Gradle'" + } + }, + { + "name": "USE_PAPERWEIGHT_USERDEV", + "type": "boolean", + "default": false, + "visible": false + }, + { + "name": "INCLUDE_SHADOW_PLUGIN", + "type": "boolean", + "default": "$LANGUAGE=='Kotlin'", + "visible": { + "dependsOn": [ + "LANGUAGE", + "BUILD_SYSTEM" + ], + "condition": "$LANGUAGE == 'Java' && $BUILD_SYSTEM == 'Gradle'" + } + }, + { + "name": "INCLUDE_RUN_PAPER_PLUGIN", + "type": "boolean", + "default": false, + "visible": false + }, + { + "name": "ACCEPT_EULA", + "type": "boolean", + "default": false, + "visible": false + } + ] + }, { "name": "JAVA_VERSION", "type": "integer", @@ -162,35 +244,30 @@ "condition": "$USE_GIT" }, { - "template": "build.gradle.ft", - "destination": "build.gradle", - "condition": "$BUILD_SYSTEM=='Gradle' && $LANGUAGE=='Java'" - }, - { - "template": "settings.gradle.ft", - "destination": "settings.gradle", - "condition": "$BUILD_SYSTEM=='Gradle' && $LANGUAGE=='Java'" + "template": "../.gitattributes.ft", + "destination": ".gitattributes", + "condition": "$USE_GIT" }, { "template": "build.gradle.kts.ft", "destination": "build.gradle.kts", - "condition": "$BUILD_SYSTEM=='Gradle' && $LANGUAGE=='Kotlin'" + "condition": "$BUILD_SYSTEM=='Gradle'" + }, + { + "template": "libs.versions.toml.ft", + "destination": "gradle/libs.versions.toml", + "condition": "$BUILD_SYSTEM=='Gradle' && $USE_VERSION_CATALOG" }, { "template": "settings.gradle.kts.ft", "destination": "settings.gradle.kts", - "condition": "$BUILD_SYSTEM=='Gradle' && $LANGUAGE=='Kotlin'" + "condition": "$BUILD_SYSTEM=='Gradle'" }, { "template": "gradle.properties.ft", "destination": "gradle.properties", "condition": "$BUILD_SYSTEM=='Gradle'" }, - { - "template": "../gradle-wrapper.properties.ft", - "destination": "gradle/wrapper/gradle-wrapper.properties", - "condition": "$BUILD_SYSTEM=='Gradle'" - }, { "template": "pom.xml.ft", "destination": "pom.xml", @@ -198,7 +275,8 @@ }, { "template": "plugin.yml.ft", - "destination": "src/main/resources/plugin.yml" + "destination": "src/main/resources/plugin.yml", + "condition": "!$USE_RESOURCE_FACTORY_PLUGIN" }, { "template": "MainClass.java.ft", @@ -215,17 +293,17 @@ ], "finalizers": [ { - "type": "import_maven_project", - "condition": "$BUILD_SYSTEM=='Maven'" + "type": "run_gradle_tasks", + "tasks": ["wrapper --gradle-version=latest"], + "condition": "$BUILD_SYSTEM=='Gradle'" }, { "type": "import_gradle_project", "condition": "$BUILD_SYSTEM=='Gradle'" }, { - "type": "run_gradle_tasks", - "tasks": ["wrapper"], - "condition": "$BUILD_SYSTEM=='Gradle'" + "type": "import_maven_project", + "condition": "$BUILD_SYSTEM=='Maven'" }, { "type": "git_add_all", diff --git a/bungeecord/.mcdev.template.json b/bungeecord/.mcdev.template.json index fd4473c..8e06ac2 100644 --- a/bungeecord/.mcdev.template.json +++ b/bungeecord/.mcdev.template.json @@ -1,5 +1,5 @@ { - "version": 1, + "version": 2, "group": "proxy", "properties": [ { diff --git a/fabric/.mcdev.template.json b/fabric/.mcdev.template.json index f30d680..807418a 100644 --- a/fabric/.mcdev.template.json +++ b/fabric/.mcdev.template.json @@ -1,5 +1,5 @@ { - "version": 1, + "version": 2, "group": "mod", "properties": [ { diff --git a/forge/.mcdev.template.json b/forge/.mcdev.template.json index 4115de8..26e3cf0 100644 --- a/forge/.mcdev.template.json +++ b/forge/.mcdev.template.json @@ -1,5 +1,5 @@ { - "version": 1, + "version": 2, "group": "mod", "properties": [ { diff --git a/messages.properties b/messages.properties index 9177ed1..0b01629 100644 --- a/messages.properties +++ b/messages.properties @@ -29,6 +29,8 @@ platform.neoforge.label=NeoForge platform.sponge.label=Sponge platform.velocity.label=Velocity +creator.ui.advanced_settings.label=Advanced Options + creator.ui.use_datagen.label=Use Datagen: creator.ui.use_paper_manifest.label=Use Paper Manifest: creator.ui.use_paper_manifest.warning=Paper plugins are still experimental, their usage is discouraged for general purpose development. diff --git a/multiloader/.mcdev.template.json b/multiloader/.mcdev.template.json index f3dc386..be1d1b4 100644 --- a/multiloader/.mcdev.template.json +++ b/multiloader/.mcdev.template.json @@ -1,5 +1,5 @@ { - "version": 1, + "version": 2, "group": "mod", "properties": [ { diff --git a/neoforge/.mcdev.template.json b/neoforge/.mcdev.template.json index 48c357e..489d229 100644 --- a/neoforge/.mcdev.template.json +++ b/neoforge/.mcdev.template.json @@ -1,5 +1,5 @@ { - "version": 1, + "version": 2, "group": "mod", "properties": [ { diff --git a/sponge/.mcdev.template.json b/sponge/.mcdev.template.json index 2a22716..29ed0e6 100644 --- a/sponge/.mcdev.template.json +++ b/sponge/.mcdev.template.json @@ -1,5 +1,5 @@ { - "version": 1, + "version": 2, "group": "plugin", "properties": [ { diff --git a/velocity/.mcdev.template.json b/velocity/.mcdev.template.json index 6cc3e0f..b38d8ab 100644 --- a/velocity/.mcdev.template.json +++ b/velocity/.mcdev.template.json @@ -1,5 +1,5 @@ { - "version": 1, + "version": 2, "group": "proxy", "properties": [ {