Updated Via API usage

This commit is contained in:
RaphiMC 2024-11-11 18:47:10 +01:00
parent be3b713913
commit 31eae073f5
No known key found for this signature in database
GPG Key ID: 0F6BB0657A03AC94
2 changed files with 4 additions and 4 deletions

View File

@ -23,7 +23,7 @@ repositories {
} }
dependencies { dependencies {
compileOnly "com.viaversion:viaversion-common:5.1.1" compileOnly "com.viaversion:viaversion-common:5.1.2-SNAPSHOT"
compileOnly "com.google.guava:guava:33.3.1-jre" compileOnly "com.google.guava:guava:33.3.1-jre"
compileOnly "io.netty:netty-handler:4.1.114.Final" compileOnly "io.netty:netty-handler:4.1.114.Final"
} }

View File

@ -1409,7 +1409,7 @@ public class Protocolr1_7_6_10Tor1_8 extends AbstractProtocol<ClientboundPackets
} }
case "MC|Brand", "MC|ItemName" -> { case "MC|Brand", "MC|ItemName" -> {
final String content = wrapper.read(Types.STRING); // client brand or item name final String content = wrapper.read(Types.STRING); // client brand or item name
wrapper.write(Types.REMAINING_BYTES, content.getBytes(StandardCharsets.UTF_8)); // client brand or item name wrapper.write(Types.SERVERBOUND_CUSTOM_PAYLOAD_DATA, content.getBytes(StandardCharsets.UTF_8)); // client brand or item name
} }
case "MC|AdvCdm" -> { case "MC|AdvCdm" -> {
final byte type = wrapper.passthrough(Types.BYTE); // command block type (0 = Block, 1 = Minecart) final byte type = wrapper.passthrough(Types.BYTE); // command block type (0 = Block, 1 = Minecart)
@ -1430,7 +1430,7 @@ public class Protocolr1_7_6_10Tor1_8 extends AbstractProtocol<ClientboundPackets
wrapper.read(Types.BOOLEAN); // track output wrapper.read(Types.BOOLEAN); // track output
} }
case "REGISTER", "UNREGISTER" -> { case "REGISTER", "UNREGISTER" -> {
byte[] channels = wrapper.read(Types.REMAINING_BYTES); byte[] channels = wrapper.read(Types.SERVERBOUND_CUSTOM_PAYLOAD_DATA);
if (ViaLegacy.getConfig().isIgnoreLong1_8ChannelNames()) { if (ViaLegacy.getConfig().isIgnoreLong1_8ChannelNames()) {
final String[] registeredChannels = new String(channels, StandardCharsets.UTF_8).split("\0"); final String[] registeredChannels = new String(channels, StandardCharsets.UTF_8).split("\0");
@ -1451,7 +1451,7 @@ public class Protocolr1_7_6_10Tor1_8 extends AbstractProtocol<ClientboundPackets
channels = Joiner.on('\0').join(validChannels).getBytes(StandardCharsets.UTF_8); channels = Joiner.on('\0').join(validChannels).getBytes(StandardCharsets.UTF_8);
} }
wrapper.write(Types.REMAINING_BYTES, channels); // data wrapper.write(Types.SERVERBOUND_CUSTOM_PAYLOAD_DATA, channels); // data
} }
} }