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: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.21.10'
- '1.21.9'
- '1.21.8'
- '1.21.7'
- '1.21.6'
Expand Down
16 changes: 15 additions & 1 deletion build-logic/src/main/kotlin/buildlogic.adapter.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import buildlogic.getVersion
import buildlogic.stringyLibs

plugins {
Expand All @@ -16,10 +17,23 @@ repositories {
maven {
name = "PaperMC"
url = uri("https://repo.papermc.io/repository/maven-public/")
content {
excludeModule("io.papermc.paper", "dev-bundle")
}
}
maven {
name = "EngineHub Repository"
url = uri("https://maven.enginehub.org/repo/")
content {
excludeModule("io.papermc.paper", "dev-bundle")
}
}
maven {
name = "IntellectualSites"
url = uri("https://repo.intellectualsites.dev/repository/paper-dev-bundles/")
content {
includeModule("io.papermc.paper", "dev-bundle")
}
}
mavenCentral()
afterEvaluate {
Expand All @@ -32,7 +46,7 @@ dependencies {
constraints {
//Reduces the amount of libraries Gradle and IntelliJ need to resolve
implementation("net.kyori:adventure-bom") {
version { strictly("4.24.0") }
version { strictly(stringyLibs.getVersion("adventure").strictVersion) }
because("Ensure a consistent version of adventure is used.")
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ tasks.withType<Javadoc>().configureEach {
"https://jd.advntr.dev/api/latest/",
"https://logging.apache.org/log4j/2.x/javadoc/log4j-api/",
"https://www.antlr.org/api/Java/",
"https://jd.papermc.io/paper/1.21.8/",
"https://jd.papermc.io/paper/1.21.10/",
"https://intellectualsites.github.io/fastasyncworldedit-javadocs/worldedit-core/"
)
docTitle = "${rootProject.name}-${project.description}" + " " + "${rootProject.version}"
Expand Down
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ 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")
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")

tasks {
supportedVersions.forEach {
Expand All @@ -107,7 +107,7 @@ tasks {
}
}
runServer<RunServer> {
minecraftVersion("1.21.8")
minecraftVersion(supportedVersions.last())
pluginJars(*project(":worldedit-bukkit").getTasksByName("shadowJar", false).map { (it as Jar).archiveFile }
.toTypedArray())
jvmArgs("-Dcom.mojang.eula.agree=true")
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ plotsquared = "7.5.8"
bstats = "3.1.0"
sparsebitset = "1.3"
parallelgzip = "1.0.5"
adventure = "4.24.0"
adventure = "4.25.0"
adventure-bukkit = "4.4.1"
checkerqual = "3.51.1"
truezip = "6.8.4"
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").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").forEach {
include("worldedit-bukkit:adapters:adapter-$it")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@ protected void storeBiomes(int layer, PalettedContainerRO<Holder<Biome>> biomeDa
} else {
try {
for (int i = 0; i < 64; i++) {
biomes[layer][i] = (Holder<Biome>) PaperweightPlatformAdapter.PALETTED_CONTAINER_GET.invoke(i);
biomes[layer][i] = (Holder<Biome>) PaperweightPlatformAdapter.PALETTED_CONTAINER_GET
.invoke(palettedContainer, i);
}
} catch (Throwable e) {
throw new RuntimeException(e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@ protected void storeBiomes(int layer, PalettedContainerRO<Holder<Biome>> biomeDa
} else {
try {
for (int i = 0; i < 64; i++) {
biomes[layer][i] = (Holder<Biome>) PaperweightPlatformAdapter.PALETTED_CONTAINER_GET.invoke(i);
biomes[layer][i] = (Holder<Biome>) PaperweightPlatformAdapter.PALETTED_CONTAINER_GET
.invoke(palettedContainer, i);
}
} catch (Throwable e) {
throw new RuntimeException(e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,8 @@ protected void storeBiomes(int layer, PalettedContainerRO<Holder<Biome>> biomeDa
} else {
try {
for (int i = 0; i < 64; i++) {
biomes[layer][i] = (Holder<Biome>) PaperweightPlatformAdapter.PALETTED_CONTAINER_GET.invoke(i);
biomes[layer][i] = (Holder<Biome>) PaperweightPlatformAdapter.PALETTED_CONTAINER_GET
.invoke(palettedContainer, i);
}
} catch (Throwable e) {
throw new RuntimeException(e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,8 @@ protected void storeBiomes(int layer, PalettedContainerRO<Holder<Biome>> biomeDa
} else {
try {
for (int i = 0; i < 64; i++) {
biomes[layer][i] = (Holder<Biome>) PaperweightPlatformAdapter.PALETTED_CONTAINER_GET.invoke(i);
biomes[layer][i] = (Holder<Biome>) PaperweightPlatformAdapter.PALETTED_CONTAINER_GET
.invoke(palettedContainer, i);
}
} catch (Throwable e) {
throw new RuntimeException(e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,8 @@ protected void storeBiomes(int layer, PalettedContainerRO<Holder<Biome>> biomeDa
} else {
try {
for (int i = 0; i < 64; i++) {
biomes[layer][i] = (Holder<Biome>) PaperweightPlatformAdapter.PALETTED_CONTAINER_GET.invoke(i);
biomes[layer][i] = (Holder<Biome>) PaperweightPlatformAdapter.PALETTED_CONTAINER_GET
.invoke(palettedContainer, i);
}
} catch (Throwable e) {
throw new RuntimeException(e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,8 @@ protected void storeBiomes(int layer, PalettedContainerRO<Holder<Biome>> biomeDa
} else {
try {
for (int i = 0; i < 64; i++) {
biomes[layer][i] = (Holder<Biome>) PaperweightPlatformAdapter.PALETTED_CONTAINER_GET.invoke(i);
biomes[layer][i] = (Holder<Biome>) PaperweightPlatformAdapter.PALETTED_CONTAINER_GET
.invoke(palettedContainer, i);
}
} catch (Throwable e) {
throw new RuntimeException(e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,12 +204,6 @@ public final class PaperweightAdapter implements BukkitImplAdapter<net.minecraft

private static final RandomSource random = RandomSource.create();

private static final String WRONG_VERSION =
"""
This version of FastAsyncWorldEdit has not been tested with the current Minecraft version.
While it may work, there might be unexpected issues.
It is recommended to use a version of FastAsyncWorldEdit that supports your Minecraft version.
""".stripIndent();

// ------------------------------------------------------------------------
// Code that may break between versions of Minecraft
Expand All @@ -221,7 +215,7 @@ public PaperweightAdapter() throws NoSuchFieldException, NoSuchMethodException {

int dataVersion = SharedConstants.getCurrentVersion().dataVersion().version();
if (dataVersion != Constants.DATA_VERSION_MC_1_21_6 && dataVersion != Constants.DATA_VERSION_MC_1_21_7 && dataVersion != Constants.DATA_VERSION_MC_1_21_8) {
logger.warning(WRONG_VERSION);
throw new UnsupportedClassVersionError("Not 1.21.(6/7/8)!");
}

serverWorldsField = CraftServer.class.getDeclaredField("worlds");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ public synchronized net.minecraft.world.level.block.state.BlockState setBlockSta
) {
int currentTick = MinecraftServer.currentTick;
if (Fawe.isMainThread()) {
return levelChunk.setBlockState(blockPos, blockState,
return levelChunk.setBlockState(
blockPos, blockState,
this.sideEffectSet.shouldApply(SideEffect.UPDATE) ? 0 : 512
);
}
Expand Down Expand Up @@ -188,7 +189,13 @@ public void notifyNeighbors(
// Un-nest neighbour updating
for (Direction direction : NEIGHBOUR_ORDER) {
BlockPos shifted = blockPos.relative(direction);
level.getBlockState(shifted).handleNeighborChanged(level, shifted, oldState.getBlock(), ExperimentalRedstoneUtils.initialOrientation(level, null, null), false);
level.getBlockState(shifted).handleNeighborChanged(
level,
shifted,
oldState.getBlock(),
ExperimentalRedstoneUtils.initialOrientation(level, null, null),
false
);
}
}
if (newState.hasAnalogOutputSignal()) {
Expand Down Expand Up @@ -225,7 +232,11 @@ public void updateNeighbors(
}

@Override
public void updateBlock(BlockPos pos, net.minecraft.world.level.block.state.BlockState oldState, net.minecraft.world.level.block.state.BlockState newState) {
public void updateBlock(
BlockPos pos,
net.minecraft.world.level.block.state.BlockState oldState,
net.minecraft.world.level.block.state.BlockState newState
) {
Level world = getLevel();
newState.onPlace(world, pos, oldState, false);
}
Expand All @@ -252,7 +263,8 @@ private synchronized void flushAsync(final boolean sendChunks) {
RunnableVal<Object> runnableVal = new RunnableVal<>() {
@Override
public void run(Object value) {
changes.forEach(cc -> cc.levelChunk.setBlockState(cc.blockPos, cc.blockState,
changes.forEach(cc -> cc.levelChunk.setBlockState(
cc.blockPos, cc.blockState,
sideEffectSet.shouldApply(SideEffect.UPDATE) ? 0 : 512
));
if (!sendChunks) {
Expand All @@ -271,7 +283,8 @@ public synchronized void flush() {
RunnableVal<Object> runnableVal = new RunnableVal<>() {
@Override
public void run(Object value) {
cachedChanges.forEach(cc -> cc.levelChunk.setBlockState(cc.blockPos, cc.blockState,
cachedChanges.forEach(cc -> cc.levelChunk.setBlockState(
cc.blockPos, cc.blockState,
sideEffectSet.shouldApply(SideEffect.UPDATE) ? 0 : 512
));
for (IntPair chunk : cachedChunksToSend) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,8 @@ protected void storeBiomes(int layer, PalettedContainerRO<Holder<Biome>> biomeDa
} else {
try {
for (int i = 0; i < 64; i++) {
biomes[layer][i] = (Holder<Biome>) PaperweightPlatformAdapter.PALETTED_CONTAINER_GET.invoke(i);
biomes[layer][i] = (Holder<Biome>) PaperweightPlatformAdapter.PALETTED_CONTAINER_GET
.invoke(palettedContainer, i);
}
} catch (Throwable e) {
throw new RuntimeException(e);
Expand Down
11 changes: 11 additions & 0 deletions worldedit-bukkit/adapters/adapter-1_21_9/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import io.papermc.paperweight.userdev.PaperweightUserDependenciesExtension

plugins {
id("buildlogic.adapter")
}

dependencies {
// https://repo.papermc.io/service/rest/repository/browse/maven-public/io/papermc/paper/dev-bundle/
the<PaperweightUserDependenciesExtension>().paperDevBundle("1.21.10-R0.1-20251007.183616-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_9;

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