Skip to content

Commit

Permalink
更新1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Wulian233 authored Jul 23, 2023
1 parent 9636e81 commit cfe3349
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 24 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@
## 重要!使用

发布汉化时,尤其是组长曲逸请注意。请在汉化更新时随手改一下这个模组配置里的版本号。
模组会在config文件夹创建`vmtranslationupdate`的配置文件,有3个配置选项
模组会在config文件夹创建`vmtranslationupdate`的配置文件(1.12.2后缀是.cfg,其他版本都是.toml),有4个配置选项
1. 获取TXT检测更新的url。比如`https://vmct-cn.top/sb3/update.txt`就是读取这个网络文件的内容,必须是UTF-8编码,可以直接打开的直链。
2. 提示玩家下载地址的url。比如`https://vmct-cn.top/sb3/`,会在聊天栏展示。
3. 当前汉化版本。比如第一版。
4. 间隔多少分钟发送知识(仅1.12.2 1.18.x),默认25分钟一次。
---
## 支持版本
- [x] Forge
- [ ] 1.12.2 无计划
- [x] 1.12.2
- [x] 1.16.5
- [x] 1.18.x
- [x] 1.19.2
Expand All @@ -32,6 +33,6 @@
说白了就是a≠b,提示;a=b,不提示。
## 其他

特别感谢ChatGPT,整个模组基本都是东拼西凑出来的。
特别感谢TexTrue移植模组!
## 许可证
MIT
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,13 @@

import java.util.Random;

import static top.vmctcn.vmtranslationupdate.util.TipsUtil.sendRandomMessage;

