diff --git a/HMCL/build.gradle.kts b/HMCL/build.gradle.kts index 87d851c6c..43d22d3a0 100644 --- a/HMCL/build.gradle.kts +++ b/HMCL/build.gradle.kts @@ -52,8 +52,6 @@ version = "$versionRoot.$buildNumber" dependencies { implementation(project(":HMCLCore")) implementation("libs:JFoenix") - - implementation("de.javawi.jstun:jstun:0.7.4") } fun digest(algorithm: String, bytes: ByteArray) = MessageDigest.getInstance(algorithm).digest(bytes) diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/multiplayer/MultiplayerPage.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/multiplayer/MultiplayerPage.java index 1dba9927f..f09f6b001 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/multiplayer/MultiplayerPage.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/multiplayer/MultiplayerPage.java @@ -19,7 +19,6 @@ package org.jackhuang.hmcl.ui.multiplayer; import com.jfoenix.controls.JFXButton; import com.jfoenix.controls.JFXDialogLayout; -import de.javawi.jstun.test.DiscoveryInfo; import javafx.beans.property.*; import javafx.scene.control.Label; import javafx.scene.control.Skin; @@ -30,10 +29,8 @@ import org.jackhuang.hmcl.ui.construct.*; import org.jackhuang.hmcl.ui.decorator.DecoratorAnimatedPage; import org.jackhuang.hmcl.ui.decorator.DecoratorPage; import org.jackhuang.hmcl.util.HMCLService; -import org.jackhuang.hmcl.util.Result; import org.jackhuang.hmcl.util.TaskCancellationAction; import org.jackhuang.hmcl.util.io.ChecksumMismatchException; -import org.jetbrains.annotations.Nullable; import java.util.concurrent.CancellationException; import java.util.function.Consumer; @@ -48,7 +45,6 @@ import static org.jackhuang.hmcl.util.i18n.I18n.i18n; public class MultiplayerPage extends DecoratorAnimatedPage implements DecoratorPage, PageAware { private final ReadOnlyObjectWrapper state = new ReadOnlyObjectWrapper<>(State.fromTitle(i18n("multiplayer"))); - private final ReadOnlyObjectWrapper<@Nullable Result> natState = new ReadOnlyObjectWrapper<>(); private final ReadOnlyObjectWrapper session = new ReadOnlyObjectWrapper<>(); private final IntegerProperty port = new SimpleIntegerProperty(); private final StringProperty address = new SimpleStringProperty(); @@ -69,14 +65,6 @@ public class MultiplayerPage extends DecoratorAnimatedPage implements DecoratorP return new MultiplayerPageSkin(this); } - public Result getNatState() { - return natState.get(); - } - - public ReadOnlyObjectProperty> natStateProperty() { - return natState.getReadOnlyProperty(); - } - public int getPort() { return port.get(); } @@ -213,9 +201,7 @@ public class MultiplayerPage extends DecoratorAnimatedPage implements DecoratorP } private void onIPAllocated(MultiplayerManager.HiperIPEvent event) { - runInFX(() -> { - this.address.set(event.getIP()); - }); + runInFX(() -> this.address.set(event.getIP())); } private void onExit(MultiplayerManager.HiperExitEvent event) {