diff --git a/.gitignore b/.gitignore
index 2ce32f0b1..c804447ea 100644
--- a/.gitignore
+++ b/.gitignore
@@ -20,3 +20,7 @@ build/
.DS_Store
.gradle/
+
+.codegraph/
+
+TEST_SUITE_PLAN.md
diff --git a/README.md b/README.md
index b7e00b79f..55eb4018c 100644
--- a/README.md
+++ b/README.md
@@ -47,17 +47,17 @@ plugin [Manifold](https://plugins.jetbrains.com/plugin/10057-manifold)
## Preface: if you need help compiling and you are a developer / intend to help out in the community or with development we would love to help you regardless in the discord! however do not come to the discord asking for free copies, or a tutorial on how to compile.
-1. Install [Java JDK 21](https://www.oracle.com/java/technologies/downloads/#java21)
+1. Install [Java JDK 25](https://adoptium.net/temurin/releases/?version=25)
2. Set the JDK installation path to `JAVA_HOME` as an environment variable.
* Windows
1. Start > Type `env` and press Enter
2. Advanced > Environment Variables
3. Under System Variables, click `New...`
4. Variable Name: `JAVA_HOME`
- 5. Variable Value: `C:\Program Files\Java\jdk-21` (verify this exists after installing java don't just copy
+ 5. Variable Value: `C:\Program Files\Java\jdk-25` (verify this exists after installing java don't just copy
the example text)
* MacOS
- 1. Run `/usr/libexec/java_home -V` and look for Java 21
+ 1. Run `/usr/libexec/java_home -V` and look for Java 25
2. Run `sudo nano ~/.zshenv`
3. Add `export JAVA_HOME=$(/usr/libexec/java_home)` as a new line
4. Use `CTRL + X`, then Press `Y`, Then `ENTER`
@@ -69,7 +69,7 @@ plugin [Manifold](https://plugins.jetbrains.com/plugin/10057-manifold)
Gradle Setup
* Run `gradlew setup` any time you get dependency issues with craftbukkit
-* Configure ITJ Gradle to use JDK 21 (in settings, search for gradle)
+* Configure ITJ Gradle to use JDK 25 (in settings, search for gradle)
* Resync the project & run your newly created task (under the development folder in gradle tasks!)
diff --git a/build.gradle b/build.gradle
new file mode 100644
index 000000000..dea81c8f7
--- /dev/null
+++ b/build.gradle
@@ -0,0 +1,302 @@
+/*
+ * Adapt is Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+buildscript {
+ repositories {
+ mavenCentral()
+ gradlePluginPortal()
+ }
+ dependencies {
+ classpath('io.papermc.paperweight:paperweight-userdev:2.0.0-beta.21')
+ }
+}
+
+import io.freefair.gradle.plugins.lombok.LombokPlugin
+import io.github.slimjar.resolver.data.Mirror
+import io.papermc.paperweight.userdev.PaperweightUser
+import org.gradle.api.tasks.Copy
+import org.gradle.api.tasks.compile.JavaCompile
+import org.gradle.jvm.toolchain.JavaLanguageVersion
+
+plugins {
+ id 'java-library'
+ alias(libs.plugins.lombok)
+ alias(libs.plugins.shadow)
+ alias(libs.plugins.idea)
+ alias(libs.plugins.slimjar)
+}
+
+apply plugin: PaperweightUser
+
+version = '2.0.0-26.2'
+def apiVersion = '26.2'
+def main = 'art.arcane.adapt.Adapt'
+String paperDevBundleVersion = '26.2.build.25-alpha'
+String volmLibCoordinate = providers.gradleProperty('volmLibCoordinate')
+ .orElse('com.github.VolmitSoftware:VolmLib:master-SNAPSHOT')
+ .get()
+String hiddenOreCoordinate = providers.gradleProperty('hiddenOreCoordinate')
+ .orElse('com.github.VolmitSoftware:HiddenOre:master-SNAPSHOT')
+ .get()
+
+def shadowJarTask = tasks.named('shadowJar', com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar)
+tasks.named('slimJar').get()
+
+// ADD YOURSELF AS A NEW LINE IF YOU WANT YOUR OWN BUILD TASK GENERATED
+// ======================== WINDOWS =============================
+registerCustomOutputTask('Cyberpwn', 'C://Users/cyberpwn/Documents/development/server/plugins')
+registerCustomOutputTask('Psycho', 'C://Dan/MinecraftDevelopment/Server/plugins')
+registerCustomOutputTask('ArcaneArts', 'C://Users/arcane/Documents/development/server/plugins')
+registerCustomOutputTask('Vatuu', 'D://Minecraft/Servers/1.20/plugins')
+registerCustomOutputTask('Nowhere', 'E://Desktop/server/plugins')
+registerCustomOutputTask('CrazyDev22', 'C://Users/Julian/Desktop/server/plugins')
+registerCustomOutputTask('Pixel', 'D://Iris Dimension Engine//1.20.4 - Development//plugins')
+// ========================== UNIX ==============================
+registerCustomOutputTaskUnix('CyberpwnLT', '/Users/danielmills/development/server/plugins')
+registerCustomOutputTaskUnix('PsychoLT', '/Users/brianfopiano/Developer/RemoteGit/[Minecraft Server]/consumers/plugin-consumers/dropins/plugins')
+registerCustomOutputTaskUnix('the456gamer', '/home/the456gamer/projects/minecraft/adapt-testserver/plugins/update/', false)
+// ==============================================================
+
+/**
+ * Expand properties into plugin yml
+ */
+tasks.named('processResources').configure {
+ def pluginProperties = [
+ name : rootProject.name,
+ version : project.version,
+ main : main,
+ apiVersion: apiVersion,
+ ]
+
+ inputs.properties(pluginProperties)
+ filesMatching('**/plugin.yml') {
+ expand(pluginProperties)
+ }
+}
+
+allprojects {
+ apply plugin: 'java'
+ apply plugin: LombokPlugin
+
+ java {
+ toolchain.languageVersion.set(JavaLanguageVersion.of(25))
+ }
+
+ repositories {
+ mavenCentral()
+ maven { url = uri('https://hub.spigotmc.org/nexus/content/repositories/snapshots/') }
+ maven { url = uri('https://repo.papermc.io/repository/maven-public/') }
+ maven { url = uri('https://repo.codemc.org/repository/maven-public') }
+ maven { url = uri('https://mvn.lumine.io/repository/maven-public/') }
+ maven { url = uri('https://nexus.frengor.com/repository/public/') }
+ maven { url = uri('https://repo.extendedclip.com/content/repositories/placeholderapi/') }
+ maven { url = uri('https://repo.glaremasters.me/repository/bloodshot/') }
+ maven { url = uri('https://maven.enginehub.org/repo/') }
+ maven { url = uri('https://repo.oraxen.com/releases') }
+ maven { url = uri('https://repo.alessiodp.com/releases') }
+ maven { url = uri('https://jitpack.io') }
+ }
+
+ /**
+ * We need parameter meta for the decree command system
+ */
+ tasks.withType(JavaCompile).configureEach {
+ options.compilerArgs.add('-parameters')
+ options.encoding = 'UTF-8'
+ options.debugOptions.debugLevel = 'none'
+ options.release.set(25)
+ }
+}
+
+dependencies {
+ paperweight.paperDevBundle(paperDevBundleVersion)
+
+ implementation(project(':velocity'))
+ implementation(volmLibCoordinate) {
+ changing = true
+ transitive = false
+ }
+ compileOnly(hiddenOreCoordinate) {
+ changing = true
+ transitive = false
+ }
+ implementation('de.crazydev22.slimjar.helper:spigot:2.1.9')
+ implementation('de.crazydev22.slimjar.helper:velocity:2.1.9')
+ slimApi(libs.platformUtils) {
+ transitive = false
+ }
+
+ compileOnly('io.papermc.paper:paper-api:26.2.build.25-alpha')
+
+ // Cancer
+ slimApi(libs.fukkit) {
+ exclude(group: 'org.spigotmc', module: 'spigot-api')
+ }
+ slimApi(libs.amulet)
+ slimApi(libs.chrono)
+ slimApi(libs.spatial)
+ slimApi(libs.kotlin.coroutines)
+
+ // Dynamically Loaded
+ slimApi(libs.adventure.minimessage)
+ slimApi(libs.adventure.platform)
+ slimApi(libs.adventure.gson)
+ slimApi(libs.adventure.legacy)
+ slimApi(libs.lettuce)
+ slimApi(libs.particle)
+ implementation(libs.ultimateAdvancementApi)
+ slimApi(libs.customBlockData)
+ slimApi(libs.lur)
+ slimApi(libs.lang3)
+ slimApi(libs.effectLib)
+ slimApi(libs.gson)
+ slimApi(libs.toml4j)
+ slimApi(libs.fastutil)
+ implementation(libs.glowingentities)
+ slimApi(libs.caffeine)
+
+ //Random Api's
+ compileOnlyApi('me.clip:placeholderapi:2.11.6')
+ compileOnlyApi('com.github.DeadSilenceIV:AdvancedChestsAPI:2.9-BETA')
+ compileOnlyApi('com.sk89q.worldguard:worldguard-bukkit:7.0.8')
+ compileOnlyApi('com.github.FrancoBM12:API-MagicCosmetics:2.2.8')
+ compileOnlyApi('com.massivecraft:Factions:1.6.9.5-U0.6.21')
+ compileOnlyApi('com.github.angeschossen:ChestProtectAPI:3.9.1')
+ compileOnlyApi('com.github.TechFortress:GriefPrevention:16.18.1')
+ compileOnlyApi('com.griefdefender:api:2.1.0-SNAPSHOT')
+ compileOnlyApi(fileTree('libs') { include('*.jar') })
+
+ testImplementation('io.papermc.paper:paper-api:26.2.build.25-alpha')
+ testImplementation('org.junit.jupiter:junit-jupiter:5.11.4')
+ testImplementation('org.mockito:mockito-core:5.14.2')
+ testImplementation('org.mockito:mockito-junit-jupiter:5.14.2')
+ testImplementation('org.assertj:assertj-core:3.26.3')
+ testRuntimeOnly('org.junit.platform:junit-platform-launcher')
+}
+
+tasks.named('test', Test) {
+ useJUnitPlatform()
+ jvmArgs('-Dnet.bytebuddy.experimental=true')
+ testLogging {
+ events('passed', 'skipped', 'failed')
+ showStandardStreams = true
+ exceptionFormat = 'full'
+ }
+}
+
+def lib = 'art.arcane.adapt.util'
+slimJar {
+ mirrors = [
+ new Mirror(
+ uri('https://maven-central.storage-download.googleapis.com/maven2').toURL(),
+ uri('https://repo.maven.apache.org/maven2/').toURL()
+ )
+ ]
+
+ relocate('manifold', "${lib}.manifold")
+ relocate('art.arcane.volmlib', "${lib}.arcane.volmlib")
+ relocate('Fukkit.extensions', "${lib}.extensions")
+ relocate('Amulet.extensions', "${lib}.extensions")
+ relocate('com.fren_gor.ultimateAdvancementAPI', "${lib}.advancements")
+ relocate('net.byteflux.libby', "${lib}.libby")
+ relocate('com.jeff_media.customblockdata', "${lib}.customblocks")
+}
+
+/**
+ * Configure Adapt for shading
+ */
+shadowJarTask.configure {
+// minimize()
+ duplicatesStrategy = DuplicatesStrategy.EXCLUDE
+ exclude('net/kyori/**')
+ exclude('com/google/gson/**')
+}
+
+configurations.configureEach {
+ resolutionStrategy.cacheChangingModulesFor(0, 'seconds')
+ resolutionStrategy.cacheDynamicVersionsFor(0, 'seconds')
+}
+
+if (!JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_25)) {
+ System.err.println()
+ System.err.println('=========================================================================================================')
+ System.err.println('You must run gradle on Java 25 or newer. You are using ' + JavaVersion.current())
+ System.err.println()
+ System.err.println('=== For IDEs ===')
+ System.err.println('1. Configure the project for Java 25')
+ System.err.println('2. Configure the bundled gradle to use Java 25 in settings')
+ System.err.println()
+ System.err.println('=== For Command Line (gradlew) ===')
+ System.err.println('1. Install JDK 25 from https://adoptium.net/temurin/releases/?version=25')
+ System.err.println('2. Set JAVA_HOME environment variable to the new jdk installation folder such as C:/Program Files/Java/jdk-25')
+ System.err.println('3. Open a new command prompt window to get the new environment variables if need be.')
+ System.err.println('=========================================================================================================')
+ System.err.println()
+ System.exit(69)
+}
+
+java {
+ toolchain {
+ languageVersion = JavaLanguageVersion.of(25)
+ }
+}
+
+tasks.named('build').configure {
+ dependsOn(shadowJarTask)
+}
+
+tasks.register('adapt', Copy) {
+ from(shadowJarTask.flatMap { it.archiveFile })
+ into(layout.buildDirectory)
+ rename { String ignored -> "Adapt-${version}.jar" }
+}
+
+void registerCustomOutputTask(String name, String path, boolean doRename = true) {
+ if (!System.getProperty('os.name').toLowerCase().contains('windows')) {
+ return
+ }
+ createOutputTask(name, path, doRename)
+}
+
+void registerCustomOutputTaskUnix(String name, String path, boolean doRename = true) {
+ if (System.getProperty('os.name').toLowerCase().contains('windows')) {
+ return
+ }
+
+ createOutputTask(name, path, doRename)
+}
+
+void createOutputTask(String name, String path, boolean doRename = true) {
+ def shadowJarTask = tasks.named('shadowJar', com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar)
+ tasks.register("build${name}", Copy) {
+ group = 'development'
+ outputs.upToDateWhen { false }
+ duplicatesStrategy = DuplicatesStrategy.EXCLUDE
+ dependsOn(shadowJarTask)
+ from(shadowJarTask.flatMap { it.archiveFile })
+ into(file(path))
+ if (doRename) {
+ rename { String ignored -> 'Adapt.jar' }
+ }
+ }
+}
+
+idea.project.settings {
+ taskTriggers {
+ afterSync(':velocity:generateTemplates')
+ }
+}
diff --git a/build.gradle.kts b/build.gradle.kts
deleted file mode 100644
index 03fae830a..000000000
--- a/build.gradle.kts
+++ /dev/null
@@ -1,275 +0,0 @@
-/*
- * Adapt is Copyright (c) 2021 Arcane Arts (Volmit Software)
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-import io.freefair.gradle.plugins.lombok.LombokPlugin
-import io.github.slimjar.func.slimjarHelper
-import io.github.slimjar.resolver.data.Mirror
-import org.gradle.api.plugins.JavaPluginExtension
-import org.jetbrains.gradle.ext.settings
-import org.jetbrains.gradle.ext.taskTriggers
-import xyz.jpenilla.runpaper.task.RunServer
-import kotlin.system.exitProcess
-
-plugins {
- `java-library`
- alias(libs.plugins.lombok)
- alias(libs.plugins.shadow)
- alias(libs.plugins.runPaper)
- alias(libs.plugins.runVelocity)
- alias(libs.plugins.idea)
- alias(libs.plugins.slimjar)
-}
-
-version = "1.18.0-1.20.2-1.21.11"
-val apiVersion = "1.20"
-val main = "com.volmit.adapt.Adapt"
-
-// ADD YOURSELF AS A NEW LINE IF YOU WANT YOUR OWN BUILD TASK GENERATED
-// ======================== WINDOWS =============================
-registerCustomOutputTask("Cyberpwn", "C://Users/cyberpwn/Documents/development/server/plugins")
-registerCustomOutputTask("Psycho", "C://Dan/MinecraftDevelopment/Server/plugins")
-registerCustomOutputTask("ArcaneArts", "C://Users/arcane/Documents/development/server/plugins")
-registerCustomOutputTask("Vatuu", "D://Minecraft/Servers/1.20/plugins")
-registerCustomOutputTask("Nowhere", "E://Desktop/server/plugins")
-registerCustomOutputTask("CrazyDev22", "C://Users/Julian/Desktop/server/plugins")
-registerCustomOutputTask("Pixel", "D://Iris Dimension Engine//1.20.4 - Development//plugins")
-// ========================== UNIX ==============================
-registerCustomOutputTaskUnix("CyberpwnLT", "/Users/danielmills/development/server/plugins")
-registerCustomOutputTaskUnix("PsychoLT", "/Users/brianfopiano/Developer/RemoteGit/[Minecraft Server]/plugins")
-registerCustomOutputTaskUnix("the456gamer", "/home/the456gamer/projects/minecraft/adapt-testserver/plugins/update/", false)
-// ==============================================================
-
-val supported = listOf("1.20.2", "1.20.4", "1.20.6", "1.21.1", "1.21.3", "1.21.4", "1.21.5", "1.21.8", "1.21.10", "1.21.11")
-val jdk = listOf("1.20.2", "1.20.4")
-
-val MIN_HEAP_SIZE = "2G"
-val MAX_HEAP_SIZE = "8G"
-//Valid values are: none, truecolor, indexed256, indexed16, indexed8
-val COLOR = "truecolor"
-
-supported.forEach { version ->
- tasks.register("runServer-$version") {
- group = "servers"
- minecraftVersion(version)
- minHeapSize = MIN_HEAP_SIZE
- maxHeapSize = MAX_HEAP_SIZE
- systemProperty("disable.watchdog", "")
- systemProperty("net.kyori.ansi.colorLevel", COLOR)
- systemProperty("com.mojang.eula.agree", true)
- pluginJars(tasks.shadowJar.flatMap { it.archiveFile} )
- runDirectory.convention(layout.buildDirectory.dir("run/$version"))
-
- if (!jdk.contains(version)) {
- javaLauncher = javaToolchains.launcherFor { languageVersion = JavaLanguageVersion.of(21)}
- }
- }
-}
-
-tasks.runVelocity {
- group = "servers"
- velocityVersion(libs.versions.velocity.get())
- runDirectory.convention(layout.buildDirectory.dir("run/velocity"))
-}
-
-/**
- * Expand properties into plugin yml
- */
-tasks.processResources {
- inputs.properties(
- "name" to rootProject.name,
- "version" to version,
- "main" to main,
- "apiVersion" to apiVersion,
- )
-
- filesMatching("**/plugin.yml") {
- expand(inputs.properties)
- }
-}
-
-allprojects {
- apply()
- apply()
-
- extensions.configure {
- toolchain.languageVersion.set(JavaLanguageVersion.of(21))
- }
-
- repositories {
- mavenCentral()
- maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
- maven("https://repo.papermc.io/repository/maven-public/")
- maven("https://repo.codemc.org/repository/maven-public")
- maven("https://mvn.lumine.io/repository/maven-public/")
- maven("https://nexus.frengor.com/repository/public/")
- maven("https://repo.extendedclip.com/content/repositories/placeholderapi/")
- maven("https://repo.glaremasters.me/repository/bloodshot/")
- maven("https://maven.enginehub.org/repo/")
- maven("https://repo.oraxen.com/releases")
- maven("https://repo.alessiodp.com/releases")
- maven("https://jitpack.io")
- }
-
- /**
- * We need parameter meta for the decree command system
- */
- tasks.compileJava {
- options.compilerArgs.add("-parameters")
- options.encoding = "UTF-8"
- options.release.set(21)
- }
-}
-
-dependencies {
- implementation(project(":velocity"))
- implementation(slimjarHelper("spigot"))
- implementation(slimjarHelper("velocity"))
- implementation(libs.platformUtils) {
- isTransitive = false
- }
-
- compileOnly(libs.spigot)
-
- // Cancer
- slimApi(libs.fukkit)
- slimApi(libs.amulet)
- slimApi(libs.chrono)
- slimApi(libs.spatial)
-
- // Dynamically Loaded
- slimApi(libs.adventure.minimessage)
- slimApi(libs.adventure.platform)
- slimApi(libs.adventure.gson)
- slimApi(libs.adventure.legacy)
- slimApi(libs.lettuce)
- slimApi(libs.particle)
- slimApi(libs.ultimateAdvancementApi)
- slimApi(libs.customBlockData)
- slimApi(libs.lur)
- slimApi(libs.lang3)
- slimApi(libs.effectLib)
- slimApi(libs.gson)
- slimApi(libs.toml4j)
- slimApi(libs.fastutil)
- slimApi(libs.glowingentities)
- slimApi(libs.caffeine)
-
- //Random Api's
- compileOnlyApi("me.clip:placeholderapi:2.11.6")
- compileOnlyApi("com.github.DeadSilenceIV:AdvancedChestsAPI:2.9-BETA")
- compileOnlyApi("com.sk89q.worldguard:worldguard-bukkit:7.0.8")
- compileOnlyApi("com.github.FrancoBM12:API-MagicCosmetics:2.2.8")
- compileOnlyApi("com.massivecraft:Factions:1.6.9.5-U0.6.21")
- compileOnlyApi("com.github.angeschossen:ChestProtectAPI:3.9.1")
- compileOnlyApi("com.github.TechFortress:GriefPrevention:16.18.1")
- compileOnlyApi("com.griefdefender:api:2.1.0-SNAPSHOT")
- compileOnlyApi(fileTree("libs") { include("*.jar") })
-}
-
-val lib = "com.volmit.adapt.util"
-slimJar {
- mirrors = listOf(Mirror(
- uri("https://maven-central.storage-download.googleapis.com/maven2").toURL(),
- uri("https://repo.maven.apache.org/maven2/").toURL()
- ))
-
- relocate("manifold", "$lib.manifold")
- relocate("art.arcane", "$lib.arcane")
- relocate("Fukkit.extensions", "$lib.extensions")
- relocate("Amulet.extensions", "$lib.extensions")
- relocate("com.fren_gor.ultimateAdvancementAPI", "$lib.advancements")
- relocate("net.byteflux.libby", "$lib.libby")
- relocate("com.jeff_media.customblockdata", "$lib.customblocks")
-}
-
-/**
- * Configure Adapt for shading
- */
-tasks.shadowJar {
-// minimize()
- duplicatesStrategy = DuplicatesStrategy.EXCLUDE
-}
-
-configurations.configureEach {
- resolutionStrategy.cacheChangingModulesFor(60, "minutes")
- resolutionStrategy.cacheDynamicVersionsFor(60, "minutes")
-}
-
-if (!JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_21)) {
- System.err.println()
- System.err.println("=========================================================================================================")
- System.err.println("You must run gradle on Java 21 or newer. You are using " + JavaVersion.current())
- System.err.println()
- System.err.println("=== For IDEs ===")
- System.err.println("1. Configure the project for Java 21")
- System.err.println("2. Configure the bundled gradle to use Java 21 in settings")
- System.err.println()
- System.err.println("=== For Command Line (gradlew) ===")
- System.err.println("1. Install JDK 21 from https://www.oracle.com/java/technologies/downloads/#java21")
- System.err.println("2. Set JAVA_HOME environment variable to the new jdk installation folder such as C:/Program Files/Java/jdk-21")
- System.err.println("3. Open a new command prompt window to get the new environment variables if need be.")
- System.err.println("=========================================================================================================")
- System.err.println()
- exitProcess(69)
-}
-
-java {
- toolchain {
- languageVersion = JavaLanguageVersion.of(21)
- }
-}
-
-tasks {
- build { dependsOn(shadowJar) }
-
- register("adapt") {
- from(shadowJar.flatMap { it.archiveFile })
- into(layout.buildDirectory)
- rename { "Adapt-$version.jar" }
- }
-}
-
-fun registerCustomOutputTask(name: String, path: String, doRename: Boolean = true) {
- if (!System.getProperty("os.name").lowercase().contains("windows")) {
- return
- }
- createOutputTask(name, path, doRename)
-}
-
-fun registerCustomOutputTaskUnix(name: String, path: String, doRename: Boolean = true) {
- if (System.getProperty("os.name").lowercase().contains("windows")) {
- return
- }
-
- createOutputTask(name, path, doRename)
-}
-
-fun createOutputTask(name: String, path: String, doRename: Boolean = true) {
- tasks.register("build$name") {
- group = "development"
- outputs.upToDateWhen { false }
- duplicatesStrategy = DuplicatesStrategy.EXCLUDE
- dependsOn(tasks.shadowJar)
- from(tasks.shadowJar.flatMap { it.archiveFile })
- into(file(path))
- if (doRename) rename { "Adapt.jar" }
- }
-}
-
-idea.project.settings.taskTriggers {
- afterSync(":velocity:generateTemplates")
-}
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index 0a71650af..5d2cebedc 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -1,10 +1,12 @@
[versions]
# Plugins
-lombok = "8.14"
+lombok = "9.2.0"
shadow = "9.0.0-rc3"
runTask = "2.3.1"
idea = "1.2"
-slimjar = "2.1.7"
+slimjar = "2.1.9"
+kotlin = "2.2.0"
+kotlin-coroutines = "1.10.2"
# Cancer
fukkit = "23.6.1"
@@ -13,11 +15,11 @@ chrono = "22.9.10"
spatial = "22.11.2"
velocity = "3.4.0-SNAPSHOT"
-spigot = "1.21.11-R0.2-SNAPSHOT"
+spigot = "26.2-R0.1-SNAPSHOT"
platformUtils = "e17ac2c698"
# Dynamically Loaded
-adventure-api = "4.24.0" # https://github.com/KyoriPowered/adventure
+adventure-api = "5.1.1" # https://github.com/KyoriPowered/adventure
adventure-platform = "4.4.1" # https://github.com/KyoriPowered/adventure-platform
lettuce = "6.5.1.RELEASE"
@@ -60,6 +62,7 @@ toml4j = { module = "com.moandjiezana.toml:toml4j", version.ref = "toml4j" }
fastutil = { module = "it.unimi.dsi:fastutil", version.ref = "fastutil" }
glowingentities = { module = "fr.skytasul:glowingentities", version.ref = "glowingentities" }
caffeine = { module = "com.github.ben-manes.caffeine:caffeine", version.ref = "caffeine" }
+kotlin-coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlin-coroutines" }
[plugins]
lombok = { id = "io.freefair.lombok", version.ref = "lombok" }
@@ -68,3 +71,4 @@ runPaper = { id = "xyz.jpenilla.run-paper", version.ref = "runTask" }
runVelocity = { id = "xyz.jpenilla.run-velocity", version.ref = "runTask" }
idea = { id = "org.jetbrains.gradle.plugin.idea-ext", version.ref = "idea" }
slimjar = { id = "de.crazydev22.slimjar", version.ref = "slimjar" }
+kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index f24029cc4..fcccf27e1 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -17,7 +17,7 @@
#
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.2-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
diff --git a/settings.gradle b/settings.gradle
new file mode 100644
index 000000000..b7d9aca51
--- /dev/null
+++ b/settings.gradle
@@ -0,0 +1,87 @@
+import java.io.File
+
+rootProject.name = 'Adapt'
+
+boolean hasVolmLibSettings(File directory) {
+ new File(directory, 'settings.gradle.kts').exists() || new File(directory, 'settings.gradle').exists()
+}
+
+File resolveLocalVolmLibDirectory() {
+ String configuredPath = providers.gradleProperty('localVolmLibDirectory')
+ .orElse(providers.environmentVariable('VOLMLIB_DIR'))
+ .orNull
+ if (configuredPath != null && !configuredPath.isBlank()) {
+ File configuredDirectory = file(configuredPath)
+ if (hasVolmLibSettings(configuredDirectory)) {
+ return configuredDirectory
+ }
+ }
+
+ File currentDirectory = settingsDir
+ while (currentDirectory != null) {
+ File candidate = new File(currentDirectory, 'VolmLib')
+ if (hasVolmLibSettings(candidate)) {
+ return candidate
+ }
+
+ currentDirectory = currentDirectory.parentFile
+ }
+
+ null
+}
+
+boolean useLocalVolmLib = providers.gradleProperty('useLocalVolmLib')
+ .orElse('true')
+ .map { String value -> value.equalsIgnoreCase('true') }
+ .get()
+File localVolmLibDirectory = resolveLocalVolmLibDirectory()
+
+if (useLocalVolmLib && localVolmLibDirectory != null) {
+ includeBuild(localVolmLibDirectory) {
+ dependencySubstitution {
+ substitute(module('com.github.VolmitSoftware:VolmLib')).using(project(':shared'))
+ substitute(module('com.github.VolmitSoftware.VolmLib:shared')).using(project(':shared'))
+ substitute(module('com.github.VolmitSoftware.VolmLib:volmlib-shared')).using(project(':shared'))
+ }
+ }
+}
+
+File resolveLocalHiddenOreDirectory() {
+ String configuredPath = providers.gradleProperty('localHiddenOreDirectory')
+ .orElse(providers.environmentVariable('HIDDENORE_DIR'))
+ .orNull
+ if (configuredPath != null && !configuredPath.isBlank()) {
+ File configuredDirectory = file(configuredPath)
+ if (hasVolmLibSettings(configuredDirectory)) {
+ return configuredDirectory
+ }
+ }
+
+ File currentDirectory = settingsDir
+ while (currentDirectory != null) {
+ File candidate = new File(currentDirectory, 'HiddenOre')
+ if (hasVolmLibSettings(candidate)) {
+ return candidate
+ }
+
+ currentDirectory = currentDirectory.parentFile
+ }
+
+ null
+}
+
+boolean useLocalHiddenOre = providers.gradleProperty('useLocalHiddenOre')
+ .orElse('true')
+ .map { String value -> value.equalsIgnoreCase('true') }
+ .get()
+File localHiddenOreDirectory = resolveLocalHiddenOreDirectory()
+
+if (useLocalHiddenOre && localHiddenOreDirectory != null) {
+ includeBuild(localHiddenOreDirectory) {
+ dependencySubstitution {
+ substitute(module('com.github.VolmitSoftware:HiddenOre')).using(project(':'))
+ }
+ }
+}
+
+include(':velocity')
diff --git a/settings.gradle.kts b/settings.gradle.kts
deleted file mode 100644
index 0712309ed..000000000
--- a/settings.gradle.kts
+++ /dev/null
@@ -1,5 +0,0 @@
-rootProject.name = "Adapt"
-
-include(
- ":velocity",
-)
diff --git a/src/main/java/art/arcane/adapt/Adapt.java b/src/main/java/art/arcane/adapt/Adapt.java
new file mode 100644
index 000000000..e606f6c9b
--- /dev/null
+++ b/src/main/java/art/arcane/adapt/Adapt.java
@@ -0,0 +1,651 @@
+/*------------------------------------------------------------------------------
+ - Adapt is a Skill/Integration plugin for Minecraft Bukkit Servers
+ - Copyright (c) 2022 Arcane Arts (Volmit Software)
+ -
+ - This program is free software: you can redistribute it and/or modify
+ - it under the terms of the GNU General Public License as published by
+ - the Free Software Foundation, either version 3 of the License, or
+ - (at your option) any later version.
+ -
+ - This program is distributed in the hope that it will be useful,
+ - but WITHOUT ANY WARRANTY; without even the implied warranty of
+ - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ - GNU General Public License for more details.
+ -
+ - You should have received a copy of the GNU General Public License
+ - along with this program. If not, see .
+ -----------------------------------------------------------------------------*/
+
+package art.arcane.adapt;
+
+import art.arcane.adapt.api.adaptation.Adaptation;
+import art.arcane.adapt.api.adaptation.SimpleAdaptation;
+import art.arcane.adapt.api.advancement.AdvancementManager;
+import art.arcane.adapt.api.data.WorldData;
+import art.arcane.adapt.api.potion.BrewingManager;
+import art.arcane.adapt.api.protection.ProtectorRegistry;
+import art.arcane.adapt.api.skill.SimpleSkill;
+import art.arcane.adapt.api.skill.Skill;
+import art.arcane.adapt.api.tick.Ticker;
+import art.arcane.adapt.api.value.MaterialValue;
+import art.arcane.adapt.api.version.Version;
+import art.arcane.adapt.api.world.AdaptServer;
+import art.arcane.adapt.api.world.PlayerDataPersistenceQueue;
+import art.arcane.adapt.api.xp.XpNoveltyListener;
+import art.arcane.adapt.api.xp.XpProvenanceListener;
+import art.arcane.adapt.content.integration.hiddenore.HiddenOreLink;
+import art.arcane.adapt.content.protector.ChestProtectProtector;
+import art.arcane.adapt.content.protector.FactionsClaimProtector;
+import art.arcane.adapt.content.protector.GriefDefenderProtector;
+import art.arcane.adapt.content.protector.GriefPreventionProtector;
+import art.arcane.adapt.content.protector.LocketteProProtector;
+import art.arcane.adapt.content.protector.ResidenceProtector;
+import art.arcane.adapt.content.protector.WorldGuardProtector;
+import art.arcane.adapt.util.common.format.C;
+import art.arcane.adapt.util.common.format.Localizer;
+import art.arcane.adapt.util.common.io.SQLManager;
+import art.arcane.adapt.util.common.misc.CustomModel;
+import art.arcane.adapt.util.common.plugin.AdaptService;
+import art.arcane.adapt.util.common.plugin.Metrics;
+import art.arcane.adapt.util.common.plugin.VolmitPlugin;
+import art.arcane.adapt.util.common.plugin.VolmitSender;
+import art.arcane.adapt.util.common.scheduling.J;
+import art.arcane.adapt.util.config.ConfigFileSupport;
+import art.arcane.adapt.util.config.ConfigMigrationManager;
+import art.arcane.adapt.util.project.redis.RedisSync;
+import art.arcane.adapt.util.secret.SecretSplash;
+import art.arcane.volmlib.integration.ReloadAware;
+import art.arcane.volmlib.util.collection.KList;
+import art.arcane.volmlib.util.collection.KMap;
+import art.arcane.volmlib.util.inventorygui.UIWindow;
+import art.arcane.volmlib.util.io.JarScanner;
+import com.jeff_media.customblockdata.CustomBlockData;
+import de.crazydev22.platformutils.AudienceProvider;
+import de.crazydev22.platformutils.Platform;
+import de.crazydev22.platformutils.PlatformUtils;
+import de.slikey.effectlib.EffectManager;
+import fr.skytasul.glowingentities.GlowingEntities;
+import io.github.slimjar.app.builder.SpigotApplicationBuilder;
+import lombok.Getter;
+import org.bukkit.Bukkit;
+import org.bukkit.entity.Player;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.InputStreamReader;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.lang.annotation.Annotation;
+import java.net.URL;
+import java.text.MessageFormat;
+import java.time.LocalDate;
+import java.time.format.DateTimeFormatter;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Random;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.function.Supplier;
+
+import static art.arcane.adapt.util.director.context.AdaptationListingHandler.initializeAdaptationListings;
+
+public class Adapt extends VolmitPlugin implements ReloadAware {
+ private static final long STARTUP_SLOW_PHASE_MS = 1500L;
+ private final AtomicBoolean alreadyDrained = new AtomicBoolean(false);
+ private static final boolean SLIMJAR_DEBUG = Boolean.getBoolean("adapt.debug-slimjar");
+ private static final boolean DISABLE_REMAPPER = Boolean.getBoolean("adapt.disable-remapper");
+ public static Adapt instance;
+ public static HashMap wordKey = new HashMap<>();
+ public static Platform platform;
+ public static AudienceProvider audiences;
+ private static VolmitSender sender;
+ public final EffectManager adaptEffectManager;
+ private final KList postShutdown = new KList<>();
+ private KMap, AdaptService> services;
+ @Getter
+ private GlowingEntities glowingEntities;
+ @Getter
+ private Ticker ticker;
+ @Getter
+ private AdaptServer adaptServer;
+ @Getter
+ private SQLManager sqlManager;
+ @Getter
+ private ProtectorRegistry protectorRegistry;
+ @Getter
+ private Map guiLeftovers = new HashMap<>();
+ @Getter
+ private AdvancementManager manager;
+ @Getter
+ private RedisSync redisSync;
+ @Getter
+ private PlayerDataPersistenceQueue playerDataPersistenceQueue;
+
+
+ public Adapt() {
+ instance = this;
+ long libraryLoadStart = System.currentTimeMillis();
+ getLogger().info("Loading Libraries...");
+ new SpigotApplicationBuilder(this)
+ .debug(SLIMJAR_DEBUG)
+ .remap(!DISABLE_REMAPPER)
+ .build();
+ long libraryLoadElapsed = System.currentTimeMillis() - libraryLoadStart;
+ if (DISABLE_REMAPPER) {
+ getLogger().warning("SlimJar remapper disabled via -Dadapt.disable-remapper=true.");
+ }
+ getLogger().info("Libraries Loaded! (" + libraryLoadElapsed + "ms)");
+ adaptEffectManager = new EffectManager(this);
+ }
+
+ @SuppressWarnings("unchecked")
+ public static T service(Class c) {
+ return (T) instance.services.get(c);
+ }
+
+ private static void runStartupPhaseVoid(String phase, Runnable action) {
+ runStartupPhase(phase, () -> {
+ action.run();
+ return null;
+ });
+ }
+
+ private static T runStartupPhase(String phase, Supplier action) {
+ if (phase == null || phase.isBlank()) {
+ return action.get();
+ }
+
+ info("Startup phase: " + phase);
+ long start = System.currentTimeMillis();
+ try {
+ return action.get();
+ } finally {
+ long elapsed = System.currentTimeMillis() - start;
+ if (elapsed >= STARTUP_SLOW_PHASE_MS) {
+ warn("Startup phase '" + phase + "' took " + elapsed + "ms.");
+ } else {
+ verbose("Startup phase '" + phase + "' took " + elapsed + "ms.");
+ }
+ }
+ }
+
+ public static VolmitSender getSender() {
+ if (sender == null) {
+ sender = new VolmitSender(Bukkit.getConsoleSender());
+ sender.setTag(instance.getTag());
+ }
+ return sender;
+ }
+
+ public static List