Skip to content

Commit 745a6c5

Browse files
authored
Merge pull request #27 from Hendrix-Shen/feature-multi
2 parents b653edc + a7f66c9 commit 745a6c5

29 files changed

Lines changed: 806 additions & 158 deletions

.github/workflows/Build.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ jobs:
1717
steps:
1818
- name: Checkout repository
1919
uses: actions/checkout@v3
20+
with:
21+
fetch-depth: 0
2022

2123
- name: Setup Java JDK
2224
uses: actions/setup-java@v3
@@ -34,15 +36,24 @@ jobs:
3436
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
3537
restore-keys: |
3638
${{ runner.os }}-gradle-
39+
- name: Configuration git
40+
run: |
41+
git config core.filemode false
3742
3843
- name: Gradle executable property additions
3944
run: chmod +x gradlew
4045

46+
- name: Preprocess resources
47+
run: ./gradlew preprocessResources
48+
4149
- name: Build with Gradle
4250
run: ./gradlew build
4351

4452
- name: Upload Build Artifact
4553
uses: actions/upload-artifact@v3
4654
with:
4755
name: Build-Artifacts
48-
path: build/libs
56+
path: |
57+
LICENSE
58+
fabricWrapper/build/libs/*.jar
59+
fabricWrapper/build/tmp/submods/META-INF/jars/*.jar

README.md

Lines changed: 56 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,41 @@
1+
<div align="right">
2+
English
3+
|
4+
<a title="简体中文" href="./README_ZH_CN.md">简体中文</a>
5+
</div>
6+
17
# Command GUI Buttons
28

3-
>Fork from https://github.com/joseph-garcia/command-gui-buttons
9+
> Fork from https://github.com/joseph-garcia/command-gui-buttons
10+
11+
[![Last build](https://img.shields.io/github/actions/workflow/status/MSDNicrosoft/Command-GUI-Buttons/Build.yml?label=Last%20build&style=flat-square)](https://github.com/Hendrix-Shen/Tweak-My-Client/actions/workflows/CI.yml)
12+
[![Github Release](https://img.shields.io/github/v/release/MSDNicrosoft/Command-GUI-Buttons?label=Github%20Release&style=flat-square)](https://github.com/Hendrix-Shen/Tweak-My-Client/releases)
413

5-
Command GUI Buttons is a fabric mod for Minecraft that allows users to create custom command buttons on their clients. Users can bring up this menu in-game with the G key, type in the Name and Command they want to create a button for, and press the `+` to create. It will then show up as a button on their screen to use whenever they want, as the button will automatically execute the command or send chat message they initially entered.
14+
## Description
15+
16+
Command GUI Buttons is a fabric mod for Minecraft that allows users to create custom command buttons on their clients.
17+
Users can bring up this menu in-game with the <kbd>G</kbd> key, type in the button's Name and Command they want to
18+
create, and press the `+` to create. It will then show up as a button on their screen to use whenever they want.
619

720
Create buttons for preset chat messages, commands like `/warp home`, or anything else that goes in the chat box.
821

22+
## Dependencies
23+
24+
| Dependency | Type | Link |
25+
|------------|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|
26+
| Fabric API | Required | [CurseForge](https://www.curseforge.com/minecraft/mc-mods/fabric-api) \| [Modrinth](https://modrinth.com/mod/fabric-api/) |
27+
| LibGui | Required | [GitHub](https://github.com/CottonMC/LibGui/releases) \| [Maven(Not recommend)](https://server.bbkr.space/artifactory/libs-release/io/github/cottonmc/LibGui/) |
28+
29+
For your convenience, download links are listed below:
30+
31+
| Minecraft Version | Fabric API | LibGui (**Please use the given version**) |
32+
|-------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------|
33+
| 1.16.5 | [CurseForge](https://www.curseforge.com/minecraft/mc-mods/fabric-api/files?version=1.16.5) \| [Modrinth](https://modrinth.com/mod/fabric-api/versions?g=1.16.5) | 3.4.0 [GitHub](https://github.com/CottonMC/LibGui/releases/tag/3.4.0) |
34+
| 1.17.1 | [CurseForge](https://www.curseforge.com/minecraft/mc-mods/fabric-api/files?version=1.17.1) \| [Modrinth](https://modrinth.com/mod/fabric-api/versions?g=1.17.1) | 4.2.3 [GitHub](https://github.com/CottonMC/LibGui/releases/tag/4.2.3) |
35+
| 1.18.2 | [CurseForge](https://www.curseforge.com/minecraft/mc-mods/fabric-api/files?version=1.18.2) \| [Modrinth](https://modrinth.com/mod/fabric-api/versions?g=1.18.2) | 5.4.2 [GitHub](https://github.com/CottonMC/LibGui/releases/tag/5.4.2) |
36+
| 1.19.3 | [CurseForge](https://www.curseforge.com/minecraft/mc-mods/fabric-api/files?version=1.19.3) \| [Modrinth](https://modrinth.com/mod/fabric-api/versions?g=1.19.3) | 6.5.3 [GitHub](https://github.com/CottonMC/LibGui/releases/tag/6.5.3) |
37+
| 1.19.4 | [CurseForge](https://www.curseforge.com/minecraft/mc-mods/fabric-api/files?version=1.19.4) \| [Modrinth](https://modrinth.com/mod/fabric-api/versions?g=1.19.4) | 7.0.0-rc1 [GitHub](https://github.com/CottonMC/LibGui/releases/tag/7.0.0-rc.1) |
38+
939
## Features
1040

1141
- Unlimited number of buttons
@@ -17,22 +47,40 @@ Create buttons for preset chat messages, commands like `/warp home`, or anything
1747
![Command Edit](./.github/preview/command.png)
1848
![Message Edit](.github/preview/message.png)
1949

20-
## How to Use:
50+
## How to Use
2151

22-
- Bring up the menu in-game with the `G` key
23-
- Type in the Name and Command you want to save into a button
24-
- Press the `+` button
52+
- Bring up the menu in-game with the <kbd>G</kbd> key
53+
- Type in the Name and Command you want to save into a button
54+
- Press the `+` button
2555

2656
### How It Works
2757

28-
The list of commands are serialized into a JSON format and stored locally on the users’ systems. The mod writes any new commands into the JSON as new buttons are created, and loads the JSON at the start of the game. A local list instance exists for reading and loading the buttons each time, so that file reading is kept to a minimum.
58+
The list of commands are serialized into a JSON format and stored locally on the users’ systems. The mod writes any new
59+
commands into the JSON as new buttons are created, and loads the JSON at the next start of the game.
2960

3061
## Development
3162

63+
## Support
64+
65+
Current main development for Minecraft version: `1.19.4`
66+
67+
And use `preprocess` to be compatible with the following versions.
68+
69+
**Note: We only accept the following versions of issues.**
70+
71+
**Please note that this information is time-sensitive and any version of the issue not listed here will be closed.**
72+
73+
- Minecraft `1.16.5`
74+
- Minecraft `1.17.1`
75+
- Minecraft `1.18.2`
76+
- Minecraft `1.19.2`
77+
- Minecraft `1.19.3`
78+
- Minecraft `1.19.4`
79+
3280
### Mappings
3381

3482
We are using the **Mojang official** mappings to de-obfuscate Minecraft and insert patches.
3583

3684
### Plan(s)
3785

38-
- [] Use the `preprocess` to support low Minecraft versions
86+
- [x] Use the `preprocess` to support low Minecraft versions

README_ZH_CN.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
<div align="right">
2+
<a title="English" href="./README.md">English</a>
3+
|
4+
简体中文
5+
</div>
6+
7+
# Command GUI Buttons
8+
9+
> 复刻自 https://github.com/joseph-garcia/command-gui-buttons
10+
11+
[![Last build](https://img.shields.io/github/actions/workflow/status/MSDNicrosoft/Command-GUI-Buttons/Build.yml?label=Last%20build&style=flat-square)](https://github.com/Hendrix-Shen/Tweak-My-Client/actions/workflows/CI.yml)
12+
[![Github Release](https://img.shields.io/github/v/release/MSDNicrosoft/Command-GUI-Buttons?label=Github%20Release&style=flat-square)](https://github.com/Hendrix-Shen/Tweak-My-Client/releases)
13+
14+
## 描述
15+
16+
Command GUI Buttons 是 Minecraft 的 Fabric 模组,允许用户在其客户端上创建自定义命令按钮。
17+
用户可以在游戏中使用 <kbd>G</kbd> 键调出此菜单,输入他们想要为其创建按钮的名称和命令。
18+
完成之后,相关内容将在屏幕上显示为数个按钮,以便随时使用。
19+
20+
为预设的聊天消息、`/warp home` 等命令,或聊天框中的任何内容创建按钮。
21+
22+
## 依赖
23+
24+
| 依赖 | 类型 | 链接 |
25+
|------------|----|----------------------------------------------------------------------------------------------------------------------------------------------------------------|
26+
| Fabric API | 必须 | [CurseForge](https://www.curseforge.com/minecraft/mc-mods/fabric-api) \| [Modrinth](https://modrinth.com/mod/fabric-api/) |
27+
| LibGui | 必须 | [GitHub](https://github.com/CottonMC/LibGui/releases) \| [Maven(Not recommend)](https://server.bbkr.space/artifactory/libs-release/io/github/cottonmc/LibGui/) |
28+
29+
为了方便,下方已列出下载链接:
30+
31+
| Minecraft 版本 | Fabric API | LibGui (**请使用给定的版本**) |
32+
|--------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------|
33+
| 1.16.5 | [CurseForge](https://www.curseforge.com/minecraft/mc-mods/fabric-api/files?version=1.16.5) \| [Modrinth](https://modrinth.com/mod/fabric-api/versions?g=1.16.5) | 3.4.0 [GitHub](https://github.com/CottonMC/LibGui/releases/tag/3.4.0) |
34+
| 1.17.1 | [CurseForge](https://www.curseforge.com/minecraft/mc-mods/fabric-api/files?version=1.17.1) \| [Modrinth](https://modrinth.com/mod/fabric-api/versions?g=1.17.1) | 4.2.3 [GitHub](https://github.com/CottonMC/LibGui/releases/tag/4.2.3) |
35+
| 1.18.2 | [CurseForge](https://www.curseforge.com/minecraft/mc-mods/fabric-api/files?version=1.18.2) \| [Modrinth](https://modrinth.com/mod/fabric-api/versions?g=1.18.2) | 5.4.2 [GitHub](https://github.com/CottonMC/LibGui/releases/tag/5.4.2) |
36+
| 1.19.3 | [CurseForge](https://www.curseforge.com/minecraft/mc-mods/fabric-api/files?version=1.19.3) \| [Modrinth](https://modrinth.com/mod/fabric-api/versions?g=1.19.3) | 6.5.3 [GitHub](https://github.com/CottonMC/LibGui/releases/tag/6.5.3) |
37+
| 1.19.4 | [CurseForge](https://www.curseforge.com/minecraft/mc-mods/fabric-api/files?version=1.19.4) \| [Modrinth](https://modrinth.com/mod/fabric-api/versions?g=1.19.4) | 7.0.0-rc1 [GitHub](https://github.com/CottonMC/LibGui/releases/tag/7.0.0-rc.1) |
38+
39+
## 功能
40+
41+
- 无限制数量的按钮
42+
- 一个按钮支持多个命令或聊天消息
43+
- 自定义顺序执行命令或发送聊天消息
44+
- 搜索按钮 (**区分大小写**)
45+
46+
![Main Page](./.github/preview/main_page.png)
47+
![Command Edit](./.github/preview/command.png)
48+
![Message Edit](.github/preview/message.png)
49+
50+
## 如何使用
51+
52+
- 使用 <kbd>G</kbd> 键调出游戏内的菜单
53+
- 键入要保存的按钮名称及其命令
54+
- 按游戏内 `+` 按钮
55+
56+
### 工作原理
57+
58+
命令列表被序列化为 JSON 格式,并存储在用户的本地系统上。
59+
当创建新按钮时,该模组会将任何新的聊天消息或命令写入 JSON,并在下一次游戏启动时加载 JSON。
60+
61+
## 开发
62+
63+
### 支持
64+
65+
当前主开发版本: `1.19.4`
66+
67+
并且使用 `预处理` 来兼容下列版本。
68+
69+
**注意:我们仅接受以下版本的议题。**
70+
71+
**请注意该信息的时效性,任何不在此列出的版本议题均会被关闭。**
72+
73+
- Minecraft `1.16.5`
74+
- Minecraft `1.17.1`
75+
- Minecraft `1.18.2`
76+
- Minecraft `1.19.2`
77+
- Minecraft `1.19.3`
78+
- Minecraft `1.19.4`
79+
80+
### 混淆映射表
81+
82+
我们使用 **Mojang 官方** 混淆映射表来反混淆 Minecraft 并插入补丁程序。
83+
84+
### 计划
85+
86+
- [x] 使用 `预处理` 来支持低版本 Minecraft

build.gradle

Lines changed: 32 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,42 @@
11
plugins {
2-
id 'fabric-loom' version '1.0-SNAPSHOT'
2+
id("maven-publish")
3+
id("fabric-loom").version("1.1-SNAPSHOT").apply(false)
4+
id("com.replaymod.preprocess").version("SNAPSHOT")
5+
id("org.ajoberstar.grgit").version("5.0.0")
6+
id("net.kyori.blossom").version("1.3.1").apply(false)
37
}
48

5-
sourceCompatibility = JavaVersion.VERSION_17
6-
targetCompatibility = JavaVersion.VERSION_17
7-
8-
archivesBaseName = "${project.archives_base_name}-mc${project.minecraft_version}-fabric"
9-
version = project.mod_version as Object
10-
group = project.maven_group as Object
11-
12-
repositories {
13-
maven {
14-
name("HangBing Proxy")
15-
url("https://repository.hanbings.io/proxy")
16-
}
17-
maven {
18-
name("CottonMC")
19-
url("https://server.bbkr.space/artifactory/libs-release")
20-
}
21-
maven {
22-
name("CurseMaven")
23-
url("https://www.cursemaven.com")
24-
}
25-
26-
mavenCentral()
27-
mavenLocal()
28-
}
29-
30-
dependencies {
31-
// To change the versions see the gradle.properties file
32-
minecraft("com.mojang:minecraft:${project.minecraft_version}")
33-
mappings(loom.officialMojangMappings())
34-
modImplementation("net.fabricmc:fabric-loader:${project.loader_version}")
35-
36-
modApi("curse.maven:modmenu-308702:${project.modmenu_version}")
37-
38-
modCompileOnly("org.projectlombok:lombok:${project.lombok_version}")
39-
annotationProcessor("org.projectlombok:lombok:${project.lombok_version}")
40-
41-
// Fabric API. This is technically optional, but you probably want it anyway.
42-
modImplementation("net.fabricmc.fabric-api:fabric-api:${project.fabric_version}")
43-
44-
modImplementation("io.github.cottonmc:LibGui:${project.libgui_version}")
45-
include("io.github.cottonmc:LibGui:${project.libgui_version}")
9+
preprocess {
10+
def mc1165 = createNode("1.16.5", 1_16_05, "mojang")
11+
def mc1171 = createNode("1.17.1", 1_17_01, "mojang")
12+
def mc1182 = createNode("1.18.2", 1_18_02, "mojang")
13+
def mc1192 = createNode("1.19.2", 1_19_02, "mojang")
14+
def mc1193 = createNode("1.19.3", 1_19_03, "mojang")
15+
def mc1194 = createNode("1.19.4", 1_19_04, "mojang")
16+
17+
mc1165.link(mc1171, null)
18+
mc1171.link(mc1182, null)
19+
mc1182.link(mc1192, null)
20+
mc1192.link(mc1193, null)
21+
mc1193.link(mc1194, null)
4622
}
4723

48-
processResources {
49-
filesMatching("fabric.mod.json") {
50-
expand(
51-
"version": project.version,
52-
)
53-
}
54-
}
55-
56-
tasks.withType(JavaCompile).configureEach {
57-
// Minecraft 1.18 (1.18-pre2) upwards uses Java 17.
58-
it.options.encoding = "UTF-8"
59-
it.options.release = 17
24+
def ENV = System.getenv()
25+
String realVersion = "${project.mod_version}."
26+
realVersion += ENV.GITHUB_RUN_NUMBER ? ENV.GITHUB_RUN_NUMBER : new Date().format("yyyyMMdd.HHmmss")
27+
if (grgit != null) {
28+
realVersion += grgit.status().isClean() ? "+${grgit.head().abbreviatedId}" : "+uncommited"
29+
} else {
30+
realVersion += "+nogit"
6031
}
6132

62-
java {
63-
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
64-
// if it is present.
65-
// If you remove this line, sources will not be generated.
66-
withSourcesJar()
67-
}
33+
setVersion(realVersion)
6834

69-
jar {
70-
from("LICENSE") {
71-
rename { "${it}_${project.archivesBaseName}" }
35+
tasks.register('cleanPreprocessSources') {
36+
doFirst {
37+
subprojects {
38+
def path = project.projectDir.toPath().resolve('build/preprocessed')
39+
path.toFile().deleteDir()
40+
}
7241
}
7342
}

0 commit comments

Comments
 (0)