From 1ab926b57205ea3a666802ae152f375adefb7e48 Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Tue, 24 Jul 2018 14:34:59 -0400 Subject: [PATCH] Fix 1.4-1.6 SLP, use text from maven central. --- build.gradle | 3 +-- .../minecraft/velocity/protocol/netty/LegacyPingEncoder.java | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/build.gradle b/build.gradle index 531541017..02b1f880a 100644 --- a/build.gradle +++ b/build.gradle @@ -9,13 +9,12 @@ sourceCompatibility = 1.8 repositories { mavenCentral() - maven { url 'https://jitpack.io' } } dependencies { compile 'io.netty:netty-all:4.1.27.Final' compile 'com.google.guava:guava:25.1-jre' compile 'com.google.code.gson:gson:2.8.5' - compile 'com.github.KyoriPowered:text:v1.12-1.5.0' + compile 'net.kyori:text:1.12-1.5.0' testCompile group: 'junit', name: 'junit', version: '4.12' } diff --git a/src/main/java/io/minimum/minecraft/velocity/protocol/netty/LegacyPingEncoder.java b/src/main/java/io/minimum/minecraft/velocity/protocol/netty/LegacyPingEncoder.java index e3cd16f83..313750ecd 100644 --- a/src/main/java/io/minimum/minecraft/velocity/protocol/netty/LegacyPingEncoder.java +++ b/src/main/java/io/minimum/minecraft/velocity/protocol/netty/LegacyPingEncoder.java @@ -16,9 +16,8 @@ public class LegacyPingEncoder extends MessageToByteEncoder protected void encode(ChannelHandlerContext ctx, LegacyPingResponse msg, ByteBuf out) throws Exception { out.writeByte(0xff); String serializedResponse = serialize(msg); - byte[] serializedBytes = serializedResponse.getBytes(StandardCharsets.UTF_16BE); - out.writeShort(serializedBytes.length); - out.writeBytes(serializedBytes); + out.writeShort(serializedResponse.length()); + out.writeBytes(serializedResponse.getBytes(StandardCharsets.UTF_16BE)); System.out.println(ByteBufUtil.prettyHexDump(out)); }