Skip to content

Commit

Permalink
Release 1.1.6 - Bump LimboAPI, little refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
SkyWatcher2019 committed Jun 5, 2024
1 parent 24da87d commit 76e50b3
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 23 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.5")
setVersion("1.1.6")

compileJava {
getOptions().setEncoding("UTF-8")
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
limboapiVersion=1.1.18
limboapiVersion=1.1.23
velocityVersion=3.3.0-SNAPSHOT
nettyVersion=4.1.106.Final
serializerVersion=1.1.1
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
3 changes: 0 additions & 3 deletions src/main/java/net/elytrium/limboreconnect/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,6 @@ public static class Title {
public String title;
public String subtitle = "Please wait...";

public Title() {
}

public Title(String title) {
this.title = title;
}
Expand Down
11 changes: 2 additions & 9 deletions src/main/java/net/elytrium/limboreconnect/LimboReconnect.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,6 @@ public LimboReconnect(Logger logger, ProxyServer server, @DataDirectory Path dat
setLogger(logger);
this.server = server;

try {
MinecraftConnection.class.getDeclaredMethod("getActiveSessionHandler");
} catch (Throwable throwable) {
throw new UnsupportedOperationException("You are using outdated Velocity! Please update Velocity to b266+");
}

this.dataDirectory = dataDirectory;
this.configPath = dataDirectory.resolve("config.yml");

Expand Down Expand Up @@ -171,9 +165,8 @@ public void addPlayer(Player player, RegisteredServer server) {
MinecraftConnection connection = connectedPlayer.getConnection();
MinecraftSessionHandler minecraftSessionHandler = connection.getActiveSessionHandler();
if (minecraftSessionHandler != null) {
if (minecraftSessionHandler instanceof ClientPlaySessionHandler) {
ClientPlaySessionHandler sessionHandler = (ClientPlaySessionHandler) minecraftSessionHandler;
for (UUID bossBar : sessionHandler.getServerBossBars()) {
if (minecraftSessionHandler instanceof ClientPlaySessionHandler sessionHandler) {
for (UUID bossBar : sessionHandler.getServerBossBars()) {
BossBarPacket deletePacket = new BossBarPacket();
deletePacket.setUuid(bossBar);
deletePacket.setAction(BossBarPacket.REMOVE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
public class LimboReconnectCommand implements SimpleCommand {

private static final List<Component> HELP_MESSAGE = List.of(Component.text("This server is using LimboReconnect and LimboAPI.", NamedTextColor.YELLOW),
Component.text("(C) 2022 - 2023 Elytrium", NamedTextColor.YELLOW), Component.text("https://elytrium.net/github/", NamedTextColor.GREEN),
Component.text("(C) 2022 - 2024 Elytrium", NamedTextColor.YELLOW), Component.text("https://elytrium.net/github/", NamedTextColor.GREEN),
Component.empty()
);

Expand Down Expand Up @@ -94,10 +94,9 @@ public boolean hasPermission(Invocation invocation) {
private void showHelp(CommandSource source) {
HELP_MESSAGE.forEach(source::sendMessage);

List<Subcommand> availableSubcommands = Arrays.stream(Subcommand.values()).filter(command -> command.hasPermission(source))
.collect(Collectors.toList());
List<Subcommand> availableSubcommands = Arrays.stream(Subcommand.values()).filter(command -> command.hasPermission(source)).toList();

if (availableSubcommands.size() > 0) {
if (!availableSubcommands.isEmpty()) {
source.sendMessage(AVAILABLE_SUBCOMMANDS_MESSAGE);
availableSubcommands.forEach(command -> source.sendMessage(command.getMessageLine()));
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

public class ReconnectHandler implements LimboSessionHandler {

private final PingOptions pingOptions = PingOptions.builder().timeout(Duration.ofMillis(CONFIG.pingTimeout)).build();
private final LimboReconnect plugin;
private final RegisteredServer server;
private LimboPlayer player;
Expand Down Expand Up @@ -61,10 +62,7 @@ private void tick() {
return;
}

PingOptions.Builder options = PingOptions.builder();
options.timeout(Duration.ofMillis(CONFIG.pingTimeout));

this.server.ping(options.build()).whenComplete((ping, exception) -> {
this.server.ping(this.pingOptions).whenComplete((ping, exception) -> {
if (exception != null) {
if (CONFIG.debug) {
LimboReconnect.getLogger()
Expand Down

0 comments on commit 76e50b3

Please sign in to comment.