From e62c4a3f9e0ce7dbe7071df6401ebbbde1248c26 Mon Sep 17 00:00:00 2001 From: EnZaXD <60033407+FlorianMichael@users.noreply.github.com> Date: Wed, 14 Feb 2024 09:54:15 +0100 Subject: [PATCH] Rename comparing methods in ProtocolVersion (#3693) --- .../api/protocol/version/ProtocolVersion.java | 22 ++++++++++++++----- .../multiversion/PlayerSneakListener.java | 6 ++--- .../bukkit/platform/BukkitViaLoader.java | 20 ++++++++--------- .../providers/BukkitAckSequenceProvider.java | 2 +- .../bungee/handlers/BungeeServerHandler.java | 6 ++--- .../bungee/platform/BungeeViaLoader.java | 4 ++-- .../viaversion/viaversion/ViaManagerImpl.java | 7 +++--- .../protocols/base/BaseProtocol.java | 4 ++-- .../protocols/base/BaseProtocol1_7.java | 4 ++-- .../Protocol1_12To1_11_1.java | 2 +- .../AbstractFenceConnectionHandler.java | 2 +- .../GlassConnectionHandler.java | 2 +- .../velocity/platform/VelocityViaLoader.java | 2 +- 13 files changed, 46 insertions(+), 37 deletions(-) diff --git a/api/src/main/java/com/viaversion/viaversion/api/protocol/version/ProtocolVersion.java b/api/src/main/java/com/viaversion/viaversion/api/protocol/version/ProtocolVersion.java index ca5d185de..e898f2011 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/protocol/version/ProtocolVersion.java +++ b/api/src/main/java/com/viaversion/viaversion/api/protocol/version/ProtocolVersion.java @@ -353,13 +353,23 @@ public class ProtocolVersion implements Comparable { return snapshotVersion != -1; } + /** + * Returns whether this protocol version is equal to the other protocol version. + * + * @param other other protocol version + * @return true if this protocol version is equal to the other protocol version + */ + public boolean equalTo(final ProtocolVersion other) { + return this.compareTo(other) == 0; + } + /** * Returns whether this protocol version is higher than the other protocol version. * * @param other other protocol version * @return true if this protocol version is higher than the other protocol version */ - public boolean higherThan(final ProtocolVersion other) { + public boolean newerThan(final ProtocolVersion other) { return this.compareTo(other) > 0; } @@ -369,7 +379,7 @@ public class ProtocolVersion implements Comparable { * @param other other protocol version * @return true if this protocol version is higher than or equal to the other protocol version */ - public boolean higherThanOrEquals(final ProtocolVersion other) { + public boolean newerThanOrEquals(final ProtocolVersion other) { return this.compareTo(other) >= 0; } @@ -379,7 +389,7 @@ public class ProtocolVersion implements Comparable { * @param other other protocol version * @return true if this protocol version is lower than the other protocol version */ - public boolean lowerThan(final ProtocolVersion other) { + public boolean olderThan(final ProtocolVersion other) { return this.compareTo(other) < 0; } @@ -389,7 +399,7 @@ public class ProtocolVersion implements Comparable { * @param other other protocol version * @return true if this protocol version is lower than or equal to the other protocol version */ - public boolean lowerThanOrEquals(final ProtocolVersion other) { + public boolean olderThanOrEquals(final ProtocolVersion other) { return this.compareTo(other) <= 0; } @@ -402,7 +412,7 @@ public class ProtocolVersion implements Comparable { * @return true if this protocol version is between the given protocol versions, inclusive */ public boolean betweenInclusive(final ProtocolVersion min, final ProtocolVersion max) { - return this.higherThanOrEquals(min) && this.lowerThanOrEquals(max); + return this.newerThanOrEquals(min) && this.olderThanOrEquals(max); } /** @@ -413,7 +423,7 @@ public class ProtocolVersion implements Comparable { * @return true if this protocol version is between the given protocol versions, exclusive */ public boolean betweenExclusive(final ProtocolVersion min, final ProtocolVersion max) { - return this.higherThan(min) && this.lowerThan(max); + return this.newerThan(min) && this.olderThan(max); } /** diff --git a/bukkit/src/main/java/com/viaversion/viaversion/bukkit/listeners/multiversion/PlayerSneakListener.java b/bukkit/src/main/java/com/viaversion/viaversion/bukkit/listeners/multiversion/PlayerSneakListener.java index 653a2633d..4f52e291d 100644 --- a/bukkit/src/main/java/com/viaversion/viaversion/bukkit/listeners/multiversion/PlayerSneakListener.java +++ b/bukkit/src/main/java/com/viaversion/viaversion/bukkit/listeners/multiversion/PlayerSneakListener.java @@ -71,7 +71,7 @@ public class PlayerSneakListener extends ViaBukkitListener { // From 1.9 upwards the server hitbox is set in every entity tick, so we have to reset it everytime - if (Via.getAPI().getServerVersion().lowestSupportedProtocolVersion().higherThan(ProtocolVersion.v1_8)) { + if (Via.getAPI().getServerVersion().lowestSupportedProtocolVersion().newerThan(ProtocolVersion.v1_8)) { sneaking = new WeakHashMap<>(); useCache = true; plugin.getServer().getScheduler().runTaskTimer(plugin, () -> { @@ -96,7 +96,7 @@ public class PlayerSneakListener extends ViaBukkitListener { if (info == null) return; ProtocolVersion protocolVersion = info.protocolVersion(); - if (is1_14Fix && protocolVersion.higherThanOrEquals(ProtocolVersion.v1_14)) { + if (is1_14Fix && protocolVersion.newerThanOrEquals(ProtocolVersion.v1_14)) { setHeight(player, event.isSneaking() ? HEIGHT_1_14 : STANDING_HEIGHT); if (event.isSneaking()) sneakingUuids.add(player.getUniqueId()); @@ -108,7 +108,7 @@ public class PlayerSneakListener extends ViaBukkitListener { sneaking.put(player, true); else sneaking.remove(player); - } else if (is1_9Fix && protocolVersion.higherThanOrEquals(ProtocolVersion.v1_9)) { + } else if (is1_9Fix && protocolVersion.newerThanOrEquals(ProtocolVersion.v1_9)) { setHeight(player, event.isSneaking() ? HEIGHT_1_9 : STANDING_HEIGHT); if (!useCache) return; if (event.isSneaking()) diff --git a/bukkit/src/main/java/com/viaversion/viaversion/bukkit/platform/BukkitViaLoader.java b/bukkit/src/main/java/com/viaversion/viaversion/bukkit/platform/BukkitViaLoader.java index f5c163f0c..f3a1df47a 100644 --- a/bukkit/src/main/java/com/viaversion/viaversion/bukkit/platform/BukkitViaLoader.java +++ b/bukkit/src/main/java/com/viaversion/viaversion/bukkit/platform/BukkitViaLoader.java @@ -90,7 +90,7 @@ public class BukkitViaLoader implements ViaPlatformLoader { ProtocolVersion serverProtocolVersion = Via.getAPI().getServerVersion().lowestSupportedProtocolVersion(); /* 1.9 client to 1.8 server */ - if (serverProtocolVersion.lowerThan(ProtocolVersion.v1_9)) { + if (serverProtocolVersion.olderThan(ProtocolVersion.v1_9)) { new ArmorListener(plugin).register(); new DeathListener(plugin).register(); new BlockListener(plugin).register(); @@ -101,8 +101,8 @@ public class BukkitViaLoader implements ViaPlatformLoader { } } - if (serverProtocolVersion.lowerThan(ProtocolVersion.v1_14)) { - boolean use1_9Fix = plugin.getConf().is1_9HitboxFix() && serverProtocolVersion.lowerThan(ProtocolVersion.v1_9); + if (serverProtocolVersion.olderThan(ProtocolVersion.v1_14)) { + boolean use1_9Fix = plugin.getConf().is1_9HitboxFix() && serverProtocolVersion.olderThan(ProtocolVersion.v1_9); if (use1_9Fix || plugin.getConf().is1_14HitboxFix()) { try { new PlayerSneakListener(plugin, use1_9Fix, plugin.getConf().is1_14HitboxFix()).register(); @@ -112,7 +112,7 @@ public class BukkitViaLoader implements ViaPlatformLoader { } } - if (serverProtocolVersion.lowerThan(ProtocolVersion.v1_15)) { + if (serverProtocolVersion.olderThan(ProtocolVersion.v1_15)) { try { Class.forName("org.bukkit.event.entity.EntityToggleGlideEvent"); new EntityToggleGlideListener(plugin).register(); @@ -120,7 +120,7 @@ public class BukkitViaLoader implements ViaPlatformLoader { } } - if (serverProtocolVersion.lowerThan(ProtocolVersion.v1_12) && !Boolean.getBoolean("com.viaversion.ignorePaperBlockPlacePatch")) { + if (serverProtocolVersion.olderThan(ProtocolVersion.v1_12) && !Boolean.getBoolean("com.viaversion.ignorePaperBlockPlacePatch")) { boolean paper = true; try { Class.forName("org.github.paperspigot.PaperSpigotConfig"); // Paper 1.8 ? @@ -136,12 +136,12 @@ public class BukkitViaLoader implements ViaPlatformLoader { } } - if (serverProtocolVersion.lowerThan(ProtocolVersion.v1_19_4) && plugin.getConf().isArmorToggleFix() && hasGetHandMethod()) { + if (serverProtocolVersion.olderThan(ProtocolVersion.v1_19_4) && plugin.getConf().isArmorToggleFix() && hasGetHandMethod()) { new ArmorToggleListener(plugin).register(); } /* Providers */ - if (serverProtocolVersion.lowerThan(ProtocolVersion.v1_9)) { + if (serverProtocolVersion.olderThan(ProtocolVersion.v1_9)) { Via.getManager().getProviders().use(MovementTransmitterProvider.class, new BukkitViaMovementTransmitter()); Via.getManager().getProviders().use(HandItemProvider.class, new HandItemProvider() { @@ -167,19 +167,19 @@ public class BukkitViaLoader implements ViaPlatformLoader { }); } - if (serverProtocolVersion.lowerThan(ProtocolVersion.v1_12)) { + if (serverProtocolVersion.olderThan(ProtocolVersion.v1_12)) { if (plugin.getConf().is1_12QuickMoveActionFix()) { Via.getManager().getProviders().use(InventoryQuickMoveProvider.class, new BukkitInventoryQuickMoveProvider()); } } - if (serverProtocolVersion.lowerThan(ProtocolVersion.v1_13)) { + if (serverProtocolVersion.olderThan(ProtocolVersion.v1_13)) { if (Via.getConfig().getBlockConnectionMethod().equalsIgnoreCase("world")) { BukkitBlockConnectionProvider blockConnectionProvider = new BukkitBlockConnectionProvider(); Via.getManager().getProviders().use(BlockConnectionProvider.class, blockConnectionProvider); ConnectionData.blockConnectionProvider = blockConnectionProvider; } } - if (serverProtocolVersion.lowerThan(ProtocolVersion.v1_19)) { + if (serverProtocolVersion.olderThan(ProtocolVersion.v1_19)) { Via.getManager().getProviders().use(AckSequenceProvider.class, new BukkitAckSequenceProvider(plugin)); new BlockBreakListener(plugin).register(); } diff --git a/bukkit/src/main/java/com/viaversion/viaversion/bukkit/providers/BukkitAckSequenceProvider.java b/bukkit/src/main/java/com/viaversion/viaversion/bukkit/providers/BukkitAckSequenceProvider.java index aeb701747..a54fe0787 100644 --- a/bukkit/src/main/java/com/viaversion/viaversion/bukkit/providers/BukkitAckSequenceProvider.java +++ b/bukkit/src/main/java/com/viaversion/viaversion/bukkit/providers/BukkitAckSequenceProvider.java @@ -38,7 +38,7 @@ public final class BukkitAckSequenceProvider extends AckSequenceProvider { final int previousSequence = sequenceStorage.setSequenceId(sequence); if (previousSequence == -1) { final ProtocolVersion serverProtocolVersion = connection.getProtocolInfo().serverProtocolVersion(); - final long delay = serverProtocolVersion.higherThan(ProtocolVersion.v1_8) && serverProtocolVersion.lowerThan(ProtocolVersion.v1_14) ? 2 : 1; + final long delay = serverProtocolVersion.newerThan(ProtocolVersion.v1_8) && serverProtocolVersion.olderThan(ProtocolVersion.v1_14) ? 2 : 1; if (plugin.isEnabled()) { plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new AckSequenceTask(connection, sequenceStorage), delay); diff --git a/bungee/src/main/java/com/viaversion/viaversion/bungee/handlers/BungeeServerHandler.java b/bungee/src/main/java/com/viaversion/viaversion/bungee/handlers/BungeeServerHandler.java index 166767f3b..ed23ed064 100644 --- a/bungee/src/main/java/com/viaversion/viaversion/bungee/handlers/BungeeServerHandler.java +++ b/bungee/src/main/java/com/viaversion/viaversion/bungee/handlers/BungeeServerHandler.java @@ -173,7 +173,7 @@ public class BungeeServerHandler implements Listener { String serverName = server.getInfo().getName(); storage.setCurrentServer(serverName); ProtocolVersion serverProtocolVersion = ProtocolVersion.getProtocol(Via.proxyPlatform().protocolDetectorService().serverProtocolVersion(serverName)); - if (serverProtocolVersion.lowerThanOrEquals(ProtocolVersion.v1_8) && storage.getBossbar() != null) { // 1.8 doesn't have BossBar packet + if (serverProtocolVersion.olderThanOrEquals(ProtocolVersion.v1_8) && storage.getBossbar() != null) { // 1.8 doesn't have BossBar packet // This ensures we can encode it properly as only the 1.9 protocol is currently implemented. if (user.getProtocolInfo().getPipeline().contains(Protocol1_9To1_8.class)) { for (UUID uuid : storage.getBossbar()) { @@ -211,8 +211,8 @@ public class BungeeServerHandler implements Listener { pipeline.add(Via.getManager().getProtocolManager().getBaseProtocol(serverProtocolVersion.getVersion())); // Workaround 1.13 server change - boolean toNewId = previousServerProtocol.lowerThan(ProtocolVersion.v1_13) && serverProtocolVersion.higherThanOrEquals(ProtocolVersion.v1_13); - boolean toOldId = previousServerProtocol.higherThanOrEquals(ProtocolVersion.v1_13) && serverProtocolVersion.lowerThan(ProtocolVersion.v1_13); + boolean toNewId = previousServerProtocol.olderThan(ProtocolVersion.v1_13) && serverProtocolVersion.newerThanOrEquals(ProtocolVersion.v1_13); + boolean toOldId = previousServerProtocol.newerThanOrEquals(ProtocolVersion.v1_13) && serverProtocolVersion.olderThan(ProtocolVersion.v1_13); if (previousServerProtocol.isKnown() && (toNewId || toOldId)) { Collection registeredChannels = (Collection) getRegisteredChannels.invoke(event.getPlayer().getPendingConnection()); if (!registeredChannels.isEmpty()) { diff --git a/bungee/src/main/java/com/viaversion/viaversion/bungee/platform/BungeeViaLoader.java b/bungee/src/main/java/com/viaversion/viaversion/bungee/platform/BungeeViaLoader.java index 4ec9be0a4..e80fa4cc7 100644 --- a/bungee/src/main/java/com/viaversion/viaversion/bungee/platform/BungeeViaLoader.java +++ b/bungee/src/main/java/com/viaversion/viaversion/bungee/platform/BungeeViaLoader.java @@ -61,7 +61,7 @@ public class BungeeViaLoader implements ViaPlatformLoader { registerListener(new BungeeServerHandler()); final ProtocolVersion protocolVersion = Via.getAPI().getServerVersion().lowestSupportedProtocolVersion(); - if (protocolVersion.lowerThan(ProtocolVersion.v1_9)) { + if (protocolVersion.olderThan(ProtocolVersion.v1_9)) { registerListener(new ElytraPatch()); } @@ -69,7 +69,7 @@ public class BungeeViaLoader implements ViaPlatformLoader { Via.getManager().getProviders().use(VersionProvider.class, new BungeeVersionProvider()); Via.getManager().getProviders().use(EntityIdProvider.class, new BungeeEntityIdProvider()); - if (protocolVersion.lowerThan(ProtocolVersion.v1_9)) { + if (protocolVersion.olderThan(ProtocolVersion.v1_9)) { Via.getManager().getProviders().use(BossBarProvider.class, new BungeeBossBarProvider()); Via.getManager().getProviders().use(MainHandProvider.class, new BungeeMainHandProvider()); } diff --git a/common/src/main/java/com/viaversion/viaversion/ViaManagerImpl.java b/common/src/main/java/com/viaversion/viaversion/ViaManagerImpl.java index 509cb26ff..7cbc838ea 100644 --- a/common/src/main/java/com/viaversion/viaversion/ViaManagerImpl.java +++ b/common/src/main/java/com/viaversion/viaversion/ViaManagerImpl.java @@ -43,7 +43,6 @@ import com.viaversion.viaversion.protocols.protocol1_13to1_12_2.TabCompleteThrea import com.viaversion.viaversion.protocols.protocol1_9to1_8.ViaIdleThread; import com.viaversion.viaversion.scheduler.TaskScheduler; import com.viaversion.viaversion.update.UpdateUtil; -import it.unimi.dsi.fastutil.ints.IntSortedSet; import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; @@ -146,7 +145,7 @@ public class ViaManagerImpl implements ViaManager { platform.getLogger().warning("If you need support for older versions you may need to use one or more ViaVersion addons too."); platform.getLogger().warning("In that case please read the ViaVersion resource page carefully or use https://viaversion.com/setup"); platform.getLogger().warning("and if you're still unsure, feel free to join our Discord-Server for further assistance."); - } else if (protocolVersion.highestSupportedProtocolVersion().lowerThan(ProtocolVersion.v1_13)) { + } else if (protocolVersion.highestSupportedProtocolVersion().olderThan(ProtocolVersion.v1_13)) { platform.getLogger().warning("This version of Minecraft is extremely outdated and support for it has reached its end of life. " + "You will still be able to run Via on this Minecraft version, but we are unlikely to provide any further fixes or help with problems specific to legacy Minecraft versions. " + "Please consider updating to give your players a better experience and to avoid issues that have long been fixed."); @@ -169,12 +168,12 @@ public class ViaManagerImpl implements ViaManager { }, 10L); final ProtocolVersion serverProtocolVersion = protocolManager.getServerProtocolVersion().lowestSupportedProtocolVersion(); - if (serverProtocolVersion.lowerThan(ProtocolVersion.v1_9)) { + if (serverProtocolVersion.olderThan(ProtocolVersion.v1_9)) { if (Via.getConfig().isSimulatePlayerTick()) { Via.getPlatform().runRepeatingSync(new ViaIdleThread(), 1L); } } - if (serverProtocolVersion.lowerThan(ProtocolVersion.v1_13)) { + if (serverProtocolVersion.olderThan(ProtocolVersion.v1_13)) { if (Via.getConfig().get1_13TabCompleteDelay() > 0) { Via.getPlatform().runRepeatingSync(new TabCompleteThread(), 1L); } diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/base/BaseProtocol.java b/common/src/main/java/com/viaversion/viaversion/protocols/base/BaseProtocol.java index 535810e68..7912cbdf5 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/base/BaseProtocol.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/base/BaseProtocol.java @@ -71,7 +71,7 @@ public class BaseProtocol extends AbstractProtocol protocolPath = null; // Only allow newer clients (or 1.9.2 on 1.9.4 server if the server supports it) - if (info.protocolVersion().higherThanOrEquals(serverProtocol) || Via.getPlatform().isOldClientsAllowed()) { + if (info.protocolVersion().newerThanOrEquals(serverProtocol) || Via.getPlatform().isOldClientsAllowed()) { protocolPath = Via.getManager().getProtocolManager() .getProtocolPath(info.protocolVersion().getVersion(), serverProtocol.getVersion()); } @@ -108,7 +108,7 @@ public class BaseProtocol extends AbstractProtocol protocols = null; - if (info.protocolVersion().higherThanOrEquals(closestServerProtocol) || Via.getPlatform().isOldClientsAllowed()) { + if (info.protocolVersion().newerThanOrEquals(closestServerProtocol) || Via.getPlatform().isOldClientsAllowed()) { protocols = Via.getManager().getProtocolManager() .getProtocolPath(info.protocolVersion().getVersion(), closestServerProtocol.getVersion()); } @@ -127,7 +127,7 @@ public class BaseProtocol1_7 extends AbstractProtocol { ProtocolInfo info = wrapper.user().getProtocolInfo(); - if (info.protocolVersion().lowerThan(ProtocolVersion.v1_20_2)) { // On 1.20.2+, wait for the login ack + if (info.protocolVersion().olderThan(ProtocolVersion.v1_20_2)) { // On 1.20.2+, wait for the login ack info.setState(State.PLAY); } diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_12to1_11_1/Protocol1_12To1_11_1.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_12to1_11_1/Protocol1_12To1_11_1.java index fc3bb844f..f965e13fc 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_12to1_11_1/Protocol1_12To1_11_1.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_12to1_11_1/Protocol1_12To1_11_1.java @@ -152,7 +152,7 @@ public class Protocol1_12To1_11_1 extends AbstractProtocol packetWrapper.write(Type.VAR_INT, 0)) .scheduleSend(Protocol1_13To1_12_2.class); } diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_13to1_12_2/blockconnections/AbstractFenceConnectionHandler.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_13to1_12_2/blockconnections/AbstractFenceConnectionHandler.java index 2ccbbeeb5..82aca154d 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_13to1_12_2/blockconnections/AbstractFenceConnectionHandler.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_13to1_12_2/blockconnections/AbstractFenceConnectionHandler.java @@ -63,7 +63,7 @@ public abstract class AbstractFenceConnectionHandler extends ConnectionHandler { protected byte getStates(UserConnection user, Position position, int blockState) { byte states = 0; - boolean pre1_12 = user.getProtocolInfo().serverProtocolVersion().lowerThan(ProtocolVersion.v1_12); + boolean pre1_12 = user.getProtocolInfo().serverProtocolVersion().olderThan(ProtocolVersion.v1_12); if (connects(BlockFace.EAST, getBlockData(user, position.getRelative(BlockFace.EAST)), pre1_12)) states |= 1; if (connects(BlockFace.NORTH, getBlockData(user, position.getRelative(BlockFace.NORTH)), pre1_12)) states |= 2; if (connects(BlockFace.SOUTH, getBlockData(user, position.getRelative(BlockFace.SOUTH)), pre1_12)) states |= 4; diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_13to1_12_2/blockconnections/GlassConnectionHandler.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_13to1_12_2/blockconnections/GlassConnectionHandler.java index bc4af334a..32f1344e7 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_13to1_12_2/blockconnections/GlassConnectionHandler.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_13to1_12_2/blockconnections/GlassConnectionHandler.java @@ -59,7 +59,7 @@ public class GlassConnectionHandler extends AbstractFenceConnectionHandler { if (states != 0) return states; ProtocolInfo protocolInfo = user.getProtocolInfo(); - return protocolInfo.serverProtocolVersion().lowerThanOrEquals(ProtocolVersion.v1_8) + return protocolInfo.serverProtocolVersion().olderThanOrEquals(ProtocolVersion.v1_8) && protocolInfo.serverProtocolVersion().isKnown() ? 0xF : states; } } diff --git a/velocity/src/main/java/com/viaversion/viaversion/velocity/platform/VelocityViaLoader.java b/velocity/src/main/java/com/viaversion/viaversion/velocity/platform/VelocityViaLoader.java index d5714bad9..e91a9a469 100644 --- a/velocity/src/main/java/com/viaversion/viaversion/velocity/platform/VelocityViaLoader.java +++ b/velocity/src/main/java/com/viaversion/viaversion/velocity/platform/VelocityViaLoader.java @@ -36,7 +36,7 @@ public class VelocityViaLoader implements ViaPlatformLoader { .getPlugin("viaversion").flatMap(PluginContainer::getInstance).get(); final ProtocolVersion protocolVersion = Via.getAPI().getServerVersion().lowestSupportedProtocolVersion(); - if (protocolVersion.lowerThan(ProtocolVersion.v1_9)) { + if (protocolVersion.olderThan(ProtocolVersion.v1_9)) { Via.getManager().getProviders().use(BossBarProvider.class, new VelocityBossBarProvider()); }