Skip to content

Commit

Permalink
Update to Spigot 1.20.4, Java 17, and Gradle 8
Browse files Browse the repository at this point in the history
  • Loading branch information
cjburkey01 committed May 1, 2024
1 parent a76a096 commit 997848d
Show file tree
Hide file tree
Showing 36 changed files with 696 additions and 191 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,24 @@
![ClaimChunk Title](imgs/logo_carrier.png)

[![Version Info](https://img.shields.io/static/v1?label=Version&message=0.0.23-RC8&color=blueviolet&style=for-the-badge)](https://github.com/cjburkey01/ClaimChunk/releases)
[![Download Info](https://img.shields.io/static/v1?label=Spigot&message=1.19.2&color=blueviolet&style=for-the-badge)](https://www.spigotmc.org/resources/claimchunk.44458/)
[![Download Info](https://img.shields.io/static/v1?label=Spigot&message=1.20.6&color=blueviolet&style=for-the-badge)](https://www.spigotmc.org/resources/claimchunk.44458/)
[![Servers Using Claimchunk](https://img.shields.io/bstats/servers/5179?label=Servers&color=cornflowerblue&style=for-the-badge)](https://bstats.org/plugin/bukkit/ClaimChunk)
[![Players Using Claimchunk](https://img.shields.io/bstats/players/5179?label=Players&color=cornflowerblue&style=for-the-badge)](https://bstats.org/plugin/bukkit/ClaimChunk)

**Join us on our [Discord server](https://discord.gg/swW8xX665Z) for bug reports, support, and general chatting!**

Info
----
Spigot plugin for 1.17+ allowing the claiming of chunks.
Spigot plugin for 1.20+ allowing the claiming of chunks.

*The destiny of chunks is to unite not to divide*<br />
*Let's make the world ours.*

Usage and more information can be found [on the wiki](https://github.com/cjburkey01/ClaimChunk/wiki).

* **1.17 - 1.19.2** | The latest version works seamlessly.
* **1.20-1.20.6+** | The latest version works seamlessly (excluding bugs, of course).
* **1.17 - 1.20** | The latest *known* working version is [0.0.23-RC8](https://github.com/cjburkey01/ClaimChunk/releases/tag/0.0.23-RC8).
* Newer versions of the plugin will require Java 17, but may still work.
* **1.13 - 1.16.5** | The latest working version is [0.0.22](https://github.com/cjburkey01/ClaimChunk/releases/tag/0.0.22).
* Note: If you disable titles, 0.0.23 might work on version older than 1.17. If you experience issues, however, they may be more difficult to address.
* **Pre-1.13** | The latest working version is [0.0.20](https://github.com/cjburkey01/ClaimChunk/releases/tag/0.0.20)
Expand Down
59 changes: 30 additions & 29 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import de.undercouch.gradle.tasks.download.Download;
plugins {
java;

id("de.undercouch.download") version "5.3.0";
id("io.freefair.lombok") version "6.5.1";
id("de.undercouch.download") version "5.6.0";
id("io.freefair.lombok") version "8.6";
// Including dependencies in final jar
id("com.github.johnrengelman.shadow") version "7.1.2";
id("com.github.johnrengelman.shadow") version "8.1.1";
}

object DepData {
Expand All @@ -23,21 +23,23 @@ object DepData {
// Only used if you run `gradlew installSpigot`
const val SPIGOT_BUILD_TOOLS_URL
= "https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar";
const val SPIGOT_REV = "1.20.4";

// Dependency versions
const val BUKKIT_VERSION = "1.19.2-R0.1-SNAPSHOT";
const val SPIGOT_VERSION = "1.19.2-R0.1-SNAPSHOT";
const val LATEST_MC_VERSION = "1.19.2";
const val BUKKIT_VERSION = "1.20.4-R0.1-SNAPSHOT";
const val SPIGOT_VERSION = "1.20.4-R0.1-SNAPSHOT";
const val LATEST_MC_VERSION = "1.20.6";
const val VAULT_API_VERSION = "1.7";
const val WORLD_EDIT_CORE_VERSION = "7.2.9";
const val WORLD_GUARD_BUKKIT_VERSION = "7.0.7";
const val PLACEHOLDER_API_VERSION = "2.11.1";
const val JETBRAINS_ANNOTATIONS_VERSION = "23.0.0";
const val JUNIT_VERSION = "5.9.0";
const val JUNIT_VERSION = "5.10.2";
const val JUNIT_LAUNCHER_VERSION = "1.10.2";
// Goldmensch's SmartCommandDispatcher. Thank you!!
const val SMART_COMMAND_DISPATCHER_VERSION = "2.0.1";
// const val SMART_COMMAND_DISPATCHER_VERSION = "2.0.1";
// And internationalization library!
const val JALL_I18N_VERSION = "1.0.2"
// const val JALL_I18N_VERSION = "1.0.2"

// Directories
const val TEST_SERVER_DIR = "run";
Expand Down Expand Up @@ -66,9 +68,10 @@ version = DepData.THIS_VERSION;

val mainDir = layout.projectDirectory;

// Use Java 16 (17 was too restrictive)
extensions.configure<JavaPluginExtension> {
toolchain.languageVersion.set(JavaLanguageVersion.of(16));
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17);
}
}

tasks {
Expand Down Expand Up @@ -97,11 +100,11 @@ tasks {

// Move SmartCommandDispatcher to a unique package to avoid clashes with
// any other plugins that might include it in their jar files.
relocate("de.goldmensch.commanddispatcher",
"claimchunk.dependency.de.goldmensch.commanddispatcher");
// relocate("de.goldmensch.commanddispatcher",
// "claimchunk.dependency.de.goldmensch.commanddispatcher");
// Do the same with JALL
relocate("io.github.goldmensch.jall",
"claimchunk.dependency.io.github.goldmensch.jall");
// relocate("io.github.goldmensch.jall",
// "claimchunk.dependency.io.github.goldmensch.jall");
}

test {
Expand Down Expand Up @@ -142,7 +145,7 @@ tasks {

// Fill in readme placeholders
register<Copy>("updateReadme") {
mustRunAfter("shadowJar");
mustRunAfter("shadowJar", "build");
description = "Expands tokens in the unbuilt readme file into the main readme file";

val inf = mainDir.file(DepData.README_IN);
Expand Down Expand Up @@ -190,16 +193,16 @@ tasks {

val testServerDir = mainDir.dir(DepData.TEST_SERVER_DIR);
val tmpDir = testServerDir.dir("TEMP");
val tmpServerJar = tmpDir.file("spigot-${DepData.LATEST_MC_VERSION}.jar");
val tmpServerJar = tmpDir.file("spigot-${DepData.SPIGOT_REV}.jar");

// Run the build tools jar (the manifest main class)
mainClass.set("-jar");
workingDir(tmpDir);
args("BuildTools.jar");
args("BuildTools.jar", "--nogui", "--rev", DepData.SPIGOT_REV);

doLast {
println("Cleaning up Spigot build");
tmpServerJar.asFile.copyTo(testServerDir.file("spigot-${DepData.LATEST_MC_VERSION}.jar").asFile, true);
tmpServerJar.asFile.copyTo(testServerDir.file("spigot-${DepData.SPIGOT_REV}.jar").asFile, true);
tmpDir.asFile.deleteRecursively();
}
}
Expand Down Expand Up @@ -239,14 +242,12 @@ tasks {
description = "Attempts to format source files for ClaimChunk to unify programming style.";

// For now, this file is just included with the project for the sake of
// ease of use. Perhaps I should release an updated version of the
// plugin someone else developed, it's outdated and wouldn't work.
// (Hence my reinventing the broken wheel here)
val execJarFile = mainDir.file("req/google-java-format-1.11.0-all-deps.jar");
// ease of use.
val execJarFile = mainDir.file("req/google-java-format-1.22.0-all-deps.jar");

// Include all source Java files
// (I don't think there's a case where I would want to avoid formatting
// a file, but be it necessary, this is where it would be implemented.
// a file, but be it necessary, this is where it would be implemented)
val includedFiles = fileTree("src") {
include("**/*.java")
}.files;
Expand Down Expand Up @@ -301,10 +302,10 @@ dependencies {
compileOnly("me.clip:placeholderapi:${DepData.PLACEHOLDER_API_VERSION}");

// Dependencies that needs to be shaded into the final jar
implementation("de.goldmensch:SmartCommandDispatcher:${DepData.SMART_COMMAND_DISPATCHER_VERSION}");
implementation("io.github.goldmensch:JALL:${DepData.JALL_I18N_VERSION}");
// implementation("de.goldmensch:SmartCommandDispatcher:${DepData.SMART_COMMAND_DISPATCHER_VERSION}");
// implementation("io.github.goldmensch:JALL:${DepData.JALL_I18N_VERSION}");


testCompileOnly("org.junit.jupiter:junit-jupiter-api:${DepData.JUNIT_VERSION}");
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${DepData.JUNIT_VERSION}");
testImplementation("org.junit.jupiter:junit-jupiter:${DepData.JUNIT_VERSION}");
testRuntimeOnly("org.junit.platform:junit-platform-launcher:${DepData.JUNIT_LAUNCHER_VERSION}");
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 997848d

Please sign in to comment.