From 9b59587e585ba9fb8462b43140375d99f22333da Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Mon, 30 Jul 2018 18:38:18 -0400 Subject: [PATCH] Make this permissive enough for FeatherBoard --- .../proxy/connection/client/ClientPlaySessionHandler.java | 3 --- .../proxy/protocol/packets/ScoreboardObjective.java | 4 ++-- .../proxy/protocol/packets/ScoreboardTeam.java | 6 +++--- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/velocitypowered/proxy/connection/client/ClientPlaySessionHandler.java b/src/main/java/com/velocitypowered/proxy/connection/client/ClientPlaySessionHandler.java index ed25417ae..66bfd4075 100644 --- a/src/main/java/com/velocitypowered/proxy/connection/client/ClientPlaySessionHandler.java +++ b/src/main/java/com/velocitypowered/proxy/connection/client/ClientPlaySessionHandler.java @@ -225,8 +225,6 @@ public class ClientPlaySessionHandler implements MinecraftSessionHandler { } public void handleServerScoreboardPacket(MinecraftPacket packet) { - logger.info("Server scoreboard packet: {}", packet); - if (packet instanceof ScoreboardDisplay) { ScoreboardDisplay sd = (ScoreboardDisplay) packet; serverScoreboard.setPosition(sd.getPosition()); @@ -278,7 +276,6 @@ public class ClientPlaySessionHandler implements MinecraftSessionHandler { } private void clearServerScoreboard() { - logger.info("Scoreboard prior to cleaning: {}", serverScoreboard); for (Objective objective : serverScoreboard.getObjectives().values()) { for (Score score : objective.getScores().values()) { ScoreboardSetScore sss = new ScoreboardSetScore(); diff --git a/src/main/java/com/velocitypowered/proxy/protocol/packets/ScoreboardObjective.java b/src/main/java/com/velocitypowered/proxy/protocol/packets/ScoreboardObjective.java index 3ada51f83..3583b5001 100644 --- a/src/main/java/com/velocitypowered/proxy/protocol/packets/ScoreboardObjective.java +++ b/src/main/java/com/velocitypowered/proxy/protocol/packets/ScoreboardObjective.java @@ -58,8 +58,8 @@ public class ScoreboardObjective implements MinecraftPacket { this.id = ProtocolUtils.readString(buf, 16); this.mode = buf.readByte(); if (this.mode != 1) { - this.displayName = ProtocolUtils.readString(buf, 32); - this.type = ProtocolUtils.readString(buf, 16); + this.displayName = ProtocolUtils.readString(buf); + this.type = ProtocolUtils.readString(buf); } } diff --git a/src/main/java/com/velocitypowered/proxy/protocol/packets/ScoreboardTeam.java b/src/main/java/com/velocitypowered/proxy/protocol/packets/ScoreboardTeam.java index 0fd4a6c5e..36da3d2d0 100644 --- a/src/main/java/com/velocitypowered/proxy/protocol/packets/ScoreboardTeam.java +++ b/src/main/java/com/velocitypowered/proxy/protocol/packets/ScoreboardTeam.java @@ -125,9 +125,9 @@ public class ScoreboardTeam implements MinecraftPacket { switch (mode) { case 0: // create case 2: // update - this.displayName = ProtocolUtils.readString(buf, 32); - this.prefix = ProtocolUtils.readString(buf, 16); - this.suffix = ProtocolUtils.readString(buf, 16); + this.displayName = ProtocolUtils.readString(buf); + this.prefix = ProtocolUtils.readString(buf); + this.suffix = ProtocolUtils.readString(buf); this.flags = buf.readByte(); this.nameTagVisibility = ProtocolUtils.readString(buf, 32); this.collisionRule = ProtocolUtils.readString(buf, 32);