Should also handle disconnect
This commit is contained in:
parent
cd952139bc
commit
52a818b109
|
|
@ -4,7 +4,7 @@ plugins {
|
|||
}
|
||||
|
||||
group 'org.adde0109'
|
||||
version '0.5.0'
|
||||
version '0.4.0-reset'
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ import org.slf4j.Logger;
|
|||
import java.nio.file.Path;
|
||||
import java.util.*;
|
||||
|
||||
@Plugin(id = "ambassador", name = "Ambassador", version = "0.4.0", authors = {"adde0109"})
|
||||
@Plugin(id = "ambassador", name = "Ambassador", version = "0.4.0-reset", authors = {"adde0109"})
|
||||
public class Ambassador {
|
||||
|
||||
public ProxyServer server;
|
||||
|
|
|
|||
|
|
@ -73,6 +73,7 @@ public class ForgeConnection {
|
|||
int packetID = ProtocolUtils.readVarInt(clientModListPacket);
|
||||
String[] mods = ProtocolUtils.readStringArray(clientModListPacket);
|
||||
resettable = Arrays.stream(mods).anyMatch((s) -> s.equals("clientresetpacket"));
|
||||
clientModListPacket.release();
|
||||
}
|
||||
});
|
||||
//This gets also sent to vanilla
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ public class ForgeServerSwitchHandler {
|
|||
private class ReSyncHandler implements MinecraftSessionHandler {
|
||||
|
||||
|
||||
private final Player player;
|
||||
private final ConnectedPlayer player;
|
||||
|
||||
private final MinecraftConnection connection;
|
||||
private final Future<ForgeHandshakeUtils.CachedServerHandshake> handshakeFuture;
|
||||
|
|
@ -159,7 +159,7 @@ public class ForgeServerSwitchHandler {
|
|||
|
||||
@Override
|
||||
public boolean handle(LoginPluginResponse packet) {
|
||||
if (!inTransit.removeIf((s) -> s==packet.getId())) {
|
||||
if (!inTransit.removeIf((s) -> s == packet.getId())) {
|
||||
if (packet.getId() == 98) {
|
||||
ForgeHandshakeUtils.CachedServerHandshake handshake;
|
||||
try {
|
||||
|
|
@ -188,6 +188,7 @@ public class ForgeServerSwitchHandler {
|
|||
}
|
||||
connection.flush();
|
||||
}
|
||||
|
||||
private void complete() {
|
||||
VelocityConfiguration configuration = (VelocityConfiguration) ambassador.server.getConfiguration();
|
||||
UUID playerUniqueId = player.getUniqueId();
|
||||
|
|
@ -202,5 +203,15 @@ public class ForgeServerSwitchHandler {
|
|||
connection.setSessionHandler(originalHandler);
|
||||
continuation.resume();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleUnknown(ByteBuf buf) {
|
||||
originalHandler.handleUnknown(buf);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disconnected() {
|
||||
originalHandler.disconnected();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user