Prevent Vanilla -> Forge switching with error message
This commit is contained in:
parent
6dfbdecfaf
commit
cd6c0be56e
|
|
@ -5,7 +5,7 @@ plugins {
|
||||||
}
|
}
|
||||||
|
|
||||||
group = "org.adde0109"
|
group = "org.adde0109"
|
||||||
version = "1.5.0-beta"
|
version = "1.5.0-rc1"
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ import java.util.concurrent.TimeUnit;
|
||||||
import static com.velocitypowered.api.network.ProtocolVersion.MINECRAFT_1_19;
|
import static com.velocitypowered.api.network.ProtocolVersion.MINECRAFT_1_19;
|
||||||
import static com.velocitypowered.proxy.protocol.packet.brigadier.ArgumentIdentifier.mapSet;
|
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 {
|
public class Ambassador {
|
||||||
|
|
||||||
//Don't forget to update checkCompatibleVersion() when changing this value
|
//Don't forget to update checkCompatibleVersion() when changing this value
|
||||||
|
|
|
||||||
|
|
@ -90,6 +90,15 @@ public enum VelocityForgeBackendConnectionPhase implements BackendConnectionPhas
|
||||||
return;
|
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) {
|
if (message instanceof ModListPacket modListPacket) {
|
||||||
remainingRegistries = new CountDownLatch(modListPacket.getRegistries().size());
|
remainingRegistries = new CountDownLatch(modListPacket.getRegistries().size());
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user