forked from SteamWar/SteamWar
Hotfix TeamCommand
This commit is contained in:
@@ -19,9 +19,14 @@
|
|||||||
|
|
||||||
package de.steamwar.velocitycore.commands;
|
package de.steamwar.velocitycore.commands;
|
||||||
|
|
||||||
|
import com.velocitypowered.api.network.ProtocolVersion;
|
||||||
import com.velocitypowered.api.proxy.ConnectionRequestBuilder;
|
import com.velocitypowered.api.proxy.ConnectionRequestBuilder;
|
||||||
import com.velocitypowered.api.proxy.server.ServerInfo;
|
import com.velocitypowered.api.proxy.server.ServerInfo;
|
||||||
|
import com.viaversion.viaversion.api.Via;
|
||||||
|
import com.viaversion.viaversion.velocity.platform.VelocityViaAPI;
|
||||||
|
import com.viaversion.viaversion.velocity.platform.VelocityViaConfig;
|
||||||
import de.steamwar.persistent.Storage;
|
import de.steamwar.persistent.Storage;
|
||||||
|
import de.steamwar.velocitycore.ServerVersion;
|
||||||
import de.steamwar.velocitycore.VelocityCore;
|
import de.steamwar.velocitycore.VelocityCore;
|
||||||
import de.steamwar.velocitycore.discord.DiscordBot;
|
import de.steamwar.velocitycore.discord.DiscordBot;
|
||||||
import de.steamwar.velocitycore.inventory.SWItem;
|
import de.steamwar.velocitycore.inventory.SWItem;
|
||||||
@@ -405,6 +410,8 @@ public class TeamCommand extends SWCommand {
|
|||||||
ServerInfo serverInfo = Storage.teamServers.computeIfAbsent(targetTeam.getTeamId(), integer -> {
|
ServerInfo serverInfo = Storage.teamServers.computeIfAbsent(targetTeam.getTeamId(), integer -> {
|
||||||
ServerInfo info = new ServerInfo("Team " + targetTeam.getTeamKuerzel(), address);
|
ServerInfo info = new ServerInfo("Team " + targetTeam.getTeamKuerzel(), address);
|
||||||
VelocityCore.getProxy().registerServer(info);
|
VelocityCore.getProxy().registerServer(info);
|
||||||
|
// This is needed because otherwise ViaVersion uses the wrong version!
|
||||||
|
((VelocityViaConfig) Via.getConfig()).getVelocityServerProtocols().put(info.getName(), ProtocolVersion.MAXIMUM_VERSION.getProtocol());
|
||||||
return info;
|
return info;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user