Replace incoming/outgoing usages with client/server bound (#3787)

This commit is contained in:
EnZaXD 2024-04-16 20:59:48 +02:00 committed by GitHub
parent ea5cf3e594
commit 8fe0681778
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 6 deletions

View File

@ -166,7 +166,7 @@ public class InventoryPackets extends ItemRewriter<ClientboundPackets1_12_1, Ser
channel = getNewPluginChannelId(channel);
if (channel == null) {
if (!Via.getConfig().isSuppressConversionWarnings() || Via.getManager().isDebug()) {
Via.getPlatform().getLogger().warning("Ignoring outgoing plugin message with channel: " + old);
Via.getPlatform().getLogger().warning("Ignoring clientbound plugin message with channel: " + old);
}
wrapper.cancel();
return;
@ -178,7 +178,7 @@ public class InventoryPackets extends ItemRewriter<ClientboundPackets1_12_1, Ser
if (rewritten != null) {
rewrittenChannels.add(rewritten);
} else if (!Via.getConfig().isSuppressConversionWarnings() || Via.getManager().isDebug()) {
Via.getPlatform().getLogger().warning("Ignoring plugin channel in outgoing REGISTER: " + s);
Via.getPlatform().getLogger().warning("Ignoring plugin channel in clientbound " + Key.stripMinecraftNamespace(channel).toUpperCase(Locale.ROOT) + ": " + s);
}
}
if (!rewrittenChannels.isEmpty()) {
@ -230,7 +230,7 @@ public class InventoryPackets extends ItemRewriter<ClientboundPackets1_12_1, Ser
channel = getOldPluginChannelId(channel);
if (channel == null) {
if (!Via.getConfig().isSuppressConversionWarnings() || Via.getManager().isDebug()) {
Via.getPlatform().getLogger().warning("Ignoring incoming plugin message with channel: " + old);
Via.getPlatform().getLogger().warning("Ignoring serverbound plugin message with channel: " + old);
}
wrapper.cancel();
return;
@ -242,7 +242,7 @@ public class InventoryPackets extends ItemRewriter<ClientboundPackets1_12_1, Ser
if (rewritten != null) {
rewrittenChannels.add(rewritten);
} else if (!Via.getConfig().isSuppressConversionWarnings() || Via.getManager().isDebug()) {
Via.getPlatform().getLogger().warning("Ignoring plugin channel in incoming REGISTER: " + s);
Via.getPlatform().getLogger().warning("Ignoring plugin channel in serverbound " + channel + ": " + s);
}
}
wrapper.write(Type.REMAINING_BYTES, Joiner.on('\0').join(rewrittenChannels).getBytes(StandardCharsets.UTF_8));

View File

@ -169,7 +169,7 @@ public class Protocol1_16To1_15_2 extends AbstractProtocol<ClientboundPackets1_1
final String namespacedChannel = Key.namespaced(channel);
if (channel.length() > 32) {
if (!Via.getConfig().isSuppressConversionWarnings()) {
Via.getPlatform().getLogger().warning("Ignoring incoming plugin channel, as it is longer than 32 characters: " + channel);
Via.getPlatform().getLogger().warning("Ignoring serverbound plugin channel, as it is longer than 32 characters: " + channel);
}
wrapper.cancel();
} else if (namespacedChannel.equals("minecraft:register") || namespacedChannel.equals("minecraft:unregister")) {
@ -178,7 +178,7 @@ public class Protocol1_16To1_15_2 extends AbstractProtocol<ClientboundPackets1_1
for (String registeredChannel : channels) {
if (registeredChannel.length() > 32) {
if (!Via.getConfig().isSuppressConversionWarnings()) {
Via.getPlatform().getLogger().warning("Ignoring incoming plugin channel register of '"
Via.getPlatform().getLogger().warning("Ignoring serverbound plugin channel register of '"
+ registeredChannel + "', as it is longer than 32 characters");
}
continue;