Skip to content

Commit 44823f0

Browse files
authored
GH-801 Java 21 and Minecraft 1.21 support (#801)
* Prepare for Java 21 and MC 1.21 * Prepare for Java 21 and MC 1.21 * Update gradle.properties
1 parent 1af87be commit 44823f0

File tree

8 files changed

+12
-11
lines changed

8 files changed

+12
-11
lines changed

buildSrc/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ repositories {
88

99
dependencies {
1010
implementation("net.kyori:blossom:1.3.1")
11-
implementation("com.github.johnrengelman:shadow:8.1.1")
11+
implementation("io.github.goooler.shadow:shadow-gradle-plugin:8.1.7")
1212
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.0.0")
1313
implementation("net.minecrell:plugin-yml:0.6.0")
1414
}

buildSrc/src/main/kotlin/eternalcode-java.gradle.kts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,11 @@ configurations.named("checkstyle") {
2929

3030

3131
java {
32-
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
32+
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
3333
}
3434

3535
tasks.withType<JavaCompile>() {
3636
options.compilerArgs = listOf("-Xlint:deprecation", "-parameters")
3737
options.encoding = "UTF-8"
38+
options.release = 17
3839
}

buildSrc/src/main/kotlin/eternalcore-shadow-compiler.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ afterEvaluate {
88
plugins {
99
`java-library`
1010
id("net.kyori.blossom")
11-
id("com.github.johnrengelman.shadow")
11+
id("io.github.goooler.shadow")
1212
id("net.minecrell.plugin-yml.bukkit")
1313
}
1414

buildSrc/src/main/kotlin/eternalcore-shadow.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
plugins {
22
`java-library`
33

4-
id("com.github.johnrengelman.shadow")
4+
id("io.github.goooler.shadow")
55
}
66

77
val extension = extensions.create<EternalShadowExtension>("eternalShadow")
@@ -12,4 +12,4 @@ afterEvaluate {
1212
compileOnlyApi(it)
1313
}
1414
}
15-
}
15+
}

eternalcore-api-example/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
plugins {
22
`java-library`
33

4-
id("com.github.johnrengelman.shadow")
4+
id("io.github.goooler.shadow")
55
id("net.minecrell.plugin-yml.bukkit")
66
id("xyz.jpenilla.run-paper") version "2.3.0"
77
}
@@ -40,7 +40,7 @@ bukkit {
4040
}
4141

4242
java {
43-
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
43+
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
4444
}
4545

4646
tasks.withType<JavaCompile> {

eternalcore-core/src/main/java/com/eternalcode/core/EternalCoreEnvironment.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ private void checkSoftware() {
2626
Environment environment = PaperLib.getEnvironment();
2727

2828
if (!environment.isSpigot()) {
29-
this.logger.warning("Your server running on unsupported software, please use Spigot/Paper or their other 1.20+ forks");
29+
this.logger.warning("Your server is running on unsupported software, please use Spigot/Paper or their other 1.20+ forks");
3030
this.logger.warning("We recommend using Paper, download it from https://papermc.io/downloads");
3131
this.logger.warning("WARNING: Supported Minecraft versions are 1.17-1.20x");
3232
return;
@@ -37,7 +37,7 @@ private void checkSoftware() {
3737
return;
3838
}
3939

40-
this.logger.info("Your server running on supported software, congratulations!");
40+
this.logger.info("Your server is running on supported software, congratulations!");
4141
this.logger.info("Server version: " + environment.getMinecraftVersion());
4242
}
4343

eternalcore-core/src/main/java/com/eternalcode/core/util/ReflectUtil.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import com.google.common.base.Preconditions;
44
import com.google.common.reflect.ClassPath;
5+
56
import java.io.IOException;
67
import java.util.ArrayList;
78
import java.util.LinkedHashSet;
@@ -37,7 +38,7 @@ public static List<Class<?>> scanClasses(String packageToScan, ClassLoader class
3738
loadedClasses.add(clazz);
3839
}
3940
catch (NoClassDefFoundError ignored) {
40-
LOGGER.severe("Can not load class: " + info.getName());
41+
LOGGER.severe("Unable to load class: " + info.getName());
4142
}
4243
}
4344

gradle.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@
22

33
org.gradle.parallel=true
44
org.gradle.caching=true
5-

0 commit comments

Comments
 (0)