Skip to content

Commit 3593a72

Browse files
authored
1.5.8 1.19.3 (#256)
2 parents 10f0bc2 + 0300803 commit 3593a72

File tree

27 files changed

+312
-313
lines changed

27 files changed

+312
-313
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,15 @@ jobs:
3636
- name: Upload artifacts (fabric)
3737
uses: actions/upload-artifact@v3
3838
with:
39-
name: 1.19-${{ steps.github_short_hash.outputs.result }}-fabric
39+
name: 1.19.3-${{ steps.github_short_hash.outputs.result }}-fabric
4040
path: ${{ github.workspace }}/fabric/build/libs
4141
- name: Upload artifacts (quilt)
4242
uses: actions/upload-artifact@v3
4343
with:
44-
name: 1.19-${{ steps.github_short_hash.outputs.result }}-quilt
44+
name: 1.19.3-${{ steps.github_short_hash.outputs.result }}-quilt
4545
path: ${{ github.workspace }}/quilt/build/libs
4646
- name: Upload artifacts (forge)
4747
uses: actions/upload-artifact@v3
4848
with:
49-
name: 1.19-${{ steps.github_short_hash.outputs.result }}-forge
49+
name: 1.19.3-${{ steps.github_short_hash.outputs.result }}-forge
5050
path: ${{ github.workspace }}/forge/build/libs

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ common/build
55
/*/build/
66
build/
77

8-
/fabric/src/main/resources/rpmtw_platform_mod.accesswidener
9-
/quilt/src/main/resources/rpmtw_platform_mod.accesswidener
8+
fabric/src/generated/
9+
quilt/src/generated/
1010

1111
.architectury-transformer/
1212
.idea

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33
# RPMTW Platform Mod
44

55
[![](https://img.shields.io/github/license/RPMTW/RPMTW-Platform-Mod.svg)](LICENSE)
6-
[![](https://img.shields.io/github/release/RPMTW/RPMTW-Platform-Mod.svg)](https://github.com/RPMTW/RPMTW-Platform-Mod/releases)
7-
![](http://cf.way2muchnoise.eu/versions/minecraft_rpmtw-update-mod_all.svg)
8-
[![](http://cf.way2muchnoise.eu/rpmtw-update-mod.svg)](https://www.curseforge.com/minecraft/mc-mods/rpmtw-update-mod)
6+
[![](https://img.shields.io/github/release/RPMTW/RPMTW-Platform-Mod.svg)](../../releases)
7+
![](https://cf.way2muchnoise.eu/versions/rpmtw-platform.svg)
8+
[![](https://cf.way2muchnoise.eu/rpmtw-platform.svg)](https://www.curseforge.com/minecraft/mc-mods/rpmtw-platform)
99
[![](https://img.shields.io/modrinth/dt/ZukQzaRP?label=Modrinth%20Downloads)](https://modrinth.com/mod/ZukQzaRP)
1010
<p>&nbsp;</p>
1111

1212
#### 🌐 README Languages
1313

1414
- English (Current Language)
15-
- [繁體中文](https://github.com/RPMTW/RPMTW-Platform-Mod/blob/main/README/zh_tw.md)
16-
- [简体中文](https://github.com/RPMTW/RPMTW-Platform-Mod/blob/main/README/zh_cn.md)
15+
- [繁體中文](README/zh_tw.md)
16+
- [简体中文](README/zh_cn.md)
1717

1818
## 📚 Introduction
1919

README/zh_cn.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@
22

33
# RPMTW 平台
44

5-
[![](https://img.shields.io/github/license/RPMTW/RPMTW-Platform-Mod.svg)](LICENSE)
6-
[![](https://img.shields.io/github/release/RPMTW/RPMTW-Platform-Mod.svg)](https://github.com/RPMTW/RPMTW-Platform-Mod/releases)
7-
![](http://cf.way2muchnoise.eu/versions/minecraft_rpmtw-update-mod_all.svg)
8-
[![](http://cf.way2muchnoise.eu/rpmtw-update-mod.svg)](https://www.curseforge.com/minecraft/mc-mods/rpmtw-update-mod)
5+
[![](https://img.shields.io/github/license/RPMTW/RPMTW-Platform-Mod.svg)](../LICENSE)
6+
[![](https://img.shields.io/github/release/RPMTW/RPMTW-Platform-Mod.svg)](../../../releases)
7+
![](https://cf.way2muchnoise.eu/versions/rpmtw-platform.svg)
8+
[![](https://cf.way2muchnoise.eu/rpmtw-platform.svg)](https://www.curseforge.com/minecraft/mc-mods/rpmtw-update-mod)
99
[![](https://img.shields.io/modrinth/dt/ZukQzaRP?label=Modrinth%20Downloads)](https://modrinth.com/mod/ZukQzaRP)
1010
<p>&nbsp;</p>
1111
<p>&nbsp;</p>
1212

1313
#### 🌐 自叙文件语言
1414

15-
- [English](https://github.com/RPMTW/RPMTW-Platform-Mod/blob/main/README.md)
16-
- [繁體中文](https://github.com/RPMTW/RPMTW-Platform-Mod/blob/main/README/zh_tw.md)
17-
- 简体中文 (当前语言)
15+
- [English](../../README.md)
16+
- [繁體中文](zh_tw.md)
17+
- 简体中文当前语言
1818

1919
## 📚 介绍
2020

21-
整合了RPMTW各项服务的MOD,涵盖翻译、百科、宇宙通信、中文输入优化等功能,让 Minecraft 中文玩家获得更好的游戏体验。
21+
整合了 RPMTW 各项服务的 MOD,涵盖翻译、百科、宇宙通信、中文输入优化等功能,让 Minecraft 中文玩家获得更好的游戏体验。
2222

2323
## 🎨 特色功能
2424

@@ -41,7 +41,7 @@
4141

4242
- ### 机器翻译
4343

44-
遇到没人工翻译的内容吗?全部交给 AI 吧!不再被语言隔阂导致无法游玩MOD
44+
遇到没人工翻译的内容吗?全部交给 AI 吧!不再被语言隔阂导致无法游玩 MOD
4545

4646
- ### 开启 Crowdin 页面
4747

@@ -73,4 +73,4 @@
7373

7474
## 🎓 许可证
7575

76-
[GNU 通用公共许可证 3.0 版 (GPL3)](https://www.gnu.org/licenses/gpl-3.0.html)
76+
[GNU 通用公共许可证 3.0 版GPL3](https://www.gnu.org/licenses/gpl-3.0.html)

README/zh_tw.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@
22

33
# RPMTW 平台
44

5-
[![](https://img.shields.io/github/license/RPMTW/RPMTW-Platform-Mod.svg)](LICENSE)
6-
[![](https://img.shields.io/github/release/RPMTW/RPMTW-Platform-Mod.svg)](https://github.com/RPMTW/RPMTW-Platform-Mod/releases)
7-
![](http://cf.way2muchnoise.eu/versions/minecraft_rpmtw-update-mod_all.svg)
8-
[![](http://cf.way2muchnoise.eu/rpmtw-update-mod.svg)](https://www.curseforge.com/minecraft/mc-mods/rpmtw-update-mod)
5+
[![](https://img.shields.io/github/license/RPMTW/RPMTW-Platform-Mod.svg)](../LICENSE)
6+
[![](https://img.shields.io/github/release/RPMTW/RPMTW-Platform-Mod.svg)](../../../releases)
7+
![](https://cf.way2muchnoise.eu/versions/rpmtw-platform.svg)
8+
[![](https://cf.way2muchnoise.eu/rpmtw-platform.svg)](https://www.curseforge.com/minecraft/mc-mods/rpmtw-update-mod)
99
[![](https://img.shields.io/modrinth/dt/ZukQzaRP?label=Modrinth%20Downloads)](https://modrinth.com/mod/ZukQzaRP)
1010
<p></p>
1111
<p>&nbsp;</p>
1212

1313
#### 🌐 說明檔案語言
1414

15-
- [English](https://github.com/RPMTW/RPMTW-Platform-Mod/blob/main/README.md)
16-
- 繁體中文 (目前語言)
17-
- [简体中文](https://github.com/RPMTW/RPMTW-Platform-Mod/blob/main/README/zh_cn.md)
15+
- [English](../README.md)
16+
- 繁體中文目前語言
17+
- [简体中文](zh_cn.md)
1818

1919
## 📚 介紹
2020

21-
整合了RPMTW各項服務的模組,涵蓋翻譯、百科、宇宙通訊、中文輸入優化等功能,讓 Minecraft 中文玩家獲得更好的遊戲體驗。
21+
整合了 RPMTW 各項服務的模組,涵蓋翻譯、百科、宇宙通訊、中文輸入優化等功能,讓 Minecraft 中文玩家獲得更好的遊戲體驗。
2222

2323
## 🎨 特色功能
2424

@@ -64,7 +64,7 @@
6464

6565
### ️ 使用的技術
6666

67-
- [Kotlin](https://kotlinlang.org/)
67+
- [Kotlin](https://kotlinlang.org)
6868
- Java
6969
- JVM
7070
- [Architectury](https://github.com/architectury)
@@ -73,4 +73,4 @@
7373

7474
## 🎓 授權條款
7575

76-
[GNU 通用公眾授權條款 3.0 版 (GPL3)](https://www.gnu.org/licenses/gpl-3.0.html)
76+
[GNU 通用公眾授權條款 3.0 版GPL3](https://www.gnu.org/licenses/gpl-3.0.html)

build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
66
plugins {
77
base
88
id("org.jetbrains.kotlin.jvm") version "1.7.22"
9-
id("architectury-plugin") version "3.4.143"
10-
id("dev.architectury.loom") version "1.0.+" apply false
9+
id("architectury-plugin") version "3.4.146"
10+
id("dev.architectury.loom") version "1.2.+" apply false
1111
id("com.github.johnrengelman.shadow") version "7.1.2"
1212
}
1313

common/build.gradle.kts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@ dependencies {
55
// Remove the next line if you don't want to depend on the API
66
modApi("dev.architectury:architectury:${project.property("architectury_version").toString()}")
77
modApi("me.shedaniel.cloth:cloth-config:${project.property("cloth_config_version").toString()}")
8-
modApi(
8+
implementation(
99
group = "com.github.RPMTW",
1010
name = "RPMTW-API-Client-Kotlin",
1111
version = project.property("rpmtw_api_client_version").toString()
1212
)
13+
implementation("com.github.kittinunf.fuel:fuel:2.3.1")
14+
implementation("com.github.kittinunf.fuel:fuel-gson:2.3.1")
15+
implementation("com.github.kittinunf.fuel:fuel-coroutines:2.3.1")
1316
modApi(group = "io.sentry", name = "sentry", version = project.property("sentry_version").toString())
1417
}
1518

common/src/main/kotlin/com/rpmtw/rpmtw_platform_mod/command/CommandHandler.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ object CommandHandler {
1515

1616
fun init() {
1717
val mainCommand = literal("rpmtw")
18-
val commandList = listOf(UniverseMessageActionCommand(), LoginRPMTWAccountCommand())
18+
val commandList =
19+
listOf(UniverseMessageActionCommand(), LoginRPMTWAccountCommand(), LogoutRPMTWAccountCommand())
1920

2021
commandList.forEach {
2122
mainCommand.then(it.register())
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package com.rpmtw.rpmtw_platform_mod.command
2+
3+
import com.mojang.brigadier.builder.LiteralArgumentBuilder
4+
import com.rpmtw.rpmtw_platform_mod.handlers.RPMTWAuthHandler
5+
import net.minecraft.commands.SharedSuggestionProvider
6+
7+
class LogoutRPMTWAccountCommand : RPMTWCommand() {
8+
override fun register(): LiteralArgumentBuilder<SharedSuggestionProvider> {
9+
val command = literal("logout").executes {
10+
RPMTWAuthHandler.logout()
11+
12+
return@executes CommandHandler.success
13+
}
14+
15+
return command
16+
}
17+
}
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
package com.rpmtw.rpmtw_platform_mod.config
2+
3+
import com.mojang.blaze3d.vertex.PoseStack
4+
import com.rpmtw.rpmtw_platform_mod.config.RPMTWConfig.get
5+
import com.rpmtw.rpmtw_platform_mod.handlers.RPMTWAuthHandler
6+
import com.rpmtw.rpmtw_platform_mod.handlers.RPMTWAuthHandler.login
7+
import com.rpmtw.rpmtw_platform_mod.handlers.RPMTWAuthHandler.logout
8+
import me.shedaniel.clothconfig2.api.AbstractConfigListEntry
9+
import net.minecraft.client.Minecraft
10+
import net.minecraft.client.gui.components.AbstractWidget
11+
import net.minecraft.client.gui.components.Button
12+
import net.minecraft.client.gui.components.Tooltip
13+
import net.minecraft.client.gui.components.events.GuiEventListener
14+
import net.minecraft.client.gui.narration.NarratableEntry
15+
import net.minecraft.client.resources.language.I18n
16+
import net.minecraft.network.chat.Component
17+
import java.util.*
18+
19+
20+
class RPMTWAccountEntry : AbstractConfigListEntry<Any?>(
21+
Component.literal(
22+
UUID.randomUUID().toString()
23+
), false
24+
) {
25+
private val widgets: MutableList<AbstractWidget?> = ArrayList()
26+
override fun getItemHeight(): Int {
27+
return 48
28+
}
29+
30+
override fun narratables(): List<NarratableEntry?> {
31+
return widgets
32+
}
33+
34+
override fun getSearchTags(): Iterator<String> {
35+
return Collections.emptyIterator()
36+
}
37+
38+
override fun getValue(): Any {
39+
return Any()
40+
}
41+
42+
@Suppress("UNCHECKED_CAST")
43+
override fun getDefaultValue(): Optional<Any?> {
44+
return Optional.of(Any()) as Optional<Any?>
45+
}
46+
47+
override fun isMouseInside(mouseX: Int, mouseY: Int, x: Int, y: Int, entryWidth: Int, entryHeight: Int): Boolean {
48+
return false
49+
}
50+
51+
override fun render(
52+
matrices: PoseStack,
53+
index: Int,
54+
y: Int,
55+
x: Int,
56+
entryWidth: Int,
57+
entryHeight: Int,
58+
mouseX: Int,
59+
mouseY: Int,
60+
isHovered: Boolean,
61+
delta: Float
62+
) {
63+
super.render(matrices, index, y, x, entryWidth, entryHeight, mouseX, mouseY, isHovered, delta)
64+
val isLogin = get().isLogin()
65+
val authStatus: String = if (isLogin) {
66+
I18n.get("auth.rpmtw_platform_mod.status.logged_in")
67+
} else {
68+
I18n.get("auth.rpmtw_platform_mod.status.not_logged_in")
69+
}
70+
71+
if (!isLogin) {
72+
val loginButton = Button.Builder(
73+
Component.translatable("auth.rpmtw_platform_mod.button.login")
74+
) { _ ->
75+
login(
76+
RPMTWAuthHandler.port
77+
)
78+
}.bounds(entryWidth / 2 + 20, y + 15, 65, 20)
79+
.tooltip(Tooltip.create(Component.translatable("auth.rpmtw_platform_mod.button.login.tooltip"))).build()
80+
loginButton.render(matrices, mouseX, mouseY, delta)
81+
widgets.add(loginButton)
82+
} else {
83+
val logoutButton = Button.builder(
84+
Component.translatable("auth.rpmtw_platform_mod.button.logout")
85+
) { _ -> logout() }.bounds(entryWidth / 2 + 20, y + 15, 65, 20).build()
86+
logoutButton.render(matrices, mouseX, mouseY, delta)
87+
widgets.add(logoutButton)
88+
}
89+
90+
val font = Minecraft.getInstance().font
91+
font.drawShadow(
92+
matrices,
93+
authStatus,
94+
(x - 4 + entryWidth / 2 - Minecraft.getInstance().font.width(authStatus) / 2).toFloat(),
95+
y.toFloat(),
96+
-1
97+
)
98+
}
99+
100+
override fun children(): List<GuiEventListener?> {
101+
return widgets
102+
}
103+
}

0 commit comments

Comments
 (0)