Skip to content

Commit

Permalink
Velocity b266+ support (#17)
Browse files Browse the repository at this point in the history
* Add support for the Velocity b266+

* Change version to 1.1.3
  • Loading branch information
UserNugget committed Nov 23, 2023
1 parent e40cb9b commit 4407aec
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins {
}

setGroup("net.elytrium")
setVersion("1.1.2")
setVersion("1.1.3")

compileJava {
getOptions().setEncoding("UTF-8")
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/net/elytrium/limboreconnect/LimboReconnect.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ public LimboReconnect(Logger logger, ProxyServer server, @DataDirectory Path dat
this.server = server;

try {
Class.forName("com.velocitypowered.api.proxy.server.PingOptions");
MinecraftConnection.class.getDeclaredMethod("getActiveSessionHandler");
} catch (Throwable throwable) {
throw new UnsupportedOperationException("You are using outdated velocity build! Please update velocity to build #224+");
throw new UnsupportedOperationException("You are using outdated Velocity! Please update Velocity to b266+");
}

this.dataDirectory = dataDirectory;
Expand Down Expand Up @@ -169,7 +169,7 @@ public void reload() {
public void addPlayer(Player player, RegisteredServer server) {
ConnectedPlayer connectedPlayer = (ConnectedPlayer) player;
MinecraftConnection connection = connectedPlayer.getConnection();
MinecraftSessionHandler minecraftSessionHandler = connection.getSessionHandler();
MinecraftSessionHandler minecraftSessionHandler = connection.getActiveSessionHandler();
if (minecraftSessionHandler != null) {
if (minecraftSessionHandler instanceof ClientPlaySessionHandler) {
ClientPlaySessionHandler sessionHandler = (ClientPlaySessionHandler) minecraftSessionHandler;
Expand Down

0 comments on commit 4407aec

Please sign in to comment.