From 65e7be449116dc3364e9df4d5ec3cba83c5d1884 Mon Sep 17 00:00:00 2001 From: Draknyte1 Date: Sun, 11 Sep 2016 00:59:40 +1000 Subject: $ Fixed a mistake in the version checking. > comparing Strings with == not .equals() --- src/Java/gtPlusPlus/core/handler/events/LoginEventHandler.java | 9 +++++++-- src/Java/gtPlusPlus/core/lib/CORE.java | 2 ++ src/Java/gtPlusPlus/core/util/Utils.java | 4 ++-- 3 files changed, 11 insertions(+), 4 deletions(-) (limited to 'src/Java/gtPlusPlus/core') diff --git a/src/Java/gtPlusPlus/core/handler/events/LoginEventHandler.java b/src/Java/gtPlusPlus/core/handler/events/LoginEventHandler.java index b35a42017d..1db26846c7 100644 --- a/src/Java/gtPlusPlus/core/handler/events/LoginEventHandler.java +++ b/src/Java/gtPlusPlus/core/handler/events/LoginEventHandler.java @@ -34,8 +34,13 @@ public class LoginEventHandler { PlayerCache.appendParamChanges(localPlayersName, localPlayersUUID.toString()); if (!CORE.isModUpToDate){ - Utils.LOG_INFO("You're not using the latest version of GT++, consider updating."); - Utils.messagePlayer(localPlayerRef, "You're not using the latest version of GT++, consider updating."); + Utils.LOG_INFO("You're not using the latest recommended version of GT++, consider updating."); + Utils.LOG_INFO("Latest version is: "+CORE.MASTER_VERSION); + Utils.LOG_INFO("You currently have: "+CORE.VERSION); + Utils.messagePlayer(localPlayerRef, "You're not using the latest recommended version of GT++, consider updating."); + } + else { + Utils.LOG_INFO("You're using the latest recommended version of GT++."); } } diff --git a/src/Java/gtPlusPlus/core/lib/CORE.java b/src/Java/gtPlusPlus/core/lib/CORE.java index cdcdaa30e2..f88bcfa45c 100644 --- a/src/Java/gtPlusPlus/core/lib/CORE.java +++ b/src/Java/gtPlusPlus/core/lib/CORE.java @@ -2,6 +2,7 @@ package gtPlusPlus.core.lib; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.gregtech.recipehandlers.GregtechRecipe; +import gtPlusPlus.core.util.networking.NetworkUtils; import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials; import gtPlusPlus.xmod.gregtech.api.interfaces.internal.IGregtech_RecipeAdder; import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy; @@ -21,6 +22,7 @@ public class CORE { public static final String name = "GT++"; public static final String MODID = "miscutils"; public static final String VERSION = "1.4.6.5-release"; + public static final String MASTER_VERSION = NetworkUtils.getContentFromURL("https://raw.githubusercontent.com/draknyte1/GTplusplus/master/Recommended.txt").toLowerCase(); public static boolean isModUpToDate = Utils.isModUpToDate(); public static boolean DEBUG = false; public static final boolean LOAD_ALL_CONTENT = false; diff --git a/src/Java/gtPlusPlus/core/util/Utils.java b/src/Java/gtPlusPlus/core/util/Utils.java index 80d7fd06d5..72c4632df2 100644 --- a/src/Java/gtPlusPlus/core/util/Utils.java +++ b/src/Java/gtPlusPlus/core/util/Utils.java @@ -8,7 +8,6 @@ import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.fluid.FluidUtils; import gtPlusPlus.core.util.item.UtilsItems; import gtPlusPlus.core.util.math.MathUtils; -import gtPlusPlus.core.util.networking.NetworkUtils; import ic2.core.IC2Potion; import ic2.core.Ic2Items; import ic2.core.init.InternalName; @@ -60,7 +59,8 @@ public class Utils { } public static boolean isModUpToDate(){ - if (NetworkUtils.getContentFromURL("https://raw.githubusercontent.com/draknyte1/GTplusplus/master/Recommended.txt") == CORE.VERSION){ + + if (CORE.MASTER_VERSION.equals(CORE.VERSION.toLowerCase())){ return true; } return false; -- cgit