Skip to content

Commit 16a4c8f

Browse files
authored
Update to Minecraft 26.1 (#385)
Also fixes issues with saving default Bukkit data Closes #384 Closes #389
1 parent 7f42169 commit 16a4c8f

122 files changed

Lines changed: 3137 additions & 2338 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,12 @@ jobs:
2020
- uses: actions/setup-java@v5
2121
with:
2222
distribution: 'temurin'
23-
java-version: '21'
24-
25-
# We can't use 'maven' prebuilt cache setup because it requires that the project have a pom file.
26-
# BuildTools installs to Maven local if available, so it's easier to just rely on that.
27-
- name: Cache Spigot dependency
28-
uses: actions/cache@v5
29-
with:
30-
path: |
31-
~/.m2/repository/org/spigotmc/
32-
key: ${{ runner.os }}-buildtools-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
33-
restore-keys: |
34-
${{ runner.os }}-buildtools-
23+
java-version: '25'
3524

3625
- uses: gradle/actions/setup-gradle@v5
3726

3827
- name: Build with Gradle
39-
run: ./gradlew clean build
28+
run: ./gradlew build
4029

4130
# Upload artifacts
4231
- name: Upload Distributable Jar

addon/togglepersist/build.gradle.kts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
1-
plugins {
2-
`openinv-base`
1+
repositories {
2+
mavenCentral()
3+
maven("https://hub.spigotmc.org/nexus/content/groups/public/")
34
}
45

56
dependencies {
7+
compileOnly(libs.spigotapi)
68
implementation(project(":openinvapi"))
79
}
810

11+
java {
12+
toolchain.languageVersion = JavaLanguageVersion.of(21)
13+
}
14+
15+
tasks.withType<JavaCompile>().configureEach {
16+
options.release = 21
17+
}
18+
919
tasks.processResources {
1020
expand("version" to version)
1121
}

api/build.gradle.kts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,24 @@
11
plugins {
2-
`openinv-base`
32
`maven-publish`
43
}
54

5+
repositories {
6+
mavenCentral()
7+
maven("https://hub.spigotmc.org/nexus/content/groups/public/")
8+
}
9+
10+
dependencies {
11+
compileOnly(libs.spigotapi)
12+
}
13+
14+
java {
15+
toolchain.languageVersion = JavaLanguageVersion.of(21)
16+
}
17+
18+
tasks.withType<JavaCompile>().configureEach {
19+
options.release = 21
20+
}
21+
622
publishing {
723
publications {
824
create<MavenPublication>("jitpack") {

build.gradle.kts

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,40 @@ plugins {
22
`java-library`
33
alias(libs.plugins.paperweight) apply false
44
alias(libs.plugins.shadow) apply false
5-
id(libs.plugins.errorprone.gradle.get().pluginId) apply false
5+
alias(libs.plugins.errorprone.gradle)
66
}
77

8-
// Set by Spigot module, used by Paper module to convert to Spigot's version of Mojang mappings.
9-
project.ext.set("craftbukkitPackage", "UNKNOWN")
10-
118
repositories {
129
maven("https://repo.papermc.io/repository/maven-public/")
1310
}
1411

1512
// Allow submodules to target higher Java release versions.
16-
// Not currently necessary (as lowest supported version is in the 1.21 range)
17-
// but may become relevant in the future.
1813
java.disableAutoTargetJvm()
1914

15+
subprojects {
16+
apply(plugin = "java-library")
17+
apply(plugin = rootProject.libs.plugins.errorprone.gradle.get().pluginId)
18+
19+
repositories {
20+
mavenCentral()
21+
}
22+
23+
dependencies {
24+
compileOnly(rootProject.libs.jspecify)
25+
compileOnly(rootProject.libs.annotations)
26+
errorprone(rootProject.libs.errorprone.core)
27+
}
28+
29+
tasks {
30+
withType<JavaCompile>().configureEach {
31+
options.encoding = Charsets.UTF_8.name()
32+
}
33+
withType<Javadoc>().configureEach {
34+
options.encoding = Charsets.UTF_8.name()
35+
}
36+
}
37+
}
38+
2039
// Task to delete ./dist where final files are output.
2140
tasks.register("cleanDist") {
2241
delete("dist")

buildSrc/build.gradle.kts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,3 @@ repositories {
66
gradlePluginPortal()
77
mavenCentral()
88
}
9-
10-
dependencies {
11-
val libs = project.extensions.getByType(VersionCatalogsExtension::class.java).named("libs")
12-
implementation(libs.findLibrary("specialsource").orElseThrow())
13-
implementation(libs.findLibrary("errorprone-gradle").orElseThrow())
14-
}

buildSrc/settings.gradle.kts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +0,0 @@
1-
dependencyResolutionManagement {
2-
versionCatalogs {
3-
create("libs") {
4-
from(files("../gradle/libs.versions.toml"))
5-
}
6-
}
7-
}

buildSrc/src/main/kotlin/com/github/jikoo/openinv/BuildToolsValueSource.kt

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ abstract class BuildToolsValueSource : ValueSource<File, BuildToolsValueSource.P
1616
abstract val exec: ExecOperations
1717

1818
interface Parameters : ValueSourceParameters {
19-
val mavenLocal: Property<File>
19+
val installDir: DirectoryProperty
2020
val workingDir: DirectoryProperty
2121

2222
val spigotVersion: Property<String>
@@ -31,11 +31,11 @@ abstract class BuildToolsValueSource : ValueSource<File, BuildToolsValueSource.P
3131
override fun obtain(): File {
3232
val version = parameters.spigotVersion.get()
3333
val revision = parameters.spigotRevision.get()
34-
val installLocation = getInstallLocation(version)
34+
val spigotLocation = parameters.installDir.get().asFile.resolve("spigot-$version.jar")
3535
// If Spigot is already installed, don't reinstall.
36-
if (!parameters.ignoreCached.get() && installLocation.exists()) {
36+
if (!parameters.ignoreCached.get() && spigotLocation.exists()) {
3737
println("Skipping Spigot installation, $version is present")
38-
return installLocation
38+
return spigotLocation
3939
}
4040

4141
val buildTools = installBuildTools(parameters.workingDir.get().asFile)
@@ -47,22 +47,29 @@ abstract class BuildToolsValueSource : ValueSource<File, BuildToolsValueSource.P
4747
executable = parameters.javaExecutable.get()
4848
workingDir = buildTools.parentFile
4949
classpath(buildTools)
50-
args = listOf("--nogui", "--rev", revision, "--remapped")
50+
args = listOf("--nogui", "--rev", revision)
5151
}.rethrowFailure()
5252

53+
val spigotBuild = buildTools.parentFile.resolve("Spigot/Spigot-Server/target/spigot-$version.jar")
54+
55+
if (!spigotBuild.exists()) {
56+
throw IllegalStateException(
57+
"Spigot build completed, but $spigotBuild does not exist! Did BuildTools change output location?"
58+
)
59+
}
60+
61+
spigotBuild.copyTo(spigotLocation, overwrite = true)
62+
5363
// Mark work for delete.
5464
cleanUp(buildTools.parentFile)
5565

56-
if (!installLocation.exists()) {
66+
if (!spigotLocation.exists()) {
5767
throw IllegalStateException(
5868
"Failed to install Spigot $version from $revision. Does the revision point to a different version?"
5969
)
6070
}
61-
return installLocation
62-
}
6371

64-
private fun getInstallLocation(version: String): File {
65-
return parameters.mavenLocal.get().resolve("org/spigotmc/spigot/$version/spigot-$version-remapped-mojang.jar")
72+
return spigotLocation
6673
}
6774

6875
private fun installBuildTools(workingDir: File): File {

buildSrc/src/main/kotlin/com/github/jikoo/openinv/SpigotDependencyExtension.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ abstract class SpigotDependencyExtension(
1212
.convention(version.map {
1313
it.replace("-R\\d+\\.\\d+-SNAPSHOT".toRegex(), "")
1414
})
15-
val classifier = objects.property(String::class.java).convention("remapped-mojang")
15+
val classifier = objects.property(String::class.java).convention("")
1616
val java = objects.property(JavaToolchainSpec::class.java)
1717
val ignoreCached = objects.property(Boolean::class.java).convention(false)
1818

buildSrc/src/main/kotlin/com/github/jikoo/openinv/SpigotReobf.kt

Lines changed: 0 additions & 56 deletions
This file was deleted.

buildSrc/src/main/kotlin/com/github/jikoo/openinv/SpigotReobfTask.kt

Lines changed: 0 additions & 85 deletions
This file was deleted.

0 commit comments

Comments
 (0)