From b78ddf7b8510e25388a9cc4231970d660f5247d5 Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Thu, 9 Aug 2018 10:15:19 -0400 Subject: [PATCH] Fix scoreboard teams on Minecraft 1.8. --- .../proxy/protocol/packet/ScoreboardTeam.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/ScoreboardTeam.java b/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/ScoreboardTeam.java index 25a0b6bb3..e6a3d7421 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/ScoreboardTeam.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/ScoreboardTeam.java @@ -138,7 +138,9 @@ public class ScoreboardTeam implements MinecraftPacket { } this.flags = buf.readByte(); this.nameTagVisibility = ProtocolUtils.readString(buf, 32); - this.collisionRule = ProtocolUtils.readString(buf, 32); + if (protocolVersion >= ProtocolConstants.MINECRAFT_1_9) { + this.collisionRule = ProtocolUtils.readString(buf, 32); + } this.color = protocolVersion <= ProtocolConstants.MINECRAFT_1_12_2 ? buf.readByte() : ProtocolUtils.readVarInt(buf); if (protocolVersion >= ProtocolConstants.MINECRAFT_1_13) { @@ -172,7 +174,9 @@ public class ScoreboardTeam implements MinecraftPacket { } buf.writeByte(flags); ProtocolUtils.writeString(buf, nameTagVisibility); - ProtocolUtils.writeString(buf, collisionRule); + if (protocolVersion >= ProtocolConstants.MINECRAFT_1_9) { + ProtocolUtils.writeString(buf, collisionRule); + } if (protocolVersion >= ProtocolConstants.MINECRAFT_1_13) { ProtocolUtils.writeVarInt(buf, color); ProtocolUtils.writeScoreboardTextComponent(buf, protocolVersion, prefix);