[BUG] Fix NeoForge/Forge issue with adventure
This commit is contained in:
@@ -22,6 +22,7 @@ shadowJar {
|
||||
}
|
||||
|
||||
setArchiveClassifier('dev-shadow')
|
||||
mergeServiceFiles()
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -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;
|
||||
|
||||
public class ForgeCompatHelper implements CompatUtils {
|
||||
|
||||
@Override
|
||||
public boolean isPlayerActive(BridgedPlayer player) {
|
||||
return true;
|
||||
if (!ModloaderEnvironment.INSTANCE.isModLoaded("vmod"))
|
||||
return true;
|
||||
|
||||
return VanishUtil.isVanished(player.toMojangServerPlayer());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -26,8 +26,9 @@ public class ServerGamePacketListenerImplMixin {
|
||||
at = @At("HEAD"),
|
||||
cancellable = true
|
||||
)
|
||||
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())
|
||||
ci.cancel();
|
||||
|
Reference in New Issue
Block a user