Search in sources :

Example 1 with BaseVersionProvider

use of com.viaversion.viaversion.protocols.base.BaseVersionProvider in project LiquidBouncePlus by WYSI-Foundation.

the class ProviderLoader method load.

@Override
public void load() {
    Via.getManager().getProviders().use(MovementTransmitterProvider.class, new BungeeMovementTransmitter());
    Via.getManager().getProviders().use(VersionProvider.class, new BaseVersionProvider() {

        @Override
        public int getClosestServerProtocol(UserConnection connection) throws Exception {
            if (connection.isClientSide())
                return ViaForge.getInstance().getVersion();
            return super.getClosestServerProtocol(connection);
        }
    });
}
Also used : BungeeMovementTransmitter(com.viaversion.viaversion.bungee.providers.BungeeMovementTransmitter) UserConnection(com.viaversion.viaversion.api.connection.UserConnection) BaseVersionProvider(com.viaversion.viaversion.protocols.base.BaseVersionProvider)

Aggregations

UserConnection (com.viaversion.viaversion.api.connection.UserConnection)1 BungeeMovementTransmitter (com.viaversion.viaversion.bungee.providers.BungeeMovementTransmitter)1 BaseVersionProvider (com.viaversion.viaversion.protocols.base.BaseVersionProvider)1