From c3c282f970e68905a62915cc78de80eb3fad1ce3 Mon Sep 17 00:00:00 2001 From: winsrewu <78122384+winsrewu@users.noreply.github.com> Date: Thu, 2 May 2024 00:02:14 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E6=9F=90=E4=BA=9B?= =?UTF-8?q?=E6=93=8D=E4=BD=9C,=20=E4=BF=AE=E5=A4=8D=E6=9F=90=E4=BA=9B?= =?UTF-8?q?=E6=BD=9C=E5=9C=A8=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. ClientTickHandler.java 加入了可能会被引用的ClientPlayer对象 2. 加入了大量的@NotNull以及@Nullable@Override注解 3. 为某些重要方法编写了Java doc 4. 修复PlayerMessageSender可能的多线程问题 5. VarDataHandler.java中为避免不正确调用, 加了一堆throw new UnsupportedOperationException(); 6. 优化了ScriptVar的打开文件夹方式, 引用了Mc自己的代码, 现在可支持更多操作系统 7. 在几个Manager里头, 查找返回值可能为null的情况处, 改用了Optional对象以增加可读性 --- .../noglerr/event/ClientTickHandler.java | 3 + .../jawbts/noglerr/tweak/var/DataEditor.java | 13 +-- .../noglerr/tweak/var/DataManagerBase.java | 26 +++++- .../tweak/var/ScriptVarDataHandler.java | 41 ++++++++++ .../noglerr/tweak/var/TargetManager.java | 40 +++++----- .../jawbts/noglerr/tweak/var/TextManager.java | 38 ++++----- .../noglerr/tweak/var/VarDataHandler.java | 24 ++++-- .../jawbts/noglerr/tweak/var/VarManager.java | 38 ++++----- .../noglerr/util/PlayerMessageSender.java | 80 +++++++++++++++---- .../jawbts/noglerr/util/ScriptVarUtils.java | 17 +--- .../resources/assets/noglerr/lang/en_us.json | 6 +- .../resources/assets/noglerr/lang/zh_cn.json | 6 +- 12 files changed, 219 insertions(+), 113 deletions(-) diff --git a/src/main/java/org/jawbts/noglerr/event/ClientTickHandler.java b/src/main/java/org/jawbts/noglerr/event/ClientTickHandler.java index 52eeeed..e52dea7 100644 --- a/src/main/java/org/jawbts/noglerr/event/ClientTickHandler.java +++ b/src/main/java/org/jawbts/noglerr/event/ClientTickHandler.java @@ -2,9 +2,11 @@ import fi.dy.masa.malilib.interfaces.IClientTickHandler; import net.minecraft.client.MinecraftClient; +import net.minecraft.client.network.ClientPlayerEntity; public class ClientTickHandler implements IClientTickHandler { public static MinecraftClient mc; + public static ClientPlayerEntity player; @Override public void onClientTick(MinecraftClient mc) { @@ -12,5 +14,6 @@ public void onClientTick(MinecraftClient mc) { OnTick.onTick(mc); } ClientTickHandler.mc = mc; + player = mc.player; } } \ No newline at end of file diff --git a/src/main/java/org/jawbts/noglerr/tweak/var/DataEditor.java b/src/main/java/org/jawbts/noglerr/tweak/var/DataEditor.java index bcfc9ab..9f2fa4e 100644 --- a/src/main/java/org/jawbts/noglerr/tweak/var/DataEditor.java +++ b/src/main/java/org/jawbts/noglerr/tweak/var/DataEditor.java @@ -3,6 +3,7 @@ import com.google.common.reflect.TypeToken; import com.google.gson.*; import org.jawbts.noglerr.util.PlayerMessageSender; +import org.jetbrains.annotations.NotNull; import java.lang.reflect.Type; import java.util.ArrayList; @@ -80,21 +81,21 @@ public String getType() { return "Unknown"; } - public void printDataList(PlayerMessageSender pms, int page) { + public void printDataList(@NotNull PlayerMessageSender pms, int page) { pms.add("yellow", "------"); pms.add(String.format("%s List: ", getType())); assert dataManagerBase != null; List sd = dataManagerBase.getDataList(); - int maxpage = sd.size() / 10; - page = Math.min(page - 1, maxpage); - int subpage = Math.min((page + 1) * 10, sd.size()); + int maxPage = sd.size() / 10; + page = Math.min(page - 1, maxPage); + int subPage = Math.min((page + 1) * 10, sd.size()); - pms.add(sd.subList(page * 10, subpage)); + pms.add(sd.subList(page * 10, subPage)); if (sd.size() > 10) { - pms.add(String.format("Page %d / %d", page + 1, maxpage + 1)); + pms.add(String.format("Page %d / %d", page + 1, maxPage + 1)); } else if (sd.isEmpty()) { pms.add("Nothing..."); } diff --git a/src/main/java/org/jawbts/noglerr/tweak/var/DataManagerBase.java b/src/main/java/org/jawbts/noglerr/tweak/var/DataManagerBase.java index 4c3af0e..971f991 100644 --- a/src/main/java/org/jawbts/noglerr/tweak/var/DataManagerBase.java +++ b/src/main/java/org/jawbts/noglerr/tweak/var/DataManagerBase.java @@ -1,16 +1,34 @@ package org.jawbts.noglerr.tweak.var; import java.util.List; +import java.util.Optional; public interface DataManagerBase { - //if not exists, return false + /** + * 删除一个数据 + * + * @param name 数据的名称 + * @return 如果不存在, {@code false}, 反之为 {@code true}. + */ boolean delData(String name); - //if exists, return false; if hard, modify the data + /** + * 添加一个数据 + * + * @param name 数据的名称 + * @param value 数据的值 + * @param hard 是否强制添加 + * @return 在不强制添加的情况下, 如果数据已存在, 返回{@code false}. 强制情况下一定为{@code true}. + */ boolean addData(String name, String value, boolean hard); - //if not exists, return null - SavedData getData(String name); + /** + * 获取数据 + * + * @param name 数据的名称 + * @return 存在就有值, 不存在就没有. + */ + Optional getData(String name); void setData(List savedDataList); diff --git a/src/main/java/org/jawbts/noglerr/tweak/var/ScriptVarDataHandler.java b/src/main/java/org/jawbts/noglerr/tweak/var/ScriptVarDataHandler.java index cde84e8..f939d82 100644 --- a/src/main/java/org/jawbts/noglerr/tweak/var/ScriptVarDataHandler.java +++ b/src/main/java/org/jawbts/noglerr/tweak/var/ScriptVarDataHandler.java @@ -5,12 +5,23 @@ import net.minecraft.entity.Entity; import org.jawbts.noglerr.client.NoglerrClient; +import java.util.List; + public class ScriptVarDataHandler extends VarDataHandler { private final String name; + public ScriptVarDataHandler(String name) { this.name = name; } + public ScriptVarDataHandler() { + throw new UnsupportedOperationException(); + } + + public ScriptVarDataHandler(String name, String value) { + throw new UnsupportedOperationException(); + } + @Override public String getTreatedData(Entity entity, ClientWorld world, ClientPlayerEntity player) { try { @@ -20,4 +31,34 @@ public String getTreatedData(Entity entity, ClientWorld world, ClientPlayerEntit return "EXCEPTION " + e.getMessage(); } } + + @Override + public String getData() { + throw new UnsupportedOperationException(); + } + + @Override + public void setData(String data) { + throw new UnsupportedOperationException(); + } + + @Override + public SavedData getSavedData() { + throw new UnsupportedOperationException(); + } + + @Override + public void setArgList(List argList) { + throw new UnsupportedOperationException(); + } + + @Override + public void createArgList() { + throw new UnsupportedOperationException(); + } + + @Override + public String toString() { + throw new UnsupportedOperationException(); + } } diff --git a/src/main/java/org/jawbts/noglerr/tweak/var/TargetManager.java b/src/main/java/org/jawbts/noglerr/tweak/var/TargetManager.java index 07697c6..250408a 100644 --- a/src/main/java/org/jawbts/noglerr/tweak/var/TargetManager.java +++ b/src/main/java/org/jawbts/noglerr/tweak/var/TargetManager.java @@ -5,6 +5,7 @@ import java.util.ArrayList; import java.util.List; +import java.util.Optional; public class TargetManager implements DataManagerBase { private static final TargetManager INSTANCE = new TargetManager(); @@ -20,46 +21,45 @@ public static DataEditor getEditor() { } public boolean addData(String name, String value, boolean hard) { - SavedData sd = getData(name); - if (sd != null) { + Optional sd = getData(name); + sd.ifPresentOrElse(savedData -> { if (hard) { - targetDataHandlerList.remove(new TargetDataHandler(sd.name, sd.value)); + targetDataHandlerList.remove(new TargetDataHandler(savedData.name, savedData.value)); targetDataHandlerList.add(new TargetDataHandler(name, value)); onChanged(); - return true; } - return false; - } - targetDataHandlerList.add(new TargetDataHandler(name, value)); - onChanged(); - return true; + }, () -> { + targetDataHandlerList.add(new TargetDataHandler(name, value)); + onChanged(); + }); + + return hard || sd.isEmpty(); } public boolean delData(String name) { - onChanged(); - SavedData sd = getData(name); - if (sd == null) { - return false; - } - targetDataHandlerList.remove(new TargetDataHandler(sd.name, sd.value)); - return true; + Optional sd = getData(name); + sd.ifPresent(savedData -> { + targetDataHandlerList.remove(new TargetDataHandler(savedData.name, savedData.value)); + onChanged(); + }); + return sd.isPresent(); } - public SavedData getData(String name) { + public Optional getData(String name) { for (TargetDataHandler data : targetDataHandlerList) { if (data.getName().equals(name)) { - return data.getSavedData(); + return Optional.of(data.getSavedData()); } } - return null; + return Optional.empty(); } public void setData(List savedDataList) { - onChanged(); targetDataHandlerList.clear(); for (SavedData sd : savedDataList) { targetDataHandlerList.add(new TargetDataHandler(sd.name, sd.value)); } + onChanged(); } public List getDataList() { diff --git a/src/main/java/org/jawbts/noglerr/tweak/var/TextManager.java b/src/main/java/org/jawbts/noglerr/tweak/var/TextManager.java index aea0041..b208ed3 100644 --- a/src/main/java/org/jawbts/noglerr/tweak/var/TextManager.java +++ b/src/main/java/org/jawbts/noglerr/tweak/var/TextManager.java @@ -4,6 +4,7 @@ import java.util.ArrayList; import java.util.List; +import java.util.Optional; public class TextManager implements DataManagerBase { private static final TextManager INSTANCE = new TextManager(); @@ -19,38 +20,37 @@ public static DataEditor getEditor() { } public boolean addData(String name, String value, boolean hard) { - SavedData sd = getData(name); - if (sd != null) { + Optional sd = getData(name); + sd.ifPresentOrElse(savedData -> { if (hard) { - textDataHandlerList.remove(new TextDataHandler(sd.name, sd.value)); + textDataHandlerList.remove(new TextDataHandler(savedData.name, savedData.value)); textDataHandlerList.add(new TextDataHandler(name, value)); onChanged(); - return true; } - return false; - } - textDataHandlerList.add(new TextDataHandler(name, value)); - onChanged(); - return true; + }, () -> { + textDataHandlerList.add(new TextDataHandler(name, value)); + onChanged(); + }); + + return hard || sd.isEmpty(); } public boolean delData(String name) { - SavedData sd = getData(name); - if (sd == null) { - return false; - } - textDataHandlerList.remove(new TextDataHandler(sd.name, sd.value)); - onChanged(); - return true; + Optional sd = getData(name); + sd.ifPresent(savedData -> { + textDataHandlerList.remove(new TextDataHandler(savedData.name, savedData.value)); + onChanged(); + }); + return sd.isPresent(); } - public SavedData getData(String name) { + public Optional getData(String name) { for (TextDataHandler data : textDataHandlerList) { if (data.getName().equals(name)) { - return data.getSavedData(); + return Optional.of(data.getSavedData()); } } - return null; + return Optional.empty(); } public TextDataHandler getHandler(String name) { diff --git a/src/main/java/org/jawbts/noglerr/tweak/var/VarDataHandler.java b/src/main/java/org/jawbts/noglerr/tweak/var/VarDataHandler.java index 77332af..34d645e 100644 --- a/src/main/java/org/jawbts/noglerr/tweak/var/VarDataHandler.java +++ b/src/main/java/org/jawbts/noglerr/tweak/var/VarDataHandler.java @@ -7,6 +7,8 @@ import net.minecraft.nbt.NbtCompound; import org.jawbts.noglerr.config.Configs; import org.jawbts.noglerr.tweak.Utils; +import org.jetbrains.annotations.Contract; +import org.jetbrains.annotations.NotNull; import java.io.StringReader; import java.util.ArrayList; @@ -20,7 +22,6 @@ public class VarDataHandler extends DataHandlerBase { private Entity vEntity; private ClientWorld vWorld; - private ClientPlayerEntity vPlayer; public VarDataHandler() { data.name = "unnamed"; @@ -32,22 +33,27 @@ public VarDataHandler(String name, String value) { data.value = Utils.escapeString(value); } + @Override public String getName() { return data.name; } + @Override public void setName(String name) { data.name = Utils.escapeString(name); } + @Override public String getData() { return data.value; } + @Override public void setData(String data) { this.data.value = Utils.escapeString(data); } + @Override public SavedData getSavedData() { return data; } @@ -146,7 +152,7 @@ public void createArgList() { } cache = new StringBuilder(); } - } else if (state == 4) { + } else { if (c == ']') { state = 0; argCache.add(new Arg(ArgType.OPERATOR, cache.toString())); @@ -193,7 +199,6 @@ public void createArgList() { public String getTreatedData(Entity entity, ClientWorld world, ClientPlayerEntity player) { vEntity = entity; vWorld = world; - vPlayer = player; argListFailReason = null; createArgList(); @@ -257,6 +262,7 @@ public String getTreatedData(Entity entity, ClientWorld world, ClientPlayerEntit return ans; } + @Override public String toString() { return String.format("Name: %s Value: %s", data.name, data.value); } @@ -268,24 +274,25 @@ public static int getInt(String s) { return Integer.parseInt(s); } - public static Long getLong(String s) { + public static @NotNull Long getLong(String s) { return Long.parseLong(s); } - public static Float getFloat(String s) { + public static @NotNull Float getFloat(String s) { return Float.parseFloat(s); } - public static Double getDouble(String s) { + public static @NotNull Double getDouble(String s) { return Double.parseDouble(s); } - public static Boolean getBoolean(String s) { + @Contract(pure = true) + public static @NotNull Boolean getBoolean(String s) { return Boolean.parseBoolean(s); } } - private class Arg { + class Arg { private final String value; private final boolean isVar; private final String varName; @@ -317,6 +324,7 @@ public boolean needUpdate() { return isVar; } + @Override public String toString() { return isVar ? type.name() + " " + varName : type.name() + " " + value; } diff --git a/src/main/java/org/jawbts/noglerr/tweak/var/VarManager.java b/src/main/java/org/jawbts/noglerr/tweak/var/VarManager.java index 494189e..a957f0c 100644 --- a/src/main/java/org/jawbts/noglerr/tweak/var/VarManager.java +++ b/src/main/java/org/jawbts/noglerr/tweak/var/VarManager.java @@ -4,6 +4,7 @@ import java.util.ArrayList; import java.util.List; +import java.util.Optional; public class VarManager implements DataManagerBase { private static final VarManager INSTANCE = new VarManager(); @@ -19,38 +20,37 @@ public static DataEditor getEditor() { } public boolean addData(String name, String value, boolean hard) { - SavedData sd = getData(name); - if (sd != null) { + Optional sd = getData(name); + sd.ifPresentOrElse(savedData -> { if (hard) { - varDataHandlerList.remove(new VarDataHandler(sd.name, sd.value)); + varDataHandlerList.remove(new VarDataHandler(savedData.name, savedData.value)); varDataHandlerList.add(new VarDataHandler(name, value)); onChanged(); - return true; } - return false; - } - varDataHandlerList.add(new VarDataHandler(name, value)); - onChanged(); - return true; + }, () -> { + varDataHandlerList.add(new VarDataHandler(name, value)); + onChanged(); + }); + + return hard || sd.isEmpty(); } public boolean delData(String name) { - SavedData sd = getData(name); - if (sd == null) { - return false; - } - varDataHandlerList.remove(new VarDataHandler(sd.name, sd.value)); - onChanged(); - return true; + Optional sd = getData(name); + sd.ifPresent(savedData -> { + varDataHandlerList.remove(new VarDataHandler(savedData.name, savedData.value)); + onChanged(); + }); + return sd.isPresent(); } - public SavedData getData(String name) { + public Optional getData(String name) { for (VarDataHandler data : varDataHandlerList) { if (data.getName().equals(name)) { - return data.getSavedData(); + return Optional.ofNullable(data.getSavedData()); } } - return null; + return Optional.empty(); } public VarDataHandler getHandler(String name) { diff --git a/src/main/java/org/jawbts/noglerr/util/PlayerMessageSender.java b/src/main/java/org/jawbts/noglerr/util/PlayerMessageSender.java index 828b705..459de81 100644 --- a/src/main/java/org/jawbts/noglerr/util/PlayerMessageSender.java +++ b/src/main/java/org/jawbts/noglerr/util/PlayerMessageSender.java @@ -1,47 +1,87 @@ package org.jawbts.noglerr.util; import fi.dy.masa.malilib.util.StringUtils; +import net.minecraft.client.MinecraftClient; import net.minecraft.client.network.ClientPlayerEntity; -import net.minecraft.text.LiteralText; -import net.minecraft.text.Style; -import net.minecraft.text.Text; -import net.minecraft.text.TextColor; +import net.minecraft.text.*; +import net.minecraft.util.Formatting; import org.jawbts.noglerr.tweak.Utils; +import org.jetbrains.annotations.NotNull; +import java.io.File; +import java.net.URL; import java.util.ArrayList; +import java.util.Collections; import java.util.List; -// 向玩家发送信息 +/*** + * 用于向玩家发送消息的工具类 + *

所有{@code add()}方法都是把东西加到缓存里头, {@code send()}方法才是真正发送

+ */ public class PlayerMessageSender { - // 全局消息 处理在event.OnTick + /** + * 全局消息 处理位置如下 + * {@link org.jawbts.noglerr.event.OnTick#onTick(MinecraftClient)} + */ static PlayerMessageSender sPlayerMesSender = new PlayerMessageSender(); - private final List MesList = new ArrayList<>(); + private final List MesList = Collections.synchronizedList(new ArrayList<>()); + /** + * 获取内置的全局消息实例 + * + * @return 那个实例 + */ public static PlayerMessageSender getInstance() { return sPlayerMesSender; } + /** + * 把内容加入发送缓存 + * + * @param text 要发送的 Text 对象 + */ public void add(Text text) { MesList.add(text); } + /** + * 把内容加入发送缓存 + * + * @param color 颜色, 见 {@link TextColor#parse(String)} + * @param s 要发送的内容(会经过翻译) + */ public void add(String color, String s) { - s = StringUtils.translate(s); - // MesList.add(Text.Serializer.fromJson("{\"color\":\"" + color + "\",\"text\":\"" + s + "\"}")); + s = StringUtils.translate(s.replace("%", "%%")); MesList.add(new LiteralText(s).setStyle(Style.EMPTY.withColor(TextColor.parse(color)))); } + /** + * 把内容加入发送缓存 + * + * @param s 要发送的内容(会经过翻译) + */ public void add(String s) { - s = StringUtils.translate(s); + // 这里头会过String.format(), 所以要加这个. + s = StringUtils.translate(s.replace("%", "%%")); MesList.add(Text.of(s)); } - public void add(List s) { + /** + * 把内容加入发送缓存 + * + * @param s 将列表内的所有内容{@code toString()}, 然后加入缓存. 不会翻译. + */ + public void add(@NotNull List s) { for (Object ss : s) { add(Utils.escapeString(ss.toString())); } } + /** + * 将缓存内所有内容发给某个玩家, 然后清掉缓存 + * + * @param player 要发给的玩家 + */ public void send(ClientPlayerEntity player) { if (!isReady()) { return; @@ -49,8 +89,10 @@ public void send(ClientPlayerEntity player) { if (MesList.isEmpty()) { return; } - for (int i = 0; i < MesList.size(); i++) { - player.sendMessage(MesList.get(i), false); + // MesList可能会被其他线程操作 + List MesListCopy = List.copyOf(MesList); + for (Text text : MesListCopy) { + player.sendMessage(text, false); } MesList.clear(); } @@ -58,4 +100,14 @@ public void send(ClientPlayerEntity player) { private boolean isReady() { return Utils.playerReadyCheck(); } -} + + public static class Tools { + public static Text genUrlOpenText(@NotNull URL url) { + return new LiteralText(url.toString()).setStyle( + Style.EMPTY.withClickEvent( + new ClickEvent(ClickEvent.Action.OPEN_URL, url.toString())) + .withColor(TextColor.parse("blue")).withUnderline(true) + ); + } + } +} \ No newline at end of file diff --git a/src/main/java/org/jawbts/noglerr/util/ScriptVarUtils.java b/src/main/java/org/jawbts/noglerr/util/ScriptVarUtils.java index 0ac9f5a..56a84c2 100644 --- a/src/main/java/org/jawbts/noglerr/util/ScriptVarUtils.java +++ b/src/main/java/org/jawbts/noglerr/util/ScriptVarUtils.java @@ -1,16 +1,16 @@ package org.jawbts.noglerr.util; +import net.minecraft.util.Util; import org.jawbts.noglerr.client.NoglerrClient; +import org.jetbrains.annotations.Nullable; -import java.awt.*; import java.io.File; -import java.io.IOException; import java.util.Objects; public class ScriptVarUtils { private static final File CONFIG_DIR = new File("./config/noglerr/var_scripts"); - public static File getConfigDir() { + public static @Nullable File getConfigDir() { if ((CONFIG_DIR.exists() && CONFIG_DIR.isDirectory()) || CONFIG_DIR.mkdirs()) return CONFIG_DIR; NoglerrClient.LOGGER.error("Error while opening folder. '{}", CONFIG_DIR.getAbsolutePath()); @@ -25,16 +25,7 @@ public static File[] getVarFiles() { } public static boolean openFolder() { - try { - // TODO support other system besides Windows - Runtime.getRuntime().exec("explorer " + Objects.requireNonNull(getConfigDir()).getAbsolutePath()); - - // it's headless mod, don't use it. - // Desktop.getDesktop().open(getConfigDir()); - } catch (IOException e) { - NoglerrClient.LOGGER.error("Err while opening folder. '{}", CONFIG_DIR.getAbsolutePath(), e); - return false; - } + Util.getOperatingSystem().open(getConfigDir()); return true; } } diff --git a/src/main/resources/assets/noglerr/lang/en_us.json b/src/main/resources/assets/noglerr/lang/en_us.json index 0836492..ec50d3c 100644 --- a/src/main/resources/assets/noglerr/lang/en_us.json +++ b/src/main/resources/assets/noglerr/lang/en_us.json @@ -17,13 +17,11 @@ "noglerr.command.versionInfoNotReady": "Version info not ready. Do '/noglerr version check' first.", "noglerr.command.versionInfo": "Current branch: %s , Current version: %s , Latest version: %s , Lowest safe version: %s", "noglerr.command.cannotOpenFolder": "Error while opening folder. Check log for details.", - "noglerr.gui.title": "NoGLErr", "noglerr.gui.title.generic": "Generic", "noglerr.gui.title.toggleHotkeys": "Toggle Hotkeys", "noglerr.gui.title.detailed": "Detailed Config", "noglerr.gui.title.toggles": "Toggles", - "noglerr.comments.gui.openConfigScreen": "Open the in-game noglerr config screen", "noglerr.comments.gui.showVisualEffects": "Show visual effects", "noglerr.comments.gui.showEntityDetailConfig": "Config json", @@ -37,7 +35,6 @@ "noglerr.comments.gui.enableAutoUpdateCheck": "If enabled, will automatically check for updates when the game starts. Recommended.", "noglerr.comments.gui.silentUpdate": "Only notify you when in case of emergency. Recommended.", "noglerr.comments.gui.voiceToTextFormat": "Voice to text format", - "noglerr.tweaks.showEntityDetailConfig": "ShowEntityDetailConfig", "noglerr.tweaks.showVFX": "ShowVFX", "noglerr.tweaks.showEntityDetail": "ShowEntityDetail", @@ -51,7 +48,6 @@ "noglerr.tweaks.microphoneSwitch": "Microphone", "noglerr.tweaks.enableAutoUpdateCheck": "Enable Auto Update Check", "noglerr.tweaks.silentUpdateCheck": "Silent Update Check", - "noglerr.info.versionOutDated": "Your Noglerr version is out dated.", "noglerr.info.versionNotSafe": "Your Noglerr version is not safe", "noglerr.info.checkUrl": "Please check this url: ", @@ -59,6 +55,6 @@ "noglerr.info.safeVersionNotReady": "Safe version not ready yet. Please disable your mod for now.", "noglerr.info.checkFiled": "Check failed, check your log for further information.", "noglerr.info.versionPerfect": "Noglerr at latest safe version.", - + "noglerr.info.folderOpenFailed": "The folder could not be opened. Please open it manually.", "noglerr.hotkeys.openConfigScreen": "OpenConfigScreen" } \ No newline at end of file diff --git a/src/main/resources/assets/noglerr/lang/zh_cn.json b/src/main/resources/assets/noglerr/lang/zh_cn.json index 7d9c52c..f49c186 100644 --- a/src/main/resources/assets/noglerr/lang/zh_cn.json +++ b/src/main/resources/assets/noglerr/lang/zh_cn.json @@ -17,13 +17,11 @@ "noglerr.command.versionInfoNotReady": "版本信息未就绪, 请先执行 '/noglerr version check'.", "noglerr.command.versionInfo": "当前分支: %s , 当前版本: %s , 最新版本: %s , 最低安全版本: %s", "noglerr.command.cannotOpenFolder": "无法打开文件夹. 请检查日志以获取更多信息.", - "noglerr.gui.title": "NoGLErr", "noglerr.gui.title.generic": "通用", "noglerr.gui.title.toggleHotkeys": "开关快捷键", "noglerr.gui.title.detailed": "详细配置", "noglerr.gui.title.toggles": "开关", - "noglerr.comments.gui.openConfigScreen": "打开游戏内noglerr配置菜单", "noglerr.comments.gui.showVisualEffects": "显示视觉效果", "noglerr.comments.gui.showEntityDetailConfig": "配置用json", @@ -37,7 +35,6 @@ "noglerr.comments.gui.enableAutoUpdateCheck": "如果启用, 则在游戏启动时自动检查更新. 建议启用.", "noglerr.comments.gui.silentUpdate": "仅在有重大bug时提醒您更新. 建议启用.", "noglerr.comments.gui.voiceToTextFormat": "语音转文字格式", - "noglerr.tweaks.showEntityDetailConfig": "显示实体详细信息配置", "noglerr.tweaks.showVFX": "显示视觉效果", "noglerr.tweaks.showEntityDetail": "显示实体详细信息", @@ -51,7 +48,6 @@ "noglerr.tweaks.microphoneSwitch": "麦克风", "noglerr.tweaks.enableAutoUpdateCheck": "允许自动更新检查", "noglerr.tweaks.silentUpdateCheck": "静默更新", - "noglerr.info.versionOutDated": "Noglerr 模组有可用更新.", "noglerr.info.versionNotSafe": "Noglerr 模组不安全.", "noglerr.info.checkUrl": "请访问此网站: ", @@ -59,6 +55,6 @@ "noglerr.info.safeVersionNotReady": "安全的版本尚未就绪, 请暂时禁用您的模组.", "noglerr.info.checkFiled": "更新检测失败, 请检查您的日志.", "noglerr.info.versionPerfect": "Noglerr 是最新安全版本.", - + "noglerr.info.folderOpenFailed": "文件夹无法打开. 请手动打开.", "noglerr.hotkeys.openConfigScreen": "打开配置界面" } \ No newline at end of file