[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;
|
||||
|
||||
|
@@ -13,7 +13,7 @@
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
@@ -22,12 +22,16 @@
|
||||
@@ -22,13 +22,16 @@
|
||||
public ServerPlayer player;
|
||||
|
||||
@Inject(
|
||||
@@ -24,7 +24,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(TextFilter.FilteredText arg, CallbackInfo ci) {
|
||||
+ Component message = new TextComponent(arg.getRaw());
|
||||
+ if (message.getString().startsWith("/"))
|
||||
|
Reference in New Issue
Block a user