Non-api init commit
This commit is contained in:
parent
57e8ee1441
commit
2d3ebdf108
1
Velocity
Submodule
1
Velocity
Submodule
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 5fe3663d5102c98df1128b06f002e0c5b212f61f
|
||||
|
|
@ -15,11 +15,12 @@ repositories {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'com.velocitypowered:velocity-api:3.1.1'
|
||||
compileOnly 'com.velocitypowered:velocity-api'
|
||||
compileOnly 'com.velocitypowered:velocity-proxy'
|
||||
annotationProcessor 'com.velocitypowered:velocity-api'
|
||||
implementation 'com.electronwill.night-config:toml:3.6.5'
|
||||
implementation 'org.bstats:bstats-velocity:3.0.0'
|
||||
implementation 'org.apache.commons:commons-collections4:4.4'
|
||||
annotationProcessor 'com.velocitypowered:velocity-api:3.1.2-SNAPSHOT'
|
||||
}
|
||||
|
||||
shadowJar {
|
||||
|
|
|
|||
|
|
@ -1,2 +1,7 @@
|
|||
rootProject.name = 'Ambassador'
|
||||
|
||||
includeBuild('Velocity') {
|
||||
dependencySubstitution {
|
||||
substitute module('com.velocitypowered:velocity-api') using project(':velocity-api')
|
||||
substitute module('com.velocitypowered:velocity-proxy') using project(':velocity-proxy')
|
||||
}
|
||||
}
|
||||
|
|
@ -7,6 +7,10 @@ import com.velocitypowered.api.event.player.ServerPreConnectEvent;
|
|||
import com.velocitypowered.api.proxy.Player;
|
||||
import com.velocitypowered.api.util.GameProfile;
|
||||
|
||||
import com.velocitypowered.proxy.connection.MinecraftConnection;
|
||||
import com.velocitypowered.proxy.connection.client.ConnectedPlayer;
|
||||
import com.velocitypowered.proxy.protocol.StateRegistry;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
|
|
@ -58,7 +62,11 @@ public class ForgeServerSwitchHandler {
|
|||
if (ambassador.config.reSyncOptionForge() != AmbassadorConfig.reSyncOption.NEVER) {
|
||||
if (forgeConnection.get().getTransmittedHandshake().isEmpty() || !msg.equals(forgeConnection.get().getTransmittedHandshake().get())) {
|
||||
event.setResult(ServerPreConnectEvent.ServerResult.denied());
|
||||
reSync(event.getPlayer(),forgeServerConnection);
|
||||
try {
|
||||
reSync(event.getPlayer(),forgeServerConnection);
|
||||
} catch (ReflectiveOperationException e) {
|
||||
continuation.resumeWithException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -74,7 +82,7 @@ public class ForgeServerSwitchHandler {
|
|||
continuation.resume();
|
||||
}
|
||||
}
|
||||
private void reSync(Player player, ForgeServerConnection forgeServerConnection) {
|
||||
private void reSync(Player player, ForgeServerConnection forgeServerConnection) throws ReflectiveOperationException {
|
||||
ambassador.logger.info("Kicking {} because of re-sync needed", player);
|
||||
player.disconnect(Component.text("Please reconnect"));
|
||||
reSyncMap.put(player.getUsername(),forgeServerConnection);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user