Skip to content

Commit 457b876

Browse files
feat: 1.21.11 (#3397)
1 parent 7976c80 commit 457b876

File tree

42 files changed

+11358
-31
lines changed

Some content is hidden

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

42 files changed

+11358
-31
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ body:
2727
description: Which server version version you using? If your server version is not listed, it is not supported. Update to a supported version first.
2828
multiple: false
2929
options:
30+
- '1.21.11'
3031
- '1.21.10'
31-
- '1.21.9'
3232
- '1.21.8'
3333
- '1.21.7'
3434
- '1.21.6'

build-logic/src/main/kotlin/buildlogic.adapter.gradle.kts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ plugins {
1010

1111
paperweight {
1212
injectPaperRepository = false
13-
reobfArtifactConfiguration = io.papermc.paperweight.userdev.ReobfArtifactConfiguration.REOBF_PRODUCTION
13+
// TODO: switch back to REOBF when paper releases mappings
14+
reobfArtifactConfiguration = io.papermc.paperweight.userdev.ReobfArtifactConfiguration.MOJANG_PRODUCTION
1415
}
1516

1617
repositories {
@@ -52,9 +53,10 @@ dependencies {
5253
}
5354
}
5455

55-
tasks.named("assemble") {
56+
// TODO: re-enable when paper releases mappings
57+
/* tasks.named("assemble") {
5658
dependsOn("reobfJar")
57-
}
59+
} */
5860

5961
tasks.named<Javadoc>("javadoc") {
6062
enabled = false

build.gradle.kts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ allprojects {
9393
}
9494
}
9595

96-
val supportedVersions: List<String> = listOf("1.20.4", "1.20.5", "1.20.6", "1.21", "1.21.1", "1.21.4", "1.21.5", "1.21.8", "1.21.10")
96+
val supportedVersions: List<String> = listOf("1.20.4", "1.20.5", "1.20.6", "1.21", "1.21.1", "1.21.4", "1.21.5",
97+
"1.21.8", "1.21.10", "1.21.11")
9798

9899
tasks {
99100
supportedVersions.forEach {

settings.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ includeBuild("build-logic")
5555

5656
include("worldedit-libs")
5757

58-
listOf("1_20_2", "1_20_4", "1_20_5", "1_21", "1_21_4", "1_21_5", "1_21_6", "1_21_9").forEach {
58+
listOf("1_20_2", "1_20_4", "1_20_5", "1_21", "1_21_4", "1_21_5", "1_21_6", "1_21_9", "1_21_11").forEach {
5959
include("worldedit-bukkit:adapters:adapter-$it")
6060
}
6161

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import io.papermc.paperweight.userdev.PaperweightUserDependenciesExtension
2+
3+
plugins {
4+
id("buildlogic.adapter")
5+
}
6+
7+
configurations {
8+
all {
9+
resolutionStrategy {
10+
capabilitiesResolution {
11+
withCapability("org.lz4:lz4-java") {
12+
selectHighestVersion()
13+
}
14+
}
15+
}
16+
}
17+
}
18+
19+
dependencies {
20+
// https://repo.papermc.io/service/rest/repository/browse/maven-public/io/papermc/paper/dev-bundle/
21+
the<PaperweightUserDependenciesExtension>().paperDevBundle("1.21.11-R0.1-20251209.225848-3")
22+
compileOnly(libs.paperLib)
23+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
/*
2+
* WorldEdit, a Minecraft world manipulation toolkit
3+
* Copyright (C) sk89q <http://www.sk89q.com>
4+
* Copyright (C) WorldEdit team and contributors
5+
*
6+
* This program is free software: you can redistribute it and/or modify
7+
* it under the terms of the GNU General Public License as published by
8+
* the Free Software Foundation, either version 3 of the License, or
9+
* (at your option) any later version.
10+
*
11+
* This program is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
* GNU General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU General Public License
17+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
18+
*/
19+
20+
package com.sk89q.worldedit.bukkit.adapter.ext.fawe.v1_21_11;
21+
22+
import com.google.gson.Gson;
23+
import com.google.gson.GsonBuilder;
24+
import com.google.gson.JsonElement;
25+
import com.google.gson.JsonParseException;
26+
import com.google.gson.JsonParser;
27+
import com.google.gson.Strictness;
28+
import com.google.gson.stream.JsonReader;
29+
import com.mojang.serialization.JsonOps;
30+
import net.minecraft.core.HolderLookup;
31+
import net.minecraft.network.chat.Component;
32+
import net.minecraft.network.chat.ComponentSerialization;
33+
import net.minecraft.network.chat.MutableComponent;
34+
35+
import javax.annotation.Nullable;
36+
import java.io.StringReader;
37+
38+
public class ComponentConverter {
39+
40+
public static class Serializer {
41+
private static final Gson GSON = (new GsonBuilder()).disableHtmlEscaping().create();
42+
43+
private Serializer() {
44+
}
45+
46+
static MutableComponent deserialize(JsonElement json, HolderLookup.Provider registries) {
47+
return (MutableComponent) ComponentSerialization.CODEC.parse(registries.createSerializationContext(JsonOps.INSTANCE), json).getOrThrow(JsonParseException::new);
48+
}
49+
50+
static JsonElement serialize(Component text, HolderLookup.Provider registries) {
51+
return ComponentSerialization.CODEC.encodeStart(registries.createSerializationContext(JsonOps.INSTANCE), text).getOrThrow(JsonParseException::new);
52+
}
53+
54+
public static String toJson(Component text, HolderLookup.Provider registries) {
55+
return GSON.toJson(serialize(text, registries));
56+
}
57+
58+
@Nullable
59+
public static MutableComponent fromJson(String json, HolderLookup.Provider registries) {
60+
JsonElement jsonelement = JsonParser.parseString(json);
61+
return jsonelement == null ? null : deserialize(jsonelement, registries);
62+
}
63+
64+
@Nullable
65+
public static MutableComponent fromJson(@Nullable JsonElement json, HolderLookup.Provider registries) {
66+
return json == null ? null : deserialize(json, registries);
67+
}
68+
69+
@Nullable
70+
public static MutableComponent fromJsonLenient(String json, HolderLookup.Provider registries) {
71+
JsonReader jsonreader = new JsonReader(new StringReader(json));
72+
jsonreader.setStrictness(Strictness.LENIENT);
73+
JsonElement jsonelement = JsonParser.parseReader(jsonreader);
74+
return jsonelement == null ? null : deserialize(jsonelement, registries);
75+
}
76+
}
77+
}

0 commit comments

Comments
 (0)