From 0de9f9bb06f041339e6ae198c42ebbdb3d373ef3 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Mon, 30 Nov 2020 06:26:53 +0100 Subject: [PATCH] Hotfix scoreboard --- .../src/de/steamwar/scoreboard/SWScoreboard.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/SpigotCore_Main/src/de/steamwar/scoreboard/SWScoreboard.java b/SpigotCore_Main/src/de/steamwar/scoreboard/SWScoreboard.java index 32b4a75..38fa0d1 100644 --- a/SpigotCore_Main/src/de/steamwar/scoreboard/SWScoreboard.java +++ b/SpigotCore_Main/src/de/steamwar/scoreboard/SWScoreboard.java @@ -93,7 +93,18 @@ public class SWScoreboard { PacketContainer packet = manager.createPacket(PacketType.Play.Server.SCOREBOARD_OBJECTIVE); packet.getStrings().write(0, SIDEBAR + toggle); packet.getIntegers().write(0, 0); //0 to create - packet.getChatComponents().write(0, WrappedChatComponent.fromText(name)); + switch(Core.getVersion()){ + case 8: + case 9: + case 10: + case 12: + packet.getStrings().write(1, SIDEBAR + toggle); + break; + case 14: + case 15: + default: + packet.getChatComponents().write(0, WrappedChatComponent.fromText(name)); + } packet.getEnumModifier(RenderType.class, 2).write(0, RenderType.INTEGER); return packet; }