From b2f55cfe8f0bc08ab050c5bb2a9e16de3178c870 Mon Sep 17 00:00:00 2001 From: Octavia Togami Date: Mon, 26 Feb 2024 23:04:57 -0800 Subject: [PATCH 1/2] Make mixins reobf properly in Forge --- worldedit-forge/build.gradle.kts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/worldedit-forge/build.gradle.kts b/worldedit-forge/build.gradle.kts index a8f56439b9..aee2afd40c 100644 --- a/worldedit-forge/build.gradle.kts +++ b/worldedit-forge/build.gradle.kts @@ -2,6 +2,7 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar import net.minecraftforge.gradle.common.util.RunConfig import net.minecraftforge.gradle.userdev.UserDevExtension import net.minecraftforge.gradle.userdev.tasks.RenameJarInPlace +import org.spongepowered.asm.gradle.plugins.MixinExtension.ConfigureReobfTask plugins { id("net.minecraftforge.gradle") @@ -73,6 +74,13 @@ configure { config("worldedit-forge.mixins.json") } +// Workaround until SpongePowered/MixinGradle#51 is merged +afterEvaluate { + tasks.withType().configureEach { + dependsOn(tasks.compileJava) + } +} + configure { archivesName.set("${archivesName.get()}-mc$minecraftVersion") } From 495e5924c78f2ada6b1a05a01232019315ffa9a3 Mon Sep 17 00:00:00 2001 From: Octavia Togami Date: Mon, 26 Feb 2024 23:05:16 -0800 Subject: [PATCH 2/2] Fix NPE caused by client-side CUI packets --- .../sk89q/worldedit/forge/net/handler/WECUIPacketHandler.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/net/handler/WECUIPacketHandler.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/net/handler/WECUIPacketHandler.java index 928f53c0d8..8cbf60868d 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/net/handler/WECUIPacketHandler.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/net/handler/WECUIPacketHandler.java @@ -46,6 +46,10 @@ public static void init() { } public static void onPacketData(CustomPayloadEvent event) { + if (event.getSource().isClientSide()) { + // Ignore client-side packets + return; + } ServerPlayer player = event.getSource().getSender(); LocalSession session = ForgeWorldEdit.inst.getSession(player); String text = event.getPayload().toString(StandardCharsets.UTF_8);