Skip to content

Commit ddc9697

Browse files
authored
Update for 1.21.6 (#3211)
* Initial changes for 1.21.6 * update data version * update dev bundle * update mappings * converters * 1.21.5 dev bundle annoyances * apply sign component fix * dev bundle update
1 parent 3dc41d8 commit ddc9697

27 files changed

+8925
-4
lines changed

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ allprojects {
8383
}
8484

8585
applyCommonConfiguration()
86-
val supportedVersions = listOf("1.20.4", "1.20.5", "1.20.6", "1.21", "1.21.1", "1.21.4", "1.21.5")
86+
val supportedVersions = listOf("1.20.4", "1.20.5", "1.20.6", "1.21", "1.21.1", "1.21.4", "1.21.5", "1.21.6")
8787

8888
tasks {
8989
supportedVersions.forEach {

settings.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ rootProject.name = "FastAsyncWorldEdit"
22

33
include("worldedit-libs")
44

5-
listOf("1_20_2", "1_20_4", "1_20_5", "1_21", "1_21_4", "1_21_5").forEach {
5+
listOf("1_20_2", "1_20_4", "1_20_5", "1_21", "1_21_4", "1_21_5", "1_21_6").forEach {
66
include("worldedit-bukkit:adapters:adapter-$it")
77
}
88

worldedit-bukkit/adapters/adapter-1_21_5/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ repositories {
1212

1313
dependencies {
1414
// https://repo.papermc.io/service/rest/repository/browse/maven-public/io/papermc/paper/dev-bundle/
15-
the<PaperweightUserDependenciesExtension>().paperDevBundle("1.21.5-R0.1-20250529.121722-99")
15+
the<PaperweightUserDependenciesExtension>().paperDevBundle("1.21.5-R0.1-20250618.110345-108")
1616
compileOnly(libs.paperlib)
1717
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import io.papermc.paperweight.userdev.PaperweightUserDependenciesExtension
2+
3+
plugins {
4+
java
5+
}
6+
7+
applyPaperweightAdapterConfiguration()
8+
9+
repositories {
10+
gradlePluginPortal()
11+
}
12+
13+
dependencies {
14+
// https://repo.papermc.io/service/rest/repository/browse/maven-public/io/papermc/paper/dev-bundle/
15+
the<PaperweightUserDependenciesExtension>().paperDevBundle("1.21.6-R0.1-20250621.050219-23")
16+
compileOnly(libs.paperlib)
17+
}
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_6;
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 java.io.StringReader;
36+
import javax.annotation.Nullable;
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)