[BUG] Fix NeoForge/Forge issue with adventure

This commit is contained in:
2024-08-08 21:51:15 +02:00
parent 04d4ea6520
commit 029bde932d
79 changed files with 176 additions and 88 deletions

View File

@@ -1,8 +1,10 @@
--- a/Forge/src/main/java/com/hypherionmc/craterlib/common/ForgeCompatHelper.java
+++ b/Forge/src/main/java/com/hypherionmc/craterlib/common/ForgeCompatHelper.java
@@ -2,12 +2,16 @@
@@ -1,13 +1,18 @@
package com.hypherionmc.craterlib.common;
import com.hypherionmc.craterlib.core.platform.CompatUtils;
+import com.hypherionmc.craterlib.core.platform.ModloaderEnvironment;
import com.hypherionmc.craterlib.nojang.world.entity.player.BridgedPlayer;
+import redstonedubstep.mods.vanishmod.VanishUtil;

View File

@@ -20,7 +20,7 @@
@Mixin(value = ServerGamePacketListenerImpl.class, priority = Integer.MIN_VALUE)
public class ServerGamePacketListenerImplMixin {
@@ -22,11 +22,11 @@
@@ -22,12 +22,12 @@
public ServerPlayer player;
@Inject(
@@ -30,7 +30,8 @@
cancellable = true
)
- private void injectChatEvent(Component component, PlayerChatMessage arg, FilteredText p_296589_, CallbackInfo ci) {
Component finalArg = component == null ? arg.decoratedContent() : component;
+ private void injectChatEvent(CompletableFuture completablefuture1, PlayerChatMessage arg, CompletableFuture completablefuture, Void p_248218_, CallbackInfo ci) {
CraterServerChatEvent event = new CraterServerChatEvent(BridgedPlayer.of(this.player), arg.decoratedContent().getString(), ChatUtils.mojangToAdventure(arg.decoratedContent()));
CraterServerChatEvent event = new CraterServerChatEvent(BridgedPlayer.of(this.player), finalArg.getString(), ChatUtils.mojangToAdventure(finalArg));
CraterEventBus.INSTANCE.postEvent(event);
if (event.wasCancelled())