From 444ccda807106dd89a0dee2ba44654e095fccd16 Mon Sep 17 00:00:00 2001 From: Alexander Brandes Date: Fri, 9 Jun 2023 13:22:55 +0200 Subject: [PATCH] Add support for 1.20 (#4061) 1.20 fixes --- .github/ISSUE_TEMPLATE/bug_report.yml | 2 ++ Bukkit/build.gradle.kts | 2 +- Core/build.gradle.kts | 4 ++-- Core/src/main/java/com/plotsquared/core/command/Music.java | 2 +- .../plotsquared/core/configuration/file/YamlConstructor.java | 2 ++ .../plotsquared/core/configuration/file/YamlRepresenter.java | 2 ++ build.gradle.kts | 4 ++-- 7 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index ddc9a2a87..5c3989d6c 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -27,6 +27,8 @@ body: description: Which server version version you using? If your server version is not listed, it is not supported. Update to a supported version first. multiple: false options: + - '1.20' + - '1.19.4' - '1.19.3' - '1.19.2' - '1.19.1' diff --git a/Bukkit/build.gradle.kts b/Bukkit/build.gradle.kts index 9026376d1..abc3cea42 100644 --- a/Bukkit/build.gradle.kts +++ b/Bukkit/build.gradle.kts @@ -103,7 +103,7 @@ tasks { opt.links("https://jd.papermc.io/paper/1.19/") opt.links("https://docs.enginehub.org/javadoc/com.sk89q.worldedit/worldedit-bukkit/" + libs.worldeditBukkit.get().versionConstraint.toString()) opt.links("https://intellectualsites.github.io/plotsquared-javadocs/core/") - opt.links("https://jd.advntr.dev/api/4.12.0/") + opt.links("https://jd.advntr.dev/api/4.14.0/") opt.links("https://google.github.io/guice/api-docs/" + libs.guice.get().versionConstraint.toString() + "/javadoc/") opt.links("https://checkerframework.org/api/") opt.isLinkSource = true diff --git a/Core/build.gradle.kts b/Core/build.gradle.kts index 8d48f143b..c7b2172ac 100644 --- a/Core/build.gradle.kts +++ b/Core/build.gradle.kts @@ -68,8 +68,8 @@ tasks { val isRelease = if (rootProject.version.toString().endsWith("-SNAPSHOT")) "TODO" else rootProject.version.toString() val opt = options as StandardJavadocDocletOptions opt.links("https://docs.enginehub.org/javadoc/com.sk89q.worldedit/worldedit-core/" + libs.worldeditCore.get().versionConstraint.toString()) - opt.links("https://jd.advntr.dev/api/4.12.0/") - opt.links("https://jd.advntr.dev/text-minimessage/4.12.0/") + opt.links("https://jd.advntr.dev/api/4.14.0/") + opt.links("https://jd.advntr.dev/text-minimessage/4.14.0/") opt.links("https://google.github.io/guice/api-docs/" + libs.guice.get().versionConstraint.toString() + "/javadoc/") opt.links("https://checkerframework.org/api/") opt.links("https://javadoc.io/doc/com.intellectualsites.informative-annotations/informative-annotations/latest/") diff --git a/Core/src/main/java/com/plotsquared/core/command/Music.java b/Core/src/main/java/com/plotsquared/core/command/Music.java index b31b23e08..d54d089d8 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Music.java +++ b/Core/src/main/java/com/plotsquared/core/command/Music.java @@ -56,7 +56,7 @@ public class Music extends SubCommand { .asList("music_disc_13", "music_disc_cat", "music_disc_blocks", "music_disc_chirp", "music_disc_far", "music_disc_mall", "music_disc_mellohi", "music_disc_stal", "music_disc_strad", "music_disc_ward", "music_disc_11", "music_disc_wait", "music_disc_otherside", - "music_disc_pigstep", "music_disc_5" + "music_disc_pigstep", "music_disc_5", "music_disc_relic" ); private final InventoryUtil inventoryUtil; diff --git a/Core/src/main/java/com/plotsquared/core/configuration/file/YamlConstructor.java b/Core/src/main/java/com/plotsquared/core/configuration/file/YamlConstructor.java index 5133000ec..a64b83b2a 100644 --- a/Core/src/main/java/com/plotsquared/core/configuration/file/YamlConstructor.java +++ b/Core/src/main/java/com/plotsquared/core/configuration/file/YamlConstructor.java @@ -19,6 +19,7 @@ package com.plotsquared.core.configuration.file; import com.plotsquared.core.configuration.serialization.ConfigurationSerialization; +import org.yaml.snakeyaml.LoaderOptions; import org.yaml.snakeyaml.constructor.SafeConstructor; import org.yaml.snakeyaml.error.YAMLException; import org.yaml.snakeyaml.nodes.Node; @@ -30,6 +31,7 @@ import java.util.Map; public class YamlConstructor extends SafeConstructor { YamlConstructor() { + super(new LoaderOptions()); yamlConstructors.put(Tag.MAP, new ConstructCustomObject()); } diff --git a/Core/src/main/java/com/plotsquared/core/configuration/file/YamlRepresenter.java b/Core/src/main/java/com/plotsquared/core/configuration/file/YamlRepresenter.java index bec08795e..bf4eede11 100644 --- a/Core/src/main/java/com/plotsquared/core/configuration/file/YamlRepresenter.java +++ b/Core/src/main/java/com/plotsquared/core/configuration/file/YamlRepresenter.java @@ -21,6 +21,7 @@ package com.plotsquared.core.configuration.file; import com.plotsquared.core.configuration.ConfigurationSection; import com.plotsquared.core.configuration.serialization.ConfigurationSerializable; import com.plotsquared.core.configuration.serialization.ConfigurationSerialization; +import org.yaml.snakeyaml.DumperOptions; import org.yaml.snakeyaml.nodes.Node; import org.yaml.snakeyaml.representer.Representer; @@ -30,6 +31,7 @@ import java.util.Map; class YamlRepresenter extends Representer { YamlRepresenter() { + super(new DumperOptions()); this.multiRepresenters.put(ConfigurationSection.class, new RepresentConfigurationSection()); this.multiRepresenters .put(ConfigurationSerializable.class, new RepresentConfigurationSerializable()); diff --git a/build.gradle.kts b/build.gradle.kts index f6238e23a..7b81441bf 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -77,7 +77,7 @@ subprojects { } dependencies { - implementation(platform("com.intellectualsites.bom:bom-newest:1.27")) + implementation(platform("com.intellectualsites.bom:bom-newest:1.29")) } dependencies { @@ -222,7 +222,7 @@ tasks.getByName("jar") { enabled = false } -val supportedVersions = listOf("1.16.5", "1.17", "1.17.1", "1.18.2", "1.19", "1.19.1", "1.19.2", "1.19.3", "1.19.4") +val supportedVersions = listOf("1.16.5", "1.17", "1.17.1", "1.18.2", "1.19", "1.19.1", "1.19.2", "1.19.3", "1.19.4", "1.20") tasks { supportedVersions.forEach { register("runServer-$it") {