Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +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.21.11'
- '1.21.10'
- '1.21.9'
- '1.21.8'
- '1.21.7'
- '1.21.6'
Expand Down
8 changes: 5 additions & 3 deletions build-logic/src/main/kotlin/buildlogic.adapter.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ plugins {

paperweight {
injectPaperRepository = false
reobfArtifactConfiguration = io.papermc.paperweight.userdev.ReobfArtifactConfiguration.REOBF_PRODUCTION
// TODO: switch back to REOBF when paper releases mappings
reobfArtifactConfiguration = io.papermc.paperweight.userdev.ReobfArtifactConfiguration.MOJANG_PRODUCTION
}

repositories {
Expand Down Expand Up @@ -52,9 +53,10 @@ dependencies {
}
}

tasks.named("assemble") {
// TODO: re-enable when paper releases mappings
/* tasks.named("assemble") {
dependsOn("reobfJar")
}
} */

tasks.named<Javadoc>("javadoc") {
enabled = false
Expand Down
3 changes: 2 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ allprojects {
}
}

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")
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", "1.21.11")

tasks {
supportedVersions.forEach {
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ includeBuild("build-logic")

include("worldedit-libs")

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 {
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 {
include("worldedit-bukkit:adapters:adapter-$it")
}

Expand Down
23 changes: 23 additions & 0 deletions worldedit-bukkit/adapters/adapter-1_21_11/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import io.papermc.paperweight.userdev.PaperweightUserDependenciesExtension

plugins {
id("buildlogic.adapter")
}

configurations {
all {
resolutionStrategy {
capabilitiesResolution {
withCapability("org.lz4:lz4-java") {
selectHighestVersion()
}
}
}
}
}

dependencies {
// https://repo.papermc.io/service/rest/repository/browse/maven-public/io/papermc/paper/dev-bundle/
the<PaperweightUserDependenciesExtension>().paperDevBundle("1.21.11-R0.1-20251209.225848-3")
compileOnly(libs.paperLib)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/*
* WorldEdit, a Minecraft world manipulation toolkit
* Copyright (C) sk89q <http://www.sk89q.com>
* Copyright (C) WorldEdit team and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package com.sk89q.worldedit.bukkit.adapter.ext.fawe.v1_21_11;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonElement;
import com.google.gson.JsonParseException;
import com.google.gson.JsonParser;
import com.google.gson.Strictness;
import com.google.gson.stream.JsonReader;
import com.mojang.serialization.JsonOps;
import net.minecraft.core.HolderLookup;
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.ComponentSerialization;
import net.minecraft.network.chat.MutableComponent;

import javax.annotation.Nullable;
import java.io.StringReader;

public class ComponentConverter {

public static class Serializer {
private static final Gson GSON = (new GsonBuilder()).disableHtmlEscaping().create();

private Serializer() {
}

static MutableComponent deserialize(JsonElement json, HolderLookup.Provider registries) {
return (MutableComponent) ComponentSerialization.CODEC.parse(registries.createSerializationContext(JsonOps.INSTANCE), json).getOrThrow(JsonParseException::new);
}

static JsonElement serialize(Component text, HolderLookup.Provider registries) {
return ComponentSerialization.CODEC.encodeStart(registries.createSerializationContext(JsonOps.INSTANCE), text).getOrThrow(JsonParseException::new);
}

public static String toJson(Component text, HolderLookup.Provider registries) {
return GSON.toJson(serialize(text, registries));
}

@Nullable
public static MutableComponent fromJson(String json, HolderLookup.Provider registries) {
JsonElement jsonelement = JsonParser.parseString(json);
return jsonelement == null ? null : deserialize(jsonelement, registries);
}

@Nullable
public static MutableComponent fromJson(@Nullable JsonElement json, HolderLookup.Provider registries) {
return json == null ? null : deserialize(json, registries);
}

@Nullable
public static MutableComponent fromJsonLenient(String json, HolderLookup.Provider registries) {
JsonReader jsonreader = new JsonReader(new StringReader(json));
jsonreader.setStrictness(Strictness.LENIENT);
JsonElement jsonelement = JsonParser.parseReader(jsonreader);
return jsonelement == null ? null : deserialize(jsonelement, registries);
}
}
}
Loading
Loading