[BUG] Fix NeoForge/Forge issue with adventure
This commit is contained in:
@@ -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;
|
||||
|
||||
|
@@ -20,7 +20,7 @@
|
||||
|
||||
@Mixin(value = ServerGamePacketListenerImpl.class, priority = Integer.MIN_VALUE)
|
||||
public class ServerGamePacketListenerImplMixin {
|
||||
@@ -22,12 +22,12 @@
|
||||
@@ -22,13 +22,12 @@
|
||||
public ServerPlayer player;
|
||||
|
||||
@Inject(
|
||||
@@ -30,7 +30,8 @@
|
||||
cancellable = true
|
||||
)
|
||||
- private void injectChatEvent(Component component, PlayerChatMessage arg, FilteredText p_296589_, CallbackInfo ci) {
|
||||
- CraterServerChatEvent event = new CraterServerChatEvent(BridgedPlayer.of(this.player), arg.decoratedContent().getString(), ChatUtils.mojangToAdventure(arg.decoratedContent()));
|
||||
- Component finalArg = component == null ? arg.decoratedContent() : component;
|
||||
- CraterServerChatEvent event = new CraterServerChatEvent(BridgedPlayer.of(this.player), finalArg.getString(), ChatUtils.mojangToAdventure(finalArg));
|
||||
+ private void injectChatEvent(PlayerChatMessage arg, CallbackInfoReturnable<CompletableFuture> ci) {
|
||||
+ CraterServerChatEvent event = new CraterServerChatEvent(BridgedPlayer.of(this.player), arg.serverContent().getString(), ChatUtils.mojangToAdventure(arg.serverContent()));
|
||||
CraterEventBus.INSTANCE.postEvent(event);
|
||||
|
Reference in New Issue
Block a user