From 1e4165047eae97168c335f1f8b5c687c344ad200 Mon Sep 17 00:00:00 2001 From: Zacharias Date: Sat, 15 Jul 2023 14:26:03 +0200 Subject: [PATCH] updated how the server side renamer worked to disable the mod --- .../java/me/zacharias/speedometer/Speedometer.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/common/src/main/java/me/zacharias/speedometer/Speedometer.java b/common/src/main/java/me/zacharias/speedometer/Speedometer.java index 5fc8f94..2965a45 100644 --- a/common/src/main/java/me/zacharias/speedometer/Speedometer.java +++ b/common/src/main/java/me/zacharias/speedometer/Speedometer.java @@ -13,25 +13,30 @@ public class Speedometer { public static final String MOD_ID = "speedometer"; public static final Logger LOGGER = LogManager.getLogger(MOD_ID); - public static final String VERSION = "3.2"; + public static final String VERSION = Platform.getMod(MOD_ID).getVersion(); public static void init() { LOGGER.info("Loading speedometer by Allen"); + if(Platform.getEnvironment() != Env.CLIENT) { LOGGER.error("You're running speedometer on somthing other then a client, this is not supported"); try { for (File f : Objects.requireNonNull(Platform.getModsFolder().toFile().listFiles())) { if (f.getName().startsWith("speedometer")) { - if(f.renameTo(new File(f.getParent(), "speedometer-" + VERSION + ".jar.dis"))){ - LOGGER.warn("Unsuccesful in renaming mod jar"); + String fileName = "speedometer-" + VERSION + ".jar.disable"; + if(f.renameTo(new File(f.getParent(), fileName))){ + LOGGER.warn("Successfully in renaming the mod jar file to "+fileName); + LOGGER.warn("You should remove the file from "+Platform.getModsFolder().toString()); + }else{ + LOGGER.warn("Unsuccessful in renaming mod jar"); + LOGGER.warn("You should remove the mod from "+Platform.getModsFolder().toString()+" to no longer receive this message"); } } } }catch (NullPointerException e){ LOGGER.warn("Can't disable the mod"); } - LOGGER.warn("You should remove the mod from "+Platform.getModsFolder().toString()+" to no longer receive this message"); return; }