From 4f73cd2b2c09c1505fafc28b1a36d238ae31dbea Mon Sep 17 00:00:00 2001 From: FalsePattern Date: Wed, 17 Apr 2024 17:19:08 +0200 Subject: [PATCH] remove the deprecated update checker --- .../lib/internal/FalsePatternLib.java | 1 - .../lib/internal/config/LibraryConfig.java | 7 -- .../lib/internal/proxy/CommonProxy.java | 1 - .../lib/updates/ModUpdateInfo.java | 61 ---------------- .../lib/updates/UpdateCheckException.java | 54 --------------- .../lib/updates/UpdateChecker.java | 69 ------------------- .../lib/updates/package-info.java | 40 ----------- 7 files changed, 233 deletions(-) delete mode 100644 src/main/java/com/falsepattern/lib/updates/ModUpdateInfo.java delete mode 100644 src/main/java/com/falsepattern/lib/updates/UpdateCheckException.java delete mode 100644 src/main/java/com/falsepattern/lib/updates/UpdateChecker.java delete mode 100644 src/main/java/com/falsepattern/lib/updates/package-info.java diff --git a/src/main/java/com/falsepattern/lib/internal/FalsePatternLib.java b/src/main/java/com/falsepattern/lib/internal/FalsePatternLib.java index ba0c433..8e9d11c 100644 --- a/src/main/java/com/falsepattern/lib/internal/FalsePatternLib.java +++ b/src/main/java/com/falsepattern/lib/internal/FalsePatternLib.java @@ -44,7 +44,6 @@ import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper; guiFactory = Tags.GROUPNAME + ".internal.config.LibraryGuiFactory", acceptableRemoteVersions = "*") public class FalsePatternLib { - public static final String UPDATE_URL = "https://falsepattern.com/mc/api/v2/versions.json"; public static final SimpleNetworkWrapper NETWORK = NetworkRegistry.INSTANCE.newSimpleChannel(Tags.MODID); @SidedProxy(clientSide = Tags.GROUPNAME + ".internal.proxy.ClientProxy", diff --git a/src/main/java/com/falsepattern/lib/internal/config/LibraryConfig.java b/src/main/java/com/falsepattern/lib/internal/config/LibraryConfig.java index 5dc1d33..65732ac 100644 --- a/src/main/java/com/falsepattern/lib/internal/config/LibraryConfig.java +++ b/src/main/java/com/falsepattern/lib/internal/config/LibraryConfig.java @@ -31,13 +31,6 @@ public class LibraryConfig { ConfigurationManager.selfInit(); } - @Config.Comment({"Used to control whether FalsePatternLib should check for outdated mods.", - "If you're building a public modpack, you should turn this off so that your users don't " - + "get nagged about outdated mods."}) - @Config.LangKey("config.falsepatternlib.updatecheck") - @Config.DefaultBoolean(true) - public static boolean ENABLE_UPDATE_CHECKER; - @Config.Comment({"Fixes the mod options menu in-game.", "By default, the mod options when in already in a game will show \"Test1, Test2, DISABLED\" in bright red.", "This replaces that interface with the one from the main menu."}) diff --git a/src/main/java/com/falsepattern/lib/internal/proxy/CommonProxy.java b/src/main/java/com/falsepattern/lib/internal/proxy/CommonProxy.java index 6c3212a..e66e7bf 100644 --- a/src/main/java/com/falsepattern/lib/internal/proxy/CommonProxy.java +++ b/src/main/java/com/falsepattern/lib/internal/proxy/CommonProxy.java @@ -31,7 +31,6 @@ import com.falsepattern.lib.internal.impl.config.net.SyncReply; import com.falsepattern.lib.internal.impl.config.net.SyncReplyHandler; import com.falsepattern.lib.internal.impl.config.net.SyncRequest; import com.falsepattern.lib.internal.impl.config.net.SyncRequestHandler; -import com.falsepattern.lib.updates.UpdateChecker; import lombok.val; import cpw.mods.fml.common.Mod; diff --git a/src/main/java/com/falsepattern/lib/updates/ModUpdateInfo.java b/src/main/java/com/falsepattern/lib/updates/ModUpdateInfo.java deleted file mode 100644 index 6fc4fc1..0000000 --- a/src/main/java/com/falsepattern/lib/updates/ModUpdateInfo.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (C) 2022-2023 FalsePattern - * All Rights Reserved - * - * The above copyright notice and this permission notice - * shall be included in all copies or substantial portions of the Software. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ -package com.falsepattern.lib.updates; - -import com.falsepattern.lib.DeprecationDetails; -import com.falsepattern.lib.StableAPI; -import lombok.Data; -import lombok.NonNull; -import org.apache.logging.log4j.Logger; - -/** - * Obsolete, marked for removal. - */ -@Data -@StableAPI(since = "0.8.0") -@DeprecationDetails(deprecatedSince = "1.0.0", - replacement = "None, the update checker system is being removed.") -@DeprecationDetails.RemovedInVersion("1.1.0") -@Deprecated -public class ModUpdateInfo { - @NonNull - @StableAPI.Expose - public final String modID; - @NonNull - @StableAPI.Expose - public final String currentVersion; - @NonNull - @StableAPI.Expose - public final String latestVersion; - @NonNull - @StableAPI.Expose - public final String updateURL; - - @StableAPI.Expose - public void log(Logger logger) { - logger.info("Updates are available for mod {}: Currently installed version is {}, " - + "latest available version is {}. Update URL: {}", - modID, - currentVersion, - latestVersion, - updateURL.isEmpty() ? "unavailable" : updateURL); - } -} diff --git a/src/main/java/com/falsepattern/lib/updates/UpdateCheckException.java b/src/main/java/com/falsepattern/lib/updates/UpdateCheckException.java deleted file mode 100644 index a8c1f1c..0000000 --- a/src/main/java/com/falsepattern/lib/updates/UpdateCheckException.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (C) 2022-2023 FalsePattern - * All Rights Reserved - * - * The above copyright notice and this permission notice - * shall be included in all copies or substantial portions of the Software. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ -package com.falsepattern.lib.updates; - -import com.falsepattern.lib.DeprecationDetails; -import com.falsepattern.lib.StableAPI; - -/** - * Obsolete, marked for removal. - */ -@StableAPI(since = "0.8.3") -@DeprecationDetails(deprecatedSince = "1.0.0", - replacement = "None, the update checker system is being removed.") -@DeprecationDetails.RemovedInVersion("1.1.0") -@Deprecated -public class UpdateCheckException extends Exception { - @StableAPI.Internal - public UpdateCheckException(String message) { - super(message); - } - - @StableAPI.Internal - public UpdateCheckException(String message, Throwable cause) { - super(message, cause); - } - - @StableAPI.Internal - public UpdateCheckException(Throwable cause) { - super(cause); - } - - @StableAPI.Internal - protected UpdateCheckException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { - super(message, cause, enableSuppression, writableStackTrace); - } -} diff --git a/src/main/java/com/falsepattern/lib/updates/UpdateChecker.java b/src/main/java/com/falsepattern/lib/updates/UpdateChecker.java deleted file mode 100644 index a8868bf..0000000 --- a/src/main/java/com/falsepattern/lib/updates/UpdateChecker.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (C) 2022-2023 FalsePattern - * All Rights Reserved - * - * The above copyright notice and this permission notice - * shall be included in all copies or substantial portions of the Software. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ -package com.falsepattern.lib.updates; - -import com.falsepattern.lib.DeprecationDetails; -import com.falsepattern.lib.StableAPI; -import com.falsepattern.lib.internal.FPLog; -import com.falsepattern.lib.internal.Share; - -import net.minecraft.util.IChatComponent; - -import java.util.Collections; -import java.util.List; -import java.util.concurrent.CompletableFuture; - -/** - * Obsolete, marked for removal. - */ -@StableAPI(since = "0.8.0") -@DeprecationDetails(deprecatedSince = "1.0.0", - replacement = "None, the update checker system is being removed.") -@DeprecationDetails.RemovedInVersion("1.1.0") -@Deprecated -public final class UpdateChecker { - /** - * Obsolete, marked for removal. - */ - @StableAPI.Expose(since = "0.11.0") - public static CompletableFuture> fetchUpdatesAsyncV2(String url) { - FPLog.deprecatedWarning(new Throwable()); - return CompletableFuture.completedFuture(Collections.emptyList()); - } - - /** - * Obsolete, marked for removal. - */ - @StableAPI.Expose(since = "0.11.0") - public static List fetchUpdatesV2(String url) throws UpdateCheckException { - FPLog.deprecatedWarning(new Throwable()); - return Collections.emptyList(); - } - - /** - * Obsolete, marked for removal. - */ - @StableAPI.Expose - public static List updateListToChatMessages(String initiator, List updates) { - FPLog.deprecatedWarning(new Throwable()); - return Collections.emptyList(); - } -} diff --git a/src/main/java/com/falsepattern/lib/updates/package-info.java b/src/main/java/com/falsepattern/lib/updates/package-info.java deleted file mode 100644 index 8e8ae48..0000000 --- a/src/main/java/com/falsepattern/lib/updates/package-info.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2022-2023 FalsePattern - * All Rights Reserved - * - * The above copyright notice and this permission notice - * shall be included in all copies or substantial portions of the Software. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -/** - * This package used to contain a system for checking for updates to mods. - * This system is being removed, and this package is being kept for backwards compatibility. - * Reasons for removal: - * - In older versions of the mod, this used to show a message in chat when an update was available. This was annoying and - * not very useful, so it was removed. - * - In 0.12, the updates were shown only in the console, which is not very visible, so people didn't notice them. - * - The update checker system was very complicated and hard to maintain, and required externally hosted JSON files. - *

- * For anyone who wants to implement their own update checker, don't. Nobody cares about mod updates anyway, - * they will keep playing on ancient versions of the mod no matter what you do or how many critical bugs you fix. - */ -@DeprecationDetails(deprecatedSince = "1.0.0", - replacement = "None, the update checker system is being removed.") -@DeprecationDetails.RemovedInVersion("1.1.0") -@Deprecated -package com.falsepattern.lib.updates; - -import com.falsepattern.lib.DeprecationDetails; \ No newline at end of file