aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/me/xmrvizzy/skyblocker/SkyblockerInitializer.java2
-rw-r--r--src/main/java/me/xmrvizzy/skyblocker/utils/UpdateChecker.java67
-rw-r--r--src/main/resources/assets/skyblocker/lang/en_us.json5
-rw-r--r--src/main/resources/assets/skyblocker/lang/fr_fr.json5
-rw-r--r--src/main/resources/assets/skyblocker/lang/id_id.json1
-rw-r--r--src/main/resources/assets/skyblocker/lang/ja_JP.json5
-rw-r--r--src/main/resources/assets/skyblocker/lang/ko_KR.json5
-rw-r--r--src/main/resources/assets/skyblocker/lang/ru_ru.json4
-rw-r--r--src/main/resources/assets/skyblocker/lang/zh_cn.json5
9 files changed, 0 insertions, 99 deletions
diff --git a/src/main/java/me/xmrvizzy/skyblocker/SkyblockerInitializer.java b/src/main/java/me/xmrvizzy/skyblocker/SkyblockerInitializer.java
index 3d713727..23c40ace 100644
--- a/src/main/java/me/xmrvizzy/skyblocker/SkyblockerInitializer.java
+++ b/src/main/java/me/xmrvizzy/skyblocker/SkyblockerInitializer.java
@@ -9,7 +9,6 @@ import me.xmrvizzy.skyblocker.skyblock.dwarven.DwarvenHud;
import me.xmrvizzy.skyblocker.skyblock.item.PriceInfoTooltip;
import me.xmrvizzy.skyblocker.skyblock.item.WikiLookup;
import me.xmrvizzy.skyblocker.skyblock.itemlist.ItemRegistry;
-import me.xmrvizzy.skyblocker.utils.UpdateChecker;
import net.fabricmc.api.ClientModInitializer;
public class SkyblockerInitializer implements ClientModInitializer {
@@ -23,7 +22,6 @@ public class SkyblockerInitializer implements ClientModInitializer {
StatsCommand.init();
DwarvenHud.init();
ChatMessageListener.init();
- UpdateChecker.init();
DiscordRPCManager.init();
}
}
diff --git a/src/main/java/me/xmrvizzy/skyblocker/utils/UpdateChecker.java b/src/main/java/me/xmrvizzy/skyblocker/utils/UpdateChecker.java
deleted file mode 100644
index a2809712..00000000
--- a/src/main/java/me/xmrvizzy/skyblocker/utils/UpdateChecker.java
+++ /dev/null
@@ -1,67 +0,0 @@
-package me.xmrvizzy.skyblocker.utils;
-
-import com.google.gson.Gson;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonObject;
-import me.xmrvizzy.skyblocker.SkyblockerMod;
-import me.xmrvizzy.skyblocker.config.SkyblockerConfig;
-import net.fabricmc.loader.api.FabricLoader;
-import net.minecraft.client.MinecraftClient;
-import net.minecraft.text.ClickEvent;
-import net.minecraft.text.HoverEvent;
-import net.minecraft.text.MutableText;
-import net.minecraft.text.Text;
-import org.spongepowered.asm.util.VersionNumber;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.http.HttpClient;
-import java.net.http.HttpRequest;
-import java.net.http.HttpResponse;
-import java.util.concurrent.CompletableFuture;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-public class UpdateChecker {
- public static final Pattern pattern = Pattern.compile("v(.*)\\+.*");
- public static final Pattern localPattern = Pattern.compile("(.*)\\+.*");
- public static Matcher matcher;
- private static VersionNumber latestVersion = null;
- private static VersionNumber localVersion = null;
- public static void shouldUpdate(){
- if (!SkyblockerConfig.get().general.enableUpdateNotification) return;
- try {
- URI uri = new URI("https://api.modrinth.com/v2/project/skyblocker-liap/version");
- HttpRequest request = HttpRequest.newBuilder(uri).GET().build();
- CompletableFuture<HttpResponse<String>> response = HttpClient.newHttpClient().sendAsync(request, HttpResponse.BodyHandlers.ofString());
- response.thenAccept(httpResponse -> {
- JsonObject versionJson = new Gson().fromJson(httpResponse.body(), JsonElement.class).getAsJsonArray().get(0).getAsJsonObject();
- matcher = pattern.matcher(versionJson.get("version_number").getAsString());
- if (matcher.find()) {
- latestVersion = VersionNumber.parse(matcher.group(1));
- }
- matcher = localPattern.matcher(FabricLoader.getInstance().getModContainer(SkyblockerMod.NAMESPACE).get().getMetadata().getVersion().getFriendlyString());
- if (matcher.find()) {
- localVersion = VersionNumber.parse(matcher.group(1));
- }
- if (latestVersion != null && localVersion != null) {
- if (localVersion.compareTo(latestVersion) < 0) {
- MutableText linkMessage = Text.translatable("skyblocker.update.update_message");
- MutableText linkMessageEnding = Text.translatable("skyblocker.update.update_message_end");
- MutableText link = Text.translatable("skyblocker.update.update_link");
- MutableText hoverText = Text.translatable("skyblocker.update.hover_text");
- linkMessage.append(link.styled(style -> style.withClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, "https://modrinth.com/mod/skyblocker-liap/versions")).withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, hoverText)))).append(linkMessageEnding);
-
- MinecraftClient.getInstance().player.sendMessage(linkMessage, false);
- }
- }
- });
- } catch (URISyntaxException e) {
- e.printStackTrace();
- }
- }
-
- public static void init(){
- SkyblockEvents.JOIN.register(UpdateChecker::shouldUpdate);
- }
-}
diff --git a/src/main/resources/assets/skyblocker/lang/en_us.json b/src/main/resources/assets/skyblocker/lang/en_us.json
index 0ff95ccc..d0ba073b 100644
--- a/src/main/resources/assets/skyblocker/lang/en_us.json
+++ b/src/main/resources/assets/skyblocker/lang/en_us.json
@@ -188,11 +188,6 @@
"text.autoconfig.skyblocker.option.messages.hideMana": "Hide Mana Consumption Messages from Action Bar",
"text.autoconfig.skyblocker.option.messages.hideMana.@Tooltip": "Gives a better experience with FancyBar",
- "skyblocker.update.update_message": "§b[§6Skyblocker§b] §2There is a new version available!",
- "skyblocker.update.update_link": " §2§nClick here§r",
- "skyblocker.update.update_message_end" : " §ato find out about latest features.",
- "skyblocker.update.hover_text": "Open Modrinth",
- "text.autoconfig.skyblocker.option.general.enableUpdateNotification": "Update Notification",
"text.autoconfig.skyblocker.option.general.hideEmptyTooltips": "Hide empty item tooltips in menus",
"skyblocker.api.got_key": "§b[§6Skyblocker§b] §2Automatically set your API key!"
diff --git a/src/main/resources/assets/skyblocker/lang/fr_fr.json b/src/main/resources/assets/skyblocker/lang/fr_fr.json
index 0aa85969..f1b48e9e 100644
--- a/src/main/resources/assets/skyblocker/lang/fr_fr.json
+++ b/src/main/resources/assets/skyblocker/lang/fr_fr.json
@@ -75,11 +75,6 @@
"text.autoconfig.skyblocker.option.messages.hideMana": "Cacher les messages de consommation de mana de la barre d'action",
"text.autoconfig.skyblocker.option.messages.hideMana.@Tooltip": "Permet une meilleure expérience avec les barres",
- "skyblocker.update.update_message": "§b[§6Skyblocker§b] §2Une nouvelle version est disponible !",
- "skyblocker.update.update_link": " §2§nCliquez ici§r",
- "skyblocker.update.update_message_end": " §apour découvrir les dernières fonctionnalités.",
- "skyblocker.update.hover_text": "Ouvrir Modrinth",
- "text.autoconfig.skyblocker.option.general.enableUpdateNotification": "Notification de mise à jour",
"skyblocker.api.got_key": "§b[§6Skyblocker§b] §2Votre clé d'API a été automatiquement définie!"
} \ No newline at end of file
diff --git a/src/main/resources/assets/skyblocker/lang/id_id.json b/src/main/resources/assets/skyblocker/lang/id_id.json
index 04257559..4a9696e6 100644
--- a/src/main/resources/assets/skyblocker/lang/id_id.json
+++ b/src/main/resources/assets/skyblocker/lang/id_id.json
@@ -29,6 +29,5 @@
"text.autoconfig.skyblocker.option.general.quicknav": "Navigasi Cepat",
"text.autoconfig.skyblocker.option.general.quicknav.enableQuicknav": "Aktifkan Navigasi Cepat",
"text.autoconfig.skyblocker.option.general.itemTooltip": "Keterangan Item",
- "text.autoconfig.skyblocker.option.general.enableUpdateNotification": "Perbarui Notifikasi",
"skyblocker.api.got_key": "§b[§6Skyblocker§b] §2Setel API key anda secara otomatis!"
} \ No newline at end of file
diff --git a/src/main/resources/assets/skyblocker/lang/ja_JP.json b/src/main/resources/assets/skyblocker/lang/ja_JP.json
index 954647c7..9692708f 100644
--- a/src/main/resources/assets/skyblocker/lang/ja_JP.json
+++ b/src/main/resources/assets/skyblocker/lang/ja_JP.json
@@ -65,10 +65,5 @@
"text.autoconfig.skyblocker.option.messages.hideAutopet": "Autopetのメッセージを非表示にする",
"text.autoconfig.skyblocker.option.messages.hideMana": "マナの使用表示をアクションバーから非表示にする",
"text.autoconfig.skyblocker.option.messages.hideMana.@Tooltip": "FancyBarでより良くできます",
- "skyblocker.update.update_message": "§b[§6Skyblocker§b] §2新しいバージョンがあります!",
- "skyblocker.update.update_link": " §2§nここをクリック§r",
- "skyblocker.update.update_message_end": " §a最新の機能を体験しましょう.",
- "skyblocker.update.hover_text": "Modrinthを開く",
- "text.autoconfig.skyblocker.option.general.enableUpdateNotification": "アップデート通知",
"skyblocker.api.got_key": "§b[§6Skyblocker§b] §2あなたのAPI keyを設定しました!"
}
diff --git a/src/main/resources/assets/skyblocker/lang/ko_KR.json b/src/main/resources/assets/skyblocker/lang/ko_KR.json
index 93930cc1..b190b865 100644
--- a/src/main/resources/assets/skyblocker/lang/ko_KR.json
+++ b/src/main/resources/assets/skyblocker/lang/ko_KR.json
@@ -180,10 +180,5 @@
"text.autoconfig.skyblocker.option.messages.hideAutopet": "Autopet 메시지 가리기",
"text.autoconfig.skyblocker.option.messages.hideMana": "액션바에서 마나 사용 메시지 가리기",
"text.autoconfig.skyblocker.option.messages.hideMana.@Tooltip": "FancyBar 로 더 나은 기능을 사용합니다",
- "skyblocker.update.update_message": "§b[§6Skyblocker§b] §2새로운 버전이 사용 가능합니다!",
- "skyblocker.update.update_link": " §2§n여기§r",
- "skyblocker.update.update_message_end": " §a를 클릭하여 최신 기능에 대해 알아보세요.",
- "skyblocker.update.hover_text": "Modrinth 열기",
- "text.autoconfig.skyblocker.option.general.enableUpdateNotification": "업데이트 알림",
"skyblocker.api.got_key": "§b[§6Skyblocker§b] §2자동으로 API 키를 설정했습니다!"
}
diff --git a/src/main/resources/assets/skyblocker/lang/ru_ru.json b/src/main/resources/assets/skyblocker/lang/ru_ru.json
index 693d2e8f..b1cf0c37 100644
--- a/src/main/resources/assets/skyblocker/lang/ru_ru.json
+++ b/src/main/resources/assets/skyblocker/lang/ru_ru.json
@@ -50,10 +50,6 @@
"text.autoconfig.skyblocker.option.general.itemList": "Список предметов",
"text.autoconfig.skyblocker.option.general.itemList.enableItemList": "Включено",
"text.autoconfig.skyblocker.option.messages.hideCombo": "Скрывать сообщения о комбо",
- "skyblocker.update.update_message": "§b[§6Skyblocker§b] §2Доступна новая версия!",
- "skyblocker.update.update_message_end": " §aчтобы узнать об изменениях.",
- "skyblocker.update.hover_text": "Открыть Modrinth",
- "text.autoconfig.skyblocker.option.general.enableUpdateNotification": "Оповещать об обновлениях",
"skyblocker.api.got_key": "§b[§6Skyblocker§b] §2Ключ API установлен автоматически!",
"key.wikiLookup": "Быстрый переход на вики",
"text.autoconfig.skyblocker.option.general.itemTooltip": "Описание предметов",
diff --git a/src/main/resources/assets/skyblocker/lang/zh_cn.json b/src/main/resources/assets/skyblocker/lang/zh_cn.json
index 3f4ccdc8..9b712096 100644
--- a/src/main/resources/assets/skyblocker/lang/zh_cn.json
+++ b/src/main/resources/assets/skyblocker/lang/zh_cn.json
@@ -95,11 +95,6 @@
"text.autoconfig.skyblocker.option.messages.hideAutopet": "隐藏自动宠物消息",
"text.autoconfig.skyblocker.option.messages.hideMana": "在动作栏中隐藏魔力消耗信息",
"text.autoconfig.skyblocker.option.messages.hideMana.@Tooltip": "被已经提供了更好方案的属性条代替",
- "skyblocker.update.update_message": "§b[§6Skyblocker§b] §2有新版本可用!",
- "skyblocker.update.update_link": " §2§n点击这里§r",
- "skyblocker.update.update_message_end": " §a来了解最新功能",
- "skyblocker.update.hover_text": "打开Modrinth",
- "text.autoconfig.skyblocker.option.general.enableUpdateNotification": "更新通知",
"skyblocker.api.got_key": "§b[§6Skyblocker§b] §2自动设置你的API秘钥!",
"text.autoconfig.skyblocker.option.quickNav.button1.item.nbt": "NBT"
}