From da704539f0f9926c75c06b91b7d8d6da43be0b4a Mon Sep 17 00:00:00 2001 From: KennyTV <28825609+KennyTV@users.noreply.github.com> Date: Tue, 26 Nov 2019 20:14:56 +0100 Subject: [PATCH] Rename suppress-warning config option --- .../us/myles/ViaVersion/AbstractViaConfig.java | 8 ++++---- .../us/myles/ViaVersion/api/ViaVersionConfig.java | 4 ++-- .../ViaVersion/api/data/MappingDataLoader.java | 6 +++--- .../packets/InventoryPackets.java | 14 +++++++------- .../protocol1_13to1_12_2/packets/WorldPackets.java | 8 ++++---- .../providers/blockentities/FlowerPotHandler.java | 2 +- .../main/resources/assets/viaversion/config.yml | 4 ++-- 7 files changed, 23 insertions(+), 23 deletions(-) diff --git a/common/src/main/java/us/myles/ViaVersion/AbstractViaConfig.java b/common/src/main/java/us/myles/ViaVersion/AbstractViaConfig.java index 37440cb5f..2ee9bd131 100644 --- a/common/src/main/java/us/myles/ViaVersion/AbstractViaConfig.java +++ b/common/src/main/java/us/myles/ViaVersion/AbstractViaConfig.java @@ -38,7 +38,7 @@ public abstract class AbstractViaConfig extends Config implements ViaVersionConf private Set blockedProtocols; private String blockedDisconnectMessage; private String reloadDisconnectMessage; - private boolean suppress1_13ConversionErrors; + private boolean suppressConversionWarnings; private boolean disable1_13TabComplete; private boolean minimizeCooldown; private boolean teamColourFix; @@ -95,7 +95,7 @@ public abstract class AbstractViaConfig extends Config implements ViaVersionConf reloadDisconnectMessage = getString("reload-disconnect-msg", "Server reload, please rejoin!"); minimizeCooldown = getBoolean("minimize-cooldown", true); teamColourFix = getBoolean("team-colour-fix", true); - suppress1_13ConversionErrors = getBoolean("suppress-1_13-conversion-errors", false); + suppressConversionWarnings = getBoolean("suppress-conversion-warnings", false); disable1_13TabComplete = getBoolean("disable-1_13-auto-complete", false); serversideBlockConnections = getBoolean("serverside-blockconnections", false); reduceBlockStorageMemory = getBoolean("reduce-blockstorage-memory", false); @@ -276,8 +276,8 @@ public abstract class AbstractViaConfig extends Config implements ViaVersionConf } @Override - public boolean isSuppress1_13ConversionErrors() { - return suppress1_13ConversionErrors; + public boolean isSuppressConversionWarnings() { + return suppressConversionWarnings; } @Override diff --git a/common/src/main/java/us/myles/ViaVersion/api/ViaVersionConfig.java b/common/src/main/java/us/myles/ViaVersion/api/ViaVersionConfig.java index f4eb99c05..140ec6bf2 100644 --- a/common/src/main/java/us/myles/ViaVersion/api/ViaVersionConfig.java +++ b/common/src/main/java/us/myles/ViaVersion/api/ViaVersionConfig.java @@ -231,11 +231,11 @@ public interface ViaVersionConfig { String getReloadDisconnectMsg(); /** - * Should we hide errors that occur when trying to converting to 1.13 data? + * Should we hide errors that occur when trying to convert block and item data over versions? * * @return True if enabled */ - boolean isSuppress1_13ConversionErrors(); + boolean isSuppressConversionWarnings(); /** * Should we disable the 1.13 auto-complete feature to stop spam kicks? (for any server lower than 1.13) diff --git a/common/src/main/java/us/myles/ViaVersion/api/data/MappingDataLoader.java b/common/src/main/java/us/myles/ViaVersion/api/data/MappingDataLoader.java index fa276b963..7261f9add 100644 --- a/common/src/main/java/us/myles/ViaVersion/api/data/MappingDataLoader.java +++ b/common/src/main/java/us/myles/ViaVersion/api/data/MappingDataLoader.java @@ -31,7 +31,7 @@ public class MappingDataLoader { for (Map.Entry entry : oldIdentifiers.entrySet()) { Map.Entry value = findValue(newIdentifiers, entry.getValue().getAsString()); if (value == null) { - if (!Via.getConfig().isSuppress1_13ConversionErrors() || Via.getManager().isDebug()) { + if (!Via.getConfig().isSuppressConversionWarnings() || Via.getManager().isDebug()) { Via.getPlatform().getLogger().warning("No key for " + entry.getValue() + " :( "); } continue; @@ -53,7 +53,7 @@ public class MappingDataLoader { value = findValue(newIdentifiers, diffIdentifiers.get(entry.getKey()).getAsString()); } if (value == null) { - if (!Via.getConfig().isSuppress1_13ConversionErrors() || Via.getManager().isDebug()) { + if (!Via.getConfig().isSuppressConversionWarnings() || Via.getManager().isDebug()) { Via.getPlatform().getLogger().warning("No key for " + entry.getValue() + " :( "); } continue; @@ -68,7 +68,7 @@ public class MappingDataLoader { JsonElement v = oldIdentifiers.get(i); Integer index = findIndex(newIdentifiers, v.getAsString()); if (index == null) { - if (!Via.getConfig().isSuppress1_13ConversionErrors() || Via.getManager().isDebug()) { + if (!Via.getConfig().isSuppressConversionWarnings() || Via.getManager().isDebug()) { Via.getPlatform().getLogger().warning("No key for " + v + " :( "); } continue; diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/packets/InventoryPackets.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/packets/InventoryPackets.java index 3e2798296..42fcac91f 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/packets/InventoryPackets.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/packets/InventoryPackets.java @@ -100,7 +100,7 @@ public class InventoryPackets { flags |= 1; Optional finalSource = SoundSource.findBySource(originalSource); if (!finalSource.isPresent()) { - if (!Via.getConfig().isSuppress1_13ConversionErrors() || Via.getManager().isDebug()) { + if (!Via.getConfig().isSuppressConversionWarnings() || Via.getManager().isDebug()) { Via.getPlatform().getLogger().info("Could not handle unknown sound source " + originalSource + " falling back to default: master"); } finalSource = Optional.of(SoundSource.MASTER); @@ -147,7 +147,7 @@ public class InventoryPackets { String old = channel; channel = getNewPluginChannelId(channel); if (channel == null) { - if (!Via.getConfig().isSuppress1_13ConversionErrors() || Via.getManager().isDebug()) { + if (!Via.getConfig().isSuppressConversionWarnings() || Via.getManager().isDebug()) { Via.getPlatform().getLogger().warning("Ignoring outgoing plugin message with channel: " + old); } wrapper.cancel(); @@ -159,7 +159,7 @@ public class InventoryPackets { String rewritten = getNewPluginChannelId(channels[i]); if (rewritten != null) { rewrittenChannels.add(rewritten); - } else if (!Via.getConfig().isSuppress1_13ConversionErrors() || Via.getManager().isDebug()) { + } else if (!Via.getConfig().isSuppressConversionWarnings() || Via.getManager().isDebug()) { Via.getPlatform().getLogger().warning("Ignoring plugin channel in outgoing REGISTER: " + channels[i]); } } @@ -218,7 +218,7 @@ public class InventoryPackets { String old = channel; channel = getOldPluginChannelId(channel); if (channel == null) { - if (!Via.getConfig().isSuppress1_13ConversionErrors() || Via.getManager().isDebug()) { + if (!Via.getConfig().isSuppressConversionWarnings() || Via.getManager().isDebug()) { Via.getPlatform().getLogger().warning("Ignoring incoming plugin message with channel: " + old); } wrapper.cancel(); @@ -230,7 +230,7 @@ public class InventoryPackets { String rewritten = getOldPluginChannelId(channels[i]); if (rewritten != null) { rewrittenChannels.add(rewritten); - } else if (!Via.getConfig().isSuppress1_13ConversionErrors() || Via.getManager().isDebug()) { + } else if (!Via.getConfig().isSuppressConversionWarnings() || Via.getManager().isDebug()) { Via.getPlatform().getLogger().warning("Ignoring plugin channel in incoming REGISTER: " + channels[i]); } } @@ -431,7 +431,7 @@ public class InventoryPackets { } else if (MappingData.oldToNewItems.containsKey(rawId & ~0xF)) { rawId &= ~0xF; // Remove data } else { - if (!Via.getConfig().isSuppress1_13ConversionErrors() || Via.getManager().isDebug()) { + if (!Via.getConfig().isSuppressConversionWarnings() || Via.getManager().isDebug()) { Via.getPlatform().getLogger().warning("Failed to get 1.13 item for " + item.getIdentifier()); } rawId = 16; // Stone @@ -518,7 +518,7 @@ public class InventoryPackets { } if (rawId == null) { - if (!Via.getConfig().isSuppress1_13ConversionErrors() || Via.getManager().isDebug()) { + if (!Via.getConfig().isSuppressConversionWarnings() || Via.getManager().isDebug()) { Via.getPlatform().getLogger().warning("Failed to get 1.12 item for " + item.getIdentifier()); } rawId = 0x10000; // Stone diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/packets/WorldPackets.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/packets/WorldPackets.java index 06cb00462..9e760c951 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/packets/WorldPackets.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/packets/WorldPackets.java @@ -73,7 +73,7 @@ public class WorldPackets { Optional id = provider.getIntByIdentifier(motive); - if (!id.isPresent() && (!Via.getConfig().isSuppress1_13ConversionErrors() || Via.getManager().isDebug())) { + if (!id.isPresent() && (!Via.getConfig().isSuppressConversionWarnings() || Via.getManager().isDebug())) { Via.getPlatform().getLogger().warning("Could not find painting motive: " + motive + " falling back to default (0)"); } wrapper.write(Type.VAR_INT, id.orElse(0)); @@ -374,7 +374,7 @@ public class WorldPackets { if (!validBiomes.contains(biome)) { if (biome != 255 // is it generated naturally? *shrug* && latestBiomeWarn != biome) { - if (!Via.getConfig().isSuppress1_13ConversionErrors() || Via.getManager().isDebug()) { + if (!Via.getConfig().isSuppressConversionWarnings() || Via.getManager().isDebug()) { Via.getPlatform().getLogger().warning("Received invalid biome id " + biome); } latestBiomeWarn = biome; @@ -502,12 +502,12 @@ public class WorldPackets { } newId = MappingData.blockMappings.getNewId(oldId & ~0xF); // Remove data if (newId != -1) { - if (!Via.getConfig().isSuppress1_13ConversionErrors() || Via.getManager().isDebug()) { + if (!Via.getConfig().isSuppressConversionWarnings() || Via.getManager().isDebug()) { Via.getPlatform().getLogger().warning("Missing block " + oldId); } return newId; } - if (!Via.getConfig().isSuppress1_13ConversionErrors() || Via.getManager().isDebug()) { + if (!Via.getConfig().isSuppressConversionWarnings() || Via.getManager().isDebug()) { Via.getPlatform().getLogger().warning("Missing block completely " + oldId); } // Default stone diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/providers/blockentities/FlowerPotHandler.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/providers/blockentities/FlowerPotHandler.java index 059ec9673..c29917572 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/providers/blockentities/FlowerPotHandler.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/providers/blockentities/FlowerPotHandler.java @@ -61,7 +61,7 @@ public class FlowerPotHandler implements BlockEntityProvider.BlockEntityHandler } else if (flowersNumberId.containsKey(pair)) { return flowersNumberId.get(pair); } else { - if (!Via.getConfig().isSuppress1_13ConversionErrors() || Via.getManager().isDebug()) { + if (!Via.getConfig().isSuppressConversionWarnings() || Via.getManager().isDebug()) { Via.getPlatform().getLogger().warning("Could not find flowerpot content " + item + " for " + tag); } } diff --git a/common/src/main/resources/assets/viaversion/config.yml b/common/src/main/resources/assets/viaversion/config.yml index 5394a40f7..08fa85858 100644 --- a/common/src/main/resources/assets/viaversion/config.yml +++ b/common/src/main/resources/assets/viaversion/config.yml @@ -22,6 +22,8 @@ block-disconnect-msg: "You are using an unsupported Minecraft version!" # (We don't suggest using reload either, use a plugin manager) # You can customise the message we kick people with if you use ProtocolLib here. reload-disconnect-msg: "Server reload, please rejoin!" +# We warn when there's a error converting item and block data over versions, should we suppress these? (Only suggested if spamming) +suppress-conversion-warnings: false # #----------------------------------------------------------# # BUNGEE OPTIONS # @@ -110,8 +112,6 @@ chat-nbt-fix: true quick-move-action-fix: false # Should we use prefix for team colour on 1.13 and above clients team-colour-fix: true -# We warn when there's a error converting from pre-1.13 to 1.13, should we suppress these? (Only suggested if spamming) -suppress-1_13-conversion-errors: false # 1.13 introduced new auto complete which can trigger "Kicked for spamming" for servers older than 1.13, the following option will disable it completely. disable-1_13-auto-complete: false # The following option will delay the tab complete request in x ticks if greater than 0, if other tab-complete is received, the previous is cancelled