public class VMTranslationUpdateMod {
public static Random random;
public static int tickCounter;
public static Integer minutes = TipsUtil.getMinutes();
public static final String MOD_ID = "vmtranslationupdate";

public static Integer init() {
public static void init() {
random = new Random();

ClientTickEvent.CLIENT_POST.register(level -> {
Expand All @@ -30,15 +28,15 @@ public static Integer init() {

if (tickCounter >= tickInterval) {
tickCounter = 0;
sendRandomMessage();
TipsUtil.sendRandomMessage();
}
});

PlayerEvent.PLAYER_JOIN.register((player) -> {
String localVersion = ConfigUtil.getConfig().translationVersion;
String onlineVersion = DownloadUtil.getOnlineVersion(player);
String downloadUrl = DownloadUtil.getDownloadUrl();
String name = player.getDisplayName().getString();
String name = player.getName().getString();
if (name.equals("Zi__Min")) {
name = "岷叔";
player.sendSystemMessage(new TranslatableText("欢迎来到籽岷的Minecraft游戏世界!"),Util.NIL_UUID);
Expand All @@ -59,9 +57,5 @@ public static Integer init() {
player.sendSystemMessage(message, Util.NIL_UUID);
}
});

return null;
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import net.minecraft.text.LiteralText;
import top.vmctcn.vmtranslationupdate.config.ConfigScreen;

import static top.vmctcn.vmtranslationupdate.VMTranslationUpdateMod.random;
import top.vmctcn.vmtranslationupdate.VMTranslationUpdateMod;

public class TipsUtil {
public static void sendRandomMessage() {
Expand All @@ -14,11 +14,11 @@ public static void sendRandomMessage() {
minecraft.player.sendMessage(new LiteralText(message), false);
}
}
private static String getRandomMessage() {
public static String getRandomMessage() {
String[] messages = {
"你知道吗:凋零是一种状态效果,凋灵是一种敌对生物。因此绝大多数情况下应称为凋灵。",
"你知道吗: 拧字有3个读音,向两个方向使劲叫2声拧,拧干。一个方向是3声,拧螺丝。",
"你知道吗: 荧石是一种发光方块,火字底。萤石是氟化钙,虫字底。因此绝大多数情况下应称为荧石。",
"你知道吗:拧字有3个读音,向两个方向使劲叫2声拧,拧干。一个方向是3声,拧螺丝。",
"你知道吗:荧石是一种发光方块,火字底。萤石是氟化钙,虫字底。因此绝大多数情况下应称为荧石。",
"你知道吗: 地狱在1.16后更名为下界,因此高版本都是下界。",
"你知道吗: 曲字有2个读音,带弯的念1声,曲线。乐曲音乐是3声,曲艺。",
"你知道吗: 髓有且只有一个读音!读精髓。",
Expand All @@ -32,7 +32,7 @@ private static String getRandomMessage() {
"你知道吗: 这是VM汉化组汉化更新检测模组发出的一条消息。"
};

int index = random.nextInt(messages.length);
int index = VMTranslationUpdateMod.random.nextInt(messages.length);
return messages[index];
}

Expand Down
4 changes: 3 additions & 1 deletion common/src/main/resources/assets/vmupdate/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
"vmtranslationupdate.message.error": "[VM Chinese Group]: Error! There is an issue with the Chinese localization update detection.",
"vmtranslationupdate.message.hover": "Click me to download the new version on the official website!",

"text.autoconfig.vmtranslationupdate.title": "VM Translation Update Config",
"text.autoconfig.vmtranslationupdate.option.updateUrl": "Update link",
"text.autoconfig.vmtranslationupdate.option.downloadUrl": "Download link",
"text.autoconfig.vmtranslationupdate.option.translationVersion": "Modpack Translation Version"
"text.autoconfig.vmtranslationupdate.option.translationVersion": "Modpack Translation Version",
"text.autoconfig.vmtranslationupdate.option.minutes": "How many minutes between sending knowledge"
}
4 changes: 3 additions & 1 deletion common/src/main/resources/assets/vmupdate/lang/zh_cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
"vmtranslationupdate.message.error": "[VM汉化组]:错误!汉化更新检测出现问题。",
"vmtranslationupdate.message.hover": "点我到官网下载新版本!",

"text.autoconfig.vmtranslationupdate.title": "VM汉化组汉化更新检测配置",
"text.autoconfig.vmtranslationupdate.option.updateUrl": "更新检测链接",
"text.autoconfig.vmtranslationupdate.option.downloadUrl": "下载链接",
"text.autoconfig.vmtranslationupdate.option.translationVersion": "整合包翻译版本"
"text.autoconfig.vmtranslationupdate.option.translationVersion": "整合包翻译版本",
"text.autoconfig.vmtranslationupdate.option.minutes": "间隔多少分钟发送知识"
}
4 changes: 3 additions & 1 deletion common/src/main/resources/assets/vmupdate/lang/zh_tw.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
"vmtranslationupdate.message.error": "[VM漢化組]:錯誤!漢化更新檢測出現問題。",
"vmtranslationupdate.message.hover": "點我到官網下載新版本!",

"text.autoconfig.vmtranslationupdate.title": "VM漢化組漢化更新檢測配寘",
"text.autoconfig.vmtranslationupdate.option.updateUrl": "更新檢測鏈接",
"text.autoconfig.vmtranslationupdate.option.downloadUrl": "下載鏈接",
"text.autoconfig.vmtranslationupdate.option.translationVersion": "整合包翻譯版本"
"text.autoconfig.vmtranslationupdate.option.translationVersion": "整合包翻譯版本",
"text.autoconfig.vmtranslationupdate.option.minutes": "間隔多少分鐘發送知識"
}
2 changes: 1 addition & 1 deletion fabric/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"schemaVersion": 1,
"id": "vmtranslationupdate",
"version": "${version}",
"name": "VMTranslationUpdateMod",
"name": "VM Translation Update",
"description": "VM汉化组用于检查汉化补丁更新的MOD",
"authors": [
"Wulian233", "TexTrue"
Expand Down
4 changes: 2 additions & 2 deletions forge/src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ license = "MIT"
[[mods]]
modId = "vmtranslationupdate"
version = "${version}"
displayName = "VMTranslationUpdateMod"
displayName = "VM Translation Update"
displayURL = "https://github.com/VM-Chinese-translate-group/VM-Chinese-Group-Update"
authors = "Wulian233, TexTrue"
description = '''
VM汉化组用于检查汉化补丁更新的MOD
'''
#logoFile = ""
logoFile = "vmtranslationupdate.png"

[[dependencies.vmtranslationupdate]]
modId = "forge"
Expand Down
Binary file added forge/src/main/resources/vmtranslationupdate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ enabled_platforms=fabric,forge
yarn_mappings=1.18.2+build.4

archives_base_name=VMTranslationUpdateMod
mod_version=1.2.0
mod_version=1.3.0
maven_group=top.vmctcn.vmtranslationupdate

architectury_version=4.11.93
Expand Down

0 comments on commit cfe3349

Please sign in to comment.