Prevent Vanilla -> Forge switching with error message

This commit is contained in:
Adrian Bergqvist 2024-02-01 16:04:29 +01:00
parent 6dfbdecfaf
commit cd6c0be56e
No known key found for this signature in database
GPG Key ID: 3B3DA43224B79417
3 changed files with 11 additions and 2 deletions

View File

@ -5,7 +5,7 @@ plugins {
}
group = "org.adde0109"
version = "1.5.0-beta"
version = "1.5.0-rc1"
repositories {
mavenCentral()

View File

@ -42,7 +42,7 @@ import java.util.concurrent.TimeUnit;
import static com.velocitypowered.api.network.ProtocolVersion.MINECRAFT_1_19;
import static com.velocitypowered.proxy.protocol.packet.brigadier.ArgumentIdentifier.mapSet;
@Plugin(id = "ambassador", name = "Ambassador", version = "1.5.0-beta", authors = {"adde0109"})
@Plugin(id = "ambassador", name = "Ambassador", version = "1.5.0-rc1", authors = {"adde0109"})
public class Ambassador {
//Don't forget to update checkCompatibleVersion() when changing this value

View File

@ -90,6 +90,15 @@ public enum VelocityForgeBackendConnectionPhase implements BackendConnectionPhas
return;
}
if (clientPhase.forgeHandshake.getModListReplyPacket() == null) {
//We have nothing to respond with during this handshake. Unable to proceed.
Ambassador.getInstance().logger.error("Unable for {} to switch servers. " +
"Vanilla({}) -> Forge({}) switch without reset is not yet supported!", player.getGameProfile().getName(),
player.getConnectedServer().getServerInfo().getName(), server.getServerInfo().getName());
server.disconnect();
return;
}
if (message instanceof ModListPacket modListPacket) {
remainingRegistries = new CountDownLatch(modListPacket.getRegistries().size());