From 690e9c1f2bb1c1b28a84fe44a7a304e314b50a6d Mon Sep 17 00:00:00 2001 From: sirjonasxx <36828922+sirjonasxx@users.noreply.github.com> Date: Tue, 29 Dec 2020 19:19:12 +0100 Subject: [PATCH] yes --- .../prediction/checkers/TypeCheckerProducer.java | 4 ++-- G-Earth/src/main/java/gearth/ui/extra/ExtraController.java | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/G-Earth/src/main/java/gearth/misc/packetrepresentation/prediction/checkers/TypeCheckerProducer.java b/G-Earth/src/main/java/gearth/misc/packetrepresentation/prediction/checkers/TypeCheckerProducer.java index c4c71fc..11255a7 100644 --- a/G-Earth/src/main/java/gearth/misc/packetrepresentation/prediction/checkers/TypeCheckerProducer.java +++ b/G-Earth/src/main/java/gearth/misc/packetrepresentation/prediction/checkers/TypeCheckerProducer.java @@ -6,9 +6,9 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -public class TypeCheckerProducer { +import static gearth.services.Constants.UNITY_PACKETS; - public static volatile boolean UNITY_PACKETS = false; +public class TypeCheckerProducer { public static List getValidators(HPacket packet) { List typeCheckers = new ArrayList<>(Arrays.asList( diff --git a/G-Earth/src/main/java/gearth/ui/extra/ExtraController.java b/G-Earth/src/main/java/gearth/ui/extra/ExtraController.java index 3488c79..d86dca2 100644 --- a/G-Earth/src/main/java/gearth/ui/extra/ExtraController.java +++ b/G-Earth/src/main/java/gearth/ui/extra/ExtraController.java @@ -7,6 +7,7 @@ import gearth.protocol.HConnection; import gearth.protocol.connection.HState; import gearth.protocol.connection.proxy.ProxyProviderFactory; import gearth.protocol.connection.proxy.SocksConfiguration; +import gearth.services.Constants; import gearth.services.gpython.GPythonVersionUtils; import gearth.ui.SubForm; import gearth.ui.info.InfoController; @@ -62,10 +63,10 @@ public class ExtraController extends SubForm implements SocksConfiguration { public GridPane grd_clientSelection; public void initialize() { - TypeCheckerProducer.UNITY_PACKETS = rd_unity.isSelected(); + Constants.UNITY_PACKETS = rd_unity.isSelected(); tgl_clientMode.selectedToggleProperty().addListener(observable -> { - parentController.connectionController.changeClientMode(); - TypeCheckerProducer.UNITY_PACKETS = rd_unity.isSelected(); + if (parentController != null) parentController.connectionController.changeClientMode(); + Constants.UNITY_PACKETS = rd_unity.isSelected(); }); url_troubleshooting.setTooltip(new Tooltip("https://github.com/sirjonasxx/G-Earth/wiki/Troubleshooting"));