From 75ee59810fce56ebe462354514bba1902787ae2b Mon Sep 17 00:00:00 2001 From: Lixfel Date: Fri, 24 Feb 2023 17:28:02 +0100 Subject: [PATCH] Fix chat disconnects --- SpigotCore_9/build.gradle | 2 ++ SpigotCore_9/src/de/steamwar/core/BountifulWrapper9.java | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/SpigotCore_9/build.gradle b/SpigotCore_9/build.gradle index 4585a01..8e81844 100644 --- a/SpigotCore_9/build.gradle +++ b/SpigotCore_9/build.gradle @@ -43,6 +43,8 @@ sourceSets { } dependencies { + compileOnly 'com.viaversion:viaversion-api:4.3.1' + compileOnly project(":SpigotCore_Main") compileOnly project(":SpigotCore_8") diff --git a/SpigotCore_9/src/de/steamwar/core/BountifulWrapper9.java b/SpigotCore_9/src/de/steamwar/core/BountifulWrapper9.java index 97fe828..5602d9a 100644 --- a/SpigotCore_9/src/de/steamwar/core/BountifulWrapper9.java +++ b/SpigotCore_9/src/de/steamwar/core/BountifulWrapper9.java @@ -20,6 +20,7 @@ package de.steamwar.core; import com.comphenix.tinyprotocol.Reflection; +import com.viaversion.viaversion.api.Via; import net.md_5.bungee.api.ChatMessageType; import net.md_5.bungee.api.chat.BaseComponent; import org.bukkit.Sound; @@ -36,6 +37,9 @@ public class BountifulWrapper9 implements BountifulWrapper.IBountifulWrapper { @Override public void sendMessage(Player player, ChatMessageType type, BaseComponent... msg) { + if(type == ChatMessageType.CHAT && Via.getAPI().getPlayerVersion(player.getUniqueId()) >= 759) + type = ChatMessageType.SYSTEM; + player.spigot().sendMessage(type, msg); }