diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 5ca247e..c9814de 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -32,7 +32,7 @@ jobs: path: | ~/.gradle/caches ~/.gradle/wrapper - key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle', 'gradle.properties', '**/*.accesswidener') }} + key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle') }} restore-keys: ${{ runner.os }}-gradle- - name: Get short commit sha @@ -63,7 +63,7 @@ jobs: COMMIT_SHA: ${{ steps.get_short_sha.outputs.short_sha }} BUILD_TYPE: "BETA" BUILD_NUMBER: ${{ github.run_number }} - run: ./gradlew shadowJar + run: ./gradlew build - name: Upload assets to GitHub Action uses: actions/upload-artifact@v2 @@ -113,7 +113,7 @@ jobs: path: | ~/.gradle/caches ~/.gradle/wrapper - key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle', 'gradle.properties', '**/*.accesswidener') }} + key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle') }} restore-keys: ${{ runner.os }}-gradle- - name: Get short commit sha @@ -144,7 +144,7 @@ jobs: COMMIT_SHA: ${{ steps.get_short_sha.outputs.short_sha }} BUILD_TYPE: "RELEASE" BUILD_NUMBER: ${{ github.run_number }} - run: ./gradlew shadowJar + run: ./gradlew build - name: Upload assets to GitHub Action uses: actions/upload-artifact@v2 diff --git a/bungeecord/build.gradle b/autoworldmap-bungeecord/build.gradle similarity index 76% rename from bungeecord/build.gradle rename to autoworldmap-bungeecord/build.gradle index 7d96a81..ea801ad 100644 --- a/bungeecord/build.gradle +++ b/autoworldmap-bungeecord/build.gradle @@ -1,6 +1,6 @@ dependencies { compileOnly("io.github.waterfallmc:waterfall-api:${project.waterfall_version}") - implementation(project(":autoworldmap-common")) + shade(implementation(project(":autoworldmap-common"))) } processResources { @@ -9,7 +9,7 @@ processResources { "plugin_author": project.plugin_author, "plugin_description": project.plugin_description, "plugin_name": project.plugin_name, - "plugin_version": version + "plugin_version": project.version ]) } } \ No newline at end of file diff --git a/bungeecord/gradle.properties b/autoworldmap-bungeecord/gradle.properties similarity index 100% rename from bungeecord/gradle.properties rename to autoworldmap-bungeecord/gradle.properties diff --git a/bungeecord/src/main/java/top/catowncraft/autoworldmap/AutoWorldMapBungeeCord.java b/autoworldmap-bungeecord/src/main/java/top/catowncraft/autoworldmap/AutoWorldMapBungeeCord.java similarity index 100% rename from bungeecord/src/main/java/top/catowncraft/autoworldmap/AutoWorldMapBungeeCord.java rename to autoworldmap-bungeecord/src/main/java/top/catowncraft/autoworldmap/AutoWorldMapBungeeCord.java diff --git a/bungeecord/src/main/java/top/catowncraft/autoworldmap/bungee/command/AutoWorldMapCommandBungee.java b/autoworldmap-bungeecord/src/main/java/top/catowncraft/autoworldmap/bungee/command/AutoWorldMapCommandBungee.java similarity index 100% rename from bungeecord/src/main/java/top/catowncraft/autoworldmap/bungee/command/AutoWorldMapCommandBungee.java rename to autoworldmap-bungeecord/src/main/java/top/catowncraft/autoworldmap/bungee/command/AutoWorldMapCommandBungee.java diff --git a/bungeecord/src/main/java/top/catowncraft/autoworldmap/bungee/command/CommandSenderImpl.java b/autoworldmap-bungeecord/src/main/java/top/catowncraft/autoworldmap/bungee/command/CommandSenderImpl.java similarity index 100% rename from bungeecord/src/main/java/top/catowncraft/autoworldmap/bungee/command/CommandSenderImpl.java rename to autoworldmap-bungeecord/src/main/java/top/catowncraft/autoworldmap/bungee/command/CommandSenderImpl.java diff --git a/bungeecord/src/main/java/top/catowncraft/autoworldmap/bungee/handler/VoxelMapHandler.java b/autoworldmap-bungeecord/src/main/java/top/catowncraft/autoworldmap/bungee/handler/VoxelMapHandler.java similarity index 100% rename from bungeecord/src/main/java/top/catowncraft/autoworldmap/bungee/handler/VoxelMapHandler.java rename to autoworldmap-bungeecord/src/main/java/top/catowncraft/autoworldmap/bungee/handler/VoxelMapHandler.java diff --git a/bungeecord/src/main/java/top/catowncraft/autoworldmap/bungee/handler/XaeroMapHandler.java b/autoworldmap-bungeecord/src/main/java/top/catowncraft/autoworldmap/bungee/handler/XaeroMapHandler.java similarity index 100% rename from bungeecord/src/main/java/top/catowncraft/autoworldmap/bungee/handler/XaeroMapHandler.java rename to autoworldmap-bungeecord/src/main/java/top/catowncraft/autoworldmap/bungee/handler/XaeroMapHandler.java diff --git a/bungeecord/src/main/resources/bungee.yml b/autoworldmap-bungeecord/src/main/resources/bungee.yml similarity index 100% rename from bungeecord/src/main/resources/bungee.yml rename to autoworldmap-bungeecord/src/main/resources/bungee.yml diff --git a/common/build.gradle b/autoworldmap-common/build.gradle similarity index 100% rename from common/build.gradle rename to autoworldmap-common/build.gradle diff --git a/common/gradle.properties b/autoworldmap-common/gradle.properties similarity index 100% rename from common/gradle.properties rename to autoworldmap-common/gradle.properties diff --git a/common/src/main/java/top/catowncraft/autoworldmap/common/SharedConstant.java b/autoworldmap-common/src/main/java/top/catowncraft/autoworldmap/common/SharedConstant.java similarity index 74% rename from common/src/main/java/top/catowncraft/autoworldmap/common/SharedConstant.java rename to autoworldmap-common/src/main/java/top/catowncraft/autoworldmap/common/SharedConstant.java index 8fa325c..764c9e0 100644 --- a/common/src/main/java/top/catowncraft/autoworldmap/common/SharedConstant.java +++ b/autoworldmap-common/src/main/java/top/catowncraft/autoworldmap/common/SharedConstant.java @@ -22,19 +22,19 @@ public class SharedConstant { public static final String XAERO_MINI_MAP_CHANNEL = XAERO_MINI_MAP_NAMESPACE + ":" + XAERO_MINI_MAP_NAME; @Getter - private static final String pluginAuthor = "{plugin_author_string}"; + private static final String pluginAuthor = "The-Cat-Town-Craft, Hendrix-Shen"; @Getter - private static final String pluginDescription = "{plugin_description}"; + private static final String pluginDescription = "Automatic map switching for VoxelMap, XaeroMap when switching servers."; @Getter - private static final String pluginID = "{plugin_id}"; + private static final String pluginID = "auto-world-map"; @Getter - private static final String pluginName = "{plugin_name}"; + private static final String pluginName = "AutoWorldMap"; @Getter - private static final String pluginPermissionRoot = "{plugin_permission_root}"; + private static final String pluginPermissionRoot = "autoworldmap"; @Getter - private static final String pluginUrl = "{plugin_url}"; + private static final String pluginUrl = "https://github.com/The-Cat-Town-Craft/Auto-World-Map"; @Getter - private static final String pluginVersion = "{plugin_version}"; + private static final String pluginVersion = "@PLUGIN_VERSION@"; public static final List CONFIG_HEADER = Arrays.asList( " ==================================================", diff --git a/common/src/main/java/top/catowncraft/autoworldmap/common/command/AutoWorldMapCommand.java b/autoworldmap-common/src/main/java/top/catowncraft/autoworldmap/common/command/AutoWorldMapCommand.java similarity index 100% rename from common/src/main/java/top/catowncraft/autoworldmap/common/command/AutoWorldMapCommand.java rename to autoworldmap-common/src/main/java/top/catowncraft/autoworldmap/common/command/AutoWorldMapCommand.java diff --git a/common/src/main/java/top/catowncraft/autoworldmap/common/command/ICommandSender.java b/autoworldmap-common/src/main/java/top/catowncraft/autoworldmap/common/command/ICommandSender.java similarity index 100% rename from common/src/main/java/top/catowncraft/autoworldmap/common/command/ICommandSender.java rename to autoworldmap-common/src/main/java/top/catowncraft/autoworldmap/common/command/ICommandSender.java diff --git a/common/src/main/java/top/catowncraft/autoworldmap/common/config/ConfigManager.java b/autoworldmap-common/src/main/java/top/catowncraft/autoworldmap/common/config/ConfigManager.java similarity index 100% rename from common/src/main/java/top/catowncraft/autoworldmap/common/config/ConfigManager.java rename to autoworldmap-common/src/main/java/top/catowncraft/autoworldmap/common/config/ConfigManager.java diff --git a/common/src/main/java/top/catowncraft/autoworldmap/common/event/IClientboundSetDefaultSpawnPositionEvent.java b/autoworldmap-common/src/main/java/top/catowncraft/autoworldmap/common/event/IClientboundSetDefaultSpawnPositionEvent.java similarity index 100% rename from common/src/main/java/top/catowncraft/autoworldmap/common/event/IClientboundSetDefaultSpawnPositionEvent.java rename to autoworldmap-common/src/main/java/top/catowncraft/autoworldmap/common/event/IClientboundSetDefaultSpawnPositionEvent.java diff --git a/common/src/main/java/top/catowncraft/autoworldmap/common/helper/BlockPos.java b/autoworldmap-common/src/main/java/top/catowncraft/autoworldmap/common/helper/BlockPos.java similarity index 100% rename from common/src/main/java/top/catowncraft/autoworldmap/common/helper/BlockPos.java rename to autoworldmap-common/src/main/java/top/catowncraft/autoworldmap/common/helper/BlockPos.java diff --git a/common/src/main/java/top/catowncraft/autoworldmap/common/helper/PacketCreator.java b/autoworldmap-common/src/main/java/top/catowncraft/autoworldmap/common/helper/PacketCreator.java similarity index 100% rename from common/src/main/java/top/catowncraft/autoworldmap/common/helper/PacketCreator.java rename to autoworldmap-common/src/main/java/top/catowncraft/autoworldmap/common/helper/PacketCreator.java diff --git a/common/src/main/java/top/catowncraft/autoworldmap/common/listener/downstream/ClientboundSetDefaultSpawnPositionListener.java b/autoworldmap-common/src/main/java/top/catowncraft/autoworldmap/common/listener/downstream/ClientboundSetDefaultSpawnPositionListener.java similarity index 100% rename from common/src/main/java/top/catowncraft/autoworldmap/common/listener/downstream/ClientboundSetDefaultSpawnPositionListener.java rename to autoworldmap-common/src/main/java/top/catowncraft/autoworldmap/common/listener/downstream/ClientboundSetDefaultSpawnPositionListener.java diff --git a/common/src/main/java/top/catowncraft/autoworldmap/common/packet/ClientboundSetDefaultSpawnPositionPacket.java b/autoworldmap-common/src/main/java/top/catowncraft/autoworldmap/common/packet/ClientboundSetDefaultSpawnPositionPacket.java similarity index 100% rename from common/src/main/java/top/catowncraft/autoworldmap/common/packet/ClientboundSetDefaultSpawnPositionPacket.java rename to autoworldmap-common/src/main/java/top/catowncraft/autoworldmap/common/packet/ClientboundSetDefaultSpawnPositionPacket.java diff --git a/common/src/main/java/top/catowncraft/autoworldmap/common/util/ByteBufUtil.java b/autoworldmap-common/src/main/java/top/catowncraft/autoworldmap/common/util/ByteBufUtil.java similarity index 100% rename from common/src/main/java/top/catowncraft/autoworldmap/common/util/ByteBufUtil.java rename to autoworldmap-common/src/main/java/top/catowncraft/autoworldmap/common/util/ByteBufUtil.java diff --git a/common/src/main/java/top/catowncraft/autoworldmap/common/util/CommandUtil.java b/autoworldmap-common/src/main/java/top/catowncraft/autoworldmap/common/util/CommandUtil.java similarity index 100% rename from common/src/main/java/top/catowncraft/autoworldmap/common/util/CommandUtil.java rename to autoworldmap-common/src/main/java/top/catowncraft/autoworldmap/common/util/CommandUtil.java diff --git a/autoworldmap-velocity/build.gradle b/autoworldmap-velocity/build.gradle new file mode 100644 index 0000000..34837ba --- /dev/null +++ b/autoworldmap-velocity/build.gradle @@ -0,0 +1,21 @@ +import groovy.json.JsonBuilder +import groovy.json.JsonSlurper + +dependencies { + annotationProcessor("com.velocitypowered:velocity-api:${project.velocity_version}") + compileOnly("com.velocitypowered:velocity-api:${project.velocity_version}") + shade(implementation(project(":autoworldmap-common"))) +} + +tasks.named("classes") { + doLast { + File file = file("build/classes/java/main/velocity-plugin.json") + JsonSlurper slurper = new JsonSlurper() + JsonBuilder builder = new JsonBuilder(slurper.parse(file)) + builder.content.version = project.version + BufferedWriter writer = file.newWriter() + writer.append(builder.toString()) + writer.flush() + writer.close() + } +} \ No newline at end of file diff --git a/velocity/gradle.properties b/autoworldmap-velocity/gradle.properties similarity index 100% rename from velocity/gradle.properties rename to autoworldmap-velocity/gradle.properties diff --git a/velocity/src/main/java/top/catowncraft/autoworldmap/AutoWorldMapVelocity.java b/autoworldmap-velocity/src/main/java/top/catowncraft/autoworldmap/AutoWorldMapVelocity.java similarity index 86% rename from velocity/src/main/java/top/catowncraft/autoworldmap/AutoWorldMapVelocity.java rename to autoworldmap-velocity/src/main/java/top/catowncraft/autoworldmap/AutoWorldMapVelocity.java index 0d0c1ae..e2dec21 100644 --- a/velocity/src/main/java/top/catowncraft/autoworldmap/AutoWorldMapVelocity.java +++ b/autoworldmap-velocity/src/main/java/top/catowncraft/autoworldmap/AutoWorldMapVelocity.java @@ -19,12 +19,12 @@ import java.util.logging.Logger; -@Plugin(id = "{plugin_id}", - name = "{plugin_name}", - version = "{plugin_version}", - url = "{plugin_url}", - description = "{plugin_description}", - authors = {"{plugin_author_list}"}, +@Plugin(id = "auto-world-map", + name = "AutoWorldMap", + version = "@PLUGIN_VERSION@", + url = "https://github.com/The-Cat-Town-Craft/Auto-World-Map", + description = "Automatic map switching for VoxelMap, XaeroMap when switching servers.", + authors = {"The-Cat-Town-Craft", "Hendrix-Shen"}, dependencies = @Dependency(id = "protocolize") ) @Singleton diff --git a/velocity/src/main/java/top/catowncraft/autoworldmap/velocity/command/AutoWorldMapCommandVelocity.java b/autoworldmap-velocity/src/main/java/top/catowncraft/autoworldmap/velocity/command/AutoWorldMapCommandVelocity.java similarity index 100% rename from velocity/src/main/java/top/catowncraft/autoworldmap/velocity/command/AutoWorldMapCommandVelocity.java rename to autoworldmap-velocity/src/main/java/top/catowncraft/autoworldmap/velocity/command/AutoWorldMapCommandVelocity.java diff --git a/velocity/src/main/java/top/catowncraft/autoworldmap/velocity/command/CommandSenderImpl.java b/autoworldmap-velocity/src/main/java/top/catowncraft/autoworldmap/velocity/command/CommandSenderImpl.java similarity index 100% rename from velocity/src/main/java/top/catowncraft/autoworldmap/velocity/command/CommandSenderImpl.java rename to autoworldmap-velocity/src/main/java/top/catowncraft/autoworldmap/velocity/command/CommandSenderImpl.java diff --git a/velocity/src/main/java/top/catowncraft/autoworldmap/velocity/handler/VoxelMapHandler.java b/autoworldmap-velocity/src/main/java/top/catowncraft/autoworldmap/velocity/handler/VoxelMapHandler.java similarity index 100% rename from velocity/src/main/java/top/catowncraft/autoworldmap/velocity/handler/VoxelMapHandler.java rename to autoworldmap-velocity/src/main/java/top/catowncraft/autoworldmap/velocity/handler/VoxelMapHandler.java diff --git a/velocity/src/main/java/top/catowncraft/autoworldmap/velocity/handler/XaeroMapHandler.java b/autoworldmap-velocity/src/main/java/top/catowncraft/autoworldmap/velocity/handler/XaeroMapHandler.java similarity index 100% rename from velocity/src/main/java/top/catowncraft/autoworldmap/velocity/handler/XaeroMapHandler.java rename to autoworldmap-velocity/src/main/java/top/catowncraft/autoworldmap/velocity/handler/XaeroMapHandler.java diff --git a/build.gradle b/build.gradle index c36414c..c068729 100644 --- a/build.gradle +++ b/build.gradle @@ -1,34 +1,50 @@ +import org.objectweb.asm.ClassReader +import org.objectweb.asm.ClassWriter +import org.objectweb.asm.tree.ClassNode +import org.objectweb.asm.tree.LdcInsnNode +import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar + plugins { id("java") - id("com.github.johnrengelman.shadow").version("7.1.2") - id("net.kyori.blossom").version("1.3.1") + id("com.github.johnrengelman.shadow").version("8.1.1") } allprojects { apply(plugin: "java") apply(plugin: "com.github.johnrengelman.shadow") - apply(plugin: "net.kyori.blossom") + + configurations { + register("shade") + register("shadeOnly") + + compileOnly.extendsFrom(shade) + } repositories { mavenCentral() + maven { - name("JitPack Maven") + name("JitPack") url("https://jitpack.io") } maven { - name("Exceptionflug Maven") + name("Exceptionflug") url("https://mvn.exceptionflug.de/repository/exceptionflug-public") } maven { - name("PaperMC Maven") + name("PaperMC") url("https://repo.papermc.io/repository/maven-public") } } + dependencies { annotationProcessor("org.projectlombok:lombok:${project.lombok_version}") compileOnly("org.projectlombok:lombok:${project.lombok_version}") compileOnly("dev.simplix:protocolize-api:${project.protocolize_version}") - implementation("com.github.simplix-softworks:simplixstorage:${project.simplixstorage_version}") + compileOnly("com.github.simplix-softworks:simplixstorage:${project.simplixstorage_version}") + shadeOnly("com.github.simplix-softworks:simplixstorage:${project.simplixstorage_version}") { + transitive = false + } } group = project.maven_group @@ -48,70 +64,159 @@ allprojects { realVersion += "-dev" } - version = realVersion - description = project.plugin_description + description(project.plugin_description) - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - tasks.withType(JavaCompile).configureEach { - options.encoding = "UTF-8" + base { + if (project.name != rootProject.name) { + archivesBaseName("${rootProject.name}${project.name.replace("${project.plugin_name}".toLowerCase(), "")}") + } + + version(realVersion) } - blossom { - replaceToken("{plugin_author_list}", project.plugin_author.replaceAll(", ", "\", \"")) - replaceToken("{plugin_author_string}", project.plugin_author) - replaceToken("{plugin_description}", project.plugin_description) - replaceToken("{plugin_id}", project.plugin_id) - replaceToken("{plugin_name}", project.plugin_name) - replaceToken("{plugin_permission_root}", project.plugin_id.replaceAll("-", "")) - replaceToken("{plugin_url}", project.plugin_url) - replaceToken("{plugin_version}", version) + java { + sourceCompatibility(JavaVersion.VERSION_1_8) + targetCompatibility(JavaVersion.VERSION_1_8) + + withSourcesJar() } - shadowJar { - from("LICENSE") + tasks.withType(JavaCompile).configureEach { + options.encoding("UTF-8") + } - dependencies { - exclude(dependency("com.esotericsoftware.yamlbeans:yamlbeans:.*")) - exclude(dependency("org.jetbrains:annotations:.*")) - exclude(dependency("org.json:json:.*")) - } + tasks.named("shadowJar") { ShadowJar task -> + task.from("LICENSE") + + task.configurations.clear() + task.configurations.add(project.configurations.shade) + task.configurations.add(project.configurations.shadeOnly) + + task.exclude("META-INF/maven/**/*", "META-INF/*.txt") + task.relocate("de.leonhard.storage", "${project.maven_group.replaceAll("-", "")}.lib.de.leonhard.storage") - relocate("de.leonhard.storage", "${project.maven_group}.${project.plugin_id.replaceAll("-", "")}.lib.de.leonhard.storage") // Remove '-all' suffix - classifier(null) + task.archiveClassifier.set(null) + } - if (project.name != rootProject.name) { - archiveBaseName.set("${rootProject.name}${project.name.replace("${project.plugin_name}".toLowerCase(), "")}") + tasks.named("assemble") { task -> + task.dependsOn(tasks.shadowJar) + } + + Map replaceTokenMap = new HashMap<>() + replaceTokenMap.put("@PLUGIN_VERSION@", project.version) + List replaceTokenFile = new ArrayList<>() + replaceTokenFile.add("AutoWorldMapVelocity") + replaceTokenFile.add("SharedConstant") + + tasks.named("classes") { + doLast { + File dir = file("${projectDir}/build/classes/java") + + if (!dir.exists()) { + return + } + + dir.eachFileRecurse { + String path = it.path.replace(dir.path, "") + + if (path.endsWith(".class") && replaceTokenFile.stream().anyMatch { path.contains(it as String) }) { + ClassReader cr = new ClassReader(it.newInputStream().bytes) + ClassNode cn = new ClassNode() + cr.accept(cn, ClassReader.SKIP_FRAMES | ClassReader.SKIP_DEBUG) + + // ReplaceToken in fields + cn.fields.each { + if (it.desc == "Ljava/lang/String;" && it.value instanceof String) { + String value = it.value as String + + replaceTokenMap.each { + value = value.replace(it.key as String, it.value as String) + } + + it.value = value + } + } + + // ReplaceToken in methods + cn.methods.each { + it.instructions.each { + if (it instanceof LdcInsnNode) { + LdcInsnNode ldc = it as LdcInsnNode + + if (ldc.cst instanceof String) { + String value = ldc.cst as String + + replaceTokenMap.each { + value = value.replace(it.key as String, it.value as String) + } + + ldc.cst = value + } + } + } + } + + // ReplaceToken in class annotations + if (cn.visibleAnnotations != null) { + cn.visibleAnnotations.forEach { + if (it.values != null) { + // Skip keys + for (int i = 1; i < it.values.size(); i += 2) { + Object value = it.values.get(i) + + if (value instanceof String) { + replaceTokenMap.each { + value = value.replace(it.key as String, it.value as String) + } + + it.values.set(i, value) + } + } + } + } + } + + ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_FRAMES) + cn.accept(cw) + new FileOutputStream(it).write(cw.toByteArray()) + } + } + + dir = file("${projectDir}/build/classes/java") } } } -shadowJar { +tasks.named("shadowJar") { ShadowJar task -> // Disable cache outputs.upToDateWhen { false } + dependsOn(project.subprojects.collect { // Possible solution, it works. - it.name == "${project.plugin_id.replaceAll("-", "")}-common" ? it.tasks.jar : it.tasks.shadowJar + it.name == "autoworldmap-common" ? it.tasks.jar : it.tasks.shadowJar }) doFirst { // Clean up legacy files. delete fileTree("build/tmp/merged") + copy { from { project.subprojects.collect { - "${it.buildDir}/classes/java/main" + "${it.projectDir}/build/classes/java/main" } } + from { project.subprojects.collect { - "${it.buildDir}/resources/main" + "${it.projectDir}/build/resources/main" } } + into("build/tmp/merged") } } - from("build/tmp/merged") -} \ No newline at end of file + task.from("build/tmp/merged") +} diff --git a/gradle.properties b/gradle.properties index e302fe8..df38b3f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ # Plugin reference -maven_group=top.catowncraft +maven_group=top.catowncraft.auto-world-map plugin_author=The-Cat-Town-Craft, Hendrix-Shen plugin_name=AutoWorldMap plugin_version=1.3 @@ -8,6 +8,6 @@ plugin_id=auto-world-map plugin_url=https://github.com/The-Cat-Town-Craft/Auto-World-Map # Development Environment -lombok_version=1.18.28 -protocolize_version=2.2.5 -simplixstorage_version=3.2.6 \ No newline at end of file +lombok_version=1.18.30 +protocolize_version=2.3.1 +simplixstorage_version=3.2.7 \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 7454180..7f93135 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 070cb70..e411586 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 1b6c787..1aa94a4 100644 --- a/gradlew +++ b/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -80,13 +80,11 @@ do esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -133,22 +131,29 @@ location of your Java installation." fi else JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac case $MAX_FD in #( '' | soft) :;; #( *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -193,11 +198,15 @@ if "$cygwin" || "$msys" ; then done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ @@ -205,6 +214,12 @@ set -- \ org.gradle.wrapper.GradleWrapperMain \ "$@" +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + # Use "xargs" to parse quoted args. # # With -n1 it outputs one arg per line, with the quotes and backslashes removed. diff --git a/gradlew.bat b/gradlew.bat index 107acd3..93e3f59 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -40,7 +41,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/settings.gradle b/settings.gradle index da8f679..22a2498 100644 --- a/settings.gradle +++ b/settings.gradle @@ -14,6 +14,4 @@ def modules = Arrays.asList( for (String module : modules) { include(":autoworldmap-$module") - def proj = project(":autoworldmap-$module") - proj.projectDir = file("$module") } \ No newline at end of file diff --git a/velocity/build.gradle b/velocity/build.gradle deleted file mode 100644 index eb7bc74..0000000 --- a/velocity/build.gradle +++ /dev/null @@ -1,5 +0,0 @@ -dependencies { - annotationProcessor("com.velocitypowered:velocity-api:${project.velocity_version}") - compileOnly("com.velocitypowered:velocity-api:${project.velocity_version}") - implementation(project(":autoworldmap-common")) -} \ No newline at end of file