[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

@@ -29,6 +29,7 @@ shadowJar {
}
setArchiveClassifier('dev-shadow')
mergeServiceFiles()
}
/**

View File

@@ -26,8 +26,9 @@ public class ServerGamePacketListenerImplMixin {
at = @At("HEAD"),
cancellable = true
)
Component finalArg = arg2 == null ? arg.decoratedContent() : arg2;
private void injectChatEvent(PlayerChatMessage arg, CompletableFuture completableFuture, CompletableFuture completableFuture2, Void void_, 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();