Skip to content

Commit 2ce24ab

Browse files
committed
refactor: Improve project structure & code style
* Fix missing alpha channel in font color * Update Nyan Maven URL * Update README Signed-off-by: MSDNicrosoft <i@msdnicrosoft.work>
1 parent 8223b65 commit 2ce24ab

File tree

13 files changed

+95
-76
lines changed

13 files changed

+95
-76
lines changed

README.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,19 @@ create, and press the button `+` to create. Then, the button will appear on user
2727

2828
For your convenience, download links are listed below:
2929

30-
| Minecraft Version | Fabric API | LibGui (**Please use the given version**) |
31-
|-------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------|
32-
| 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) |
33-
| 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) |
34-
| 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) |
35-
| 1.19.2 | [CurseForge](https://www.curseforge.com/minecraft/mc-mods/fabric-api/files?version=1.19.2) \| [Modrinth](https://modrinth.com/mod/fabric-api/versions?g=1.19.2) | 6.4.0 [GitHub](https://github.com/CottonMC/LibGui/releases/tag/6.4.0) |
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.1.1 [GitHub](https://github.com/CottonMC/LibGui/releases/tag/7.1.1) |
38-
| 1.20.6 | [CurseForge](https://www.curseforge.com/minecraft/mc-mods/fabric-api/files?version=1.20.6) \| [Modrinth](https://modrinth.com/mod/fabric-api/versions?g=1.20.6) | 10.0.0 [GitHub](https://github.com/CottonMC/LibGui/releases/tag/10.0.0) |
39-
| 1.21.5 | [CurseForge](https://www.curseforge.com/minecraft/mc-mods/fabric-api/files?version=1.21.5) \| [Modrinth](https://modrinth.com/mod/fabric-api/versions?g=1.21.5) | 13.1.0+1.21.5 [GitHub](https://github.com/CottonMC/LibGui/releases/tag/13.1.0) |
40-
| 1.21.8 | [CurseForge](https://www.curseforge.com/minecraft/mc-mods/fabric-api/files?version=1.21.8) \| [Modrinth](https://modrinth.com/mod/fabric-api/versions?g=1.21.8) | 14.0.0+1.21.6 [GitHub](https://github.com/CottonMC/LibGui/releases/tag/14.0.0) |
30+
| Minecraft Version | Fabric API | LibGui (**Please use the given version**) |
31+
|-------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------|
32+
| 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) |
33+
| 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) |
34+
| 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) |
35+
| 1.19.2 | [CurseForge](https://www.curseforge.com/minecraft/mc-mods/fabric-api/files?version=1.19.2) \| [Modrinth](https://modrinth.com/mod/fabric-api/versions?g=1.19.2) | 6.4.0 [GitHub](https://github.com/CottonMC/LibGui/releases/tag/6.4.0) |
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.1.1 [GitHub](https://github.com/CottonMC/LibGui/releases/tag/7.1.1) |
38+
| 1.20.6 | [CurseForge](https://www.curseforge.com/minecraft/mc-mods/fabric-api/files?version=1.20.6) \| [Modrinth](https://modrinth.com/mod/fabric-api/versions?g=1.20.6) | 10.0.0 [GitHub](https://github.com/CottonMC/LibGui/releases/tag/10.0.0) |
39+
| 1.21.1 | [CurseForge](https://www.curseforge.com/minecraft/mc-mods/fabric-api/files?version=1.21.1) \| [Modrinth](https://modrinth.com/mod/fabric-api/versions?g=1.21.1) | 11.1.0+1.21 [GitHub](https://github.com/CottonMC/LibGui/releases/tag/11.1.0) |
40+
| 1.21.5 | [CurseForge](https://www.curseforge.com/minecraft/mc-mods/fabric-api/files?version=1.21.5) \| [Modrinth](https://modrinth.com/mod/fabric-api/versions?g=1.21.5) | 13.1.0+1.21.5 [GitHub](https://github.com/CottonMC/LibGui/releases/tag/13.1.0) |
41+
| 1.21.8 | [CurseForge](https://www.curseforge.com/minecraft/mc-mods/fabric-api/files?version=1.21.8) \| [Modrinth](https://modrinth.com/mod/fabric-api/versions?g=1.21.8) | 14.0.0+1.21.6 [GitHub](https://github.com/CottonMC/LibGui/releases/tag/14.0.0) |
42+
| 1.21.10 | [CurseForge](https://www.curseforge.com/minecraft/mc-mods/fabric-api/files?version=1.21.10) \| [Modrinth](https://modrinth.com/mod/fabric-api/versions?g=1.21.10) | 15.0.0 [GitHub](https://github.com/CottonMC/LibGui/releases/tag/15.0.0) |
4143

4244
## Features
4345

@@ -65,7 +67,7 @@ commands into the JSON as new buttons are created and loads the JSON at the next
6567

6668
## Support
6769

68-
Current main development for Minecraft version: `1.21.8`
70+
Current main development for Minecraft version: `1.21.10`
6971

7072
And use `preprocess` to be compatible with the following versions.
7173

@@ -80,8 +82,10 @@ And use `preprocess` to be compatible with the following versions.
8082
- Minecraft `1.19.3`
8183
- Minecraft `1.19.4`
8284
- Minecraft `1.20.6`
85+
- Minecraft `1.21.1`
8386
- Minecraft `1.21.5`
8487
- Minecraft `1.21.8`
88+
- Minecraft `1.21.10`
8589

8690
### Mappings
8791

README_ZH_CN.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,19 @@ Command GUI Buttons 是 Minecraft 的 Fabric 模组,允许用户在其客户
2626

2727
为了方便,下方已列出下载链接:
2828

29-
| Minecraft 版本 | Fabric API | LibGui (**请使用给定的版本**) |
30-
|--------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------|
31-
| 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) |
32-
| 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) |
33-
| 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) |
34-
| 1.19.2 | [CurseForge](https://www.curseforge.com/minecraft/mc-mods/fabric-api/files?version=1.19.2) \| [Modrinth](https://modrinth.com/mod/fabric-api/versions?g=1.19.2) | 6.4.0 [GitHub](https://github.com/CottonMC/LibGui/releases/tag/6.4.0) |
35-
| 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) |
36-
| 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.1.1 [GitHub](https://github.com/CottonMC/LibGui/releases/tag/7.1.1) |
37-
| 1.20.6 | [CurseForge](https://www.curseforge.com/minecraft/mc-mods/fabric-api/files?version=1.20.6) \| [Modrinth](https://modrinth.com/mod/fabric-api/versions?g=1.20.6) | 10.0.0 [GitHub](https://github.com/CottonMC/LibGui/releases/tag/10.0.0) |
38-
| 1.21.5 | [CurseForge](https://www.curseforge.com/minecraft/mc-mods/fabric-api/files?version=1.21.5) \| [Modrinth](https://modrinth.com/mod/fabric-api/versions?g=1.21.5) | 13.1.0+1.21.5 [GitHub](https://github.com/CottonMC/LibGui/releases/tag/13.1.0) |
39-
| 1.21.8 | [CurseForge](https://www.curseforge.com/minecraft/mc-mods/fabric-api/files?version=1.21.8) \| [Modrinth](https://modrinth.com/mod/fabric-api/versions?g=1.21.8) | 14.0.0+1.21.6 [GitHub](https://github.com/CottonMC/LibGui/releases/tag/14.0.0) |
29+
| Minecraft 版本 | Fabric API | LibGui (**请使用给定的版本**) |
30+
|--------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------|
31+
| 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) |
32+
| 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) |
33+
| 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) |
34+
| 1.19.2 | [CurseForge](https://www.curseforge.com/minecraft/mc-mods/fabric-api/files?version=1.19.2) \| [Modrinth](https://modrinth.com/mod/fabric-api/versions?g=1.19.2) | 6.4.0 [GitHub](https://github.com/CottonMC/LibGui/releases/tag/6.4.0) |
35+
| 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) |
36+
| 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.1.1 [GitHub](https://github.com/CottonMC/LibGui/releases/tag/7.1.1) |
37+
| 1.20.6 | [CurseForge](https://www.curseforge.com/minecraft/mc-mods/fabric-api/files?version=1.20.6) \| [Modrinth](https://modrinth.com/mod/fabric-api/versions?g=1.20.6) | 10.0.0 [GitHub](https://github.com/CottonMC/LibGui/releases/tag/10.0.0) |
38+
| 1.21.1 | [CurseForge](https://www.curseforge.com/minecraft/mc-mods/fabric-api/files?version=1.21.1) \| [Modrinth](https://modrinth.com/mod/fabric-api/versions?g=1.21.1) | 11.1.0+1.21 [GitHub](https://github.com/CottonMC/LibGui/releases/tag/11.1.0) |
39+
| 1.21.5 | [CurseForge](https://www.curseforge.com/minecraft/mc-mods/fabric-api/files?version=1.21.5) \| [Modrinth](https://modrinth.com/mod/fabric-api/versions?g=1.21.5) | 13.1.0+1.21.5 [GitHub](https://github.com/CottonMC/LibGui/releases/tag/13.1.0) |
40+
| 1.21.8 | [CurseForge](https://www.curseforge.com/minecraft/mc-mods/fabric-api/files?version=1.21.8) \| [Modrinth](https://modrinth.com/mod/fabric-api/versions?g=1.21.8) | 14.0.0+1.21.6 [GitHub](https://github.com/CottonMC/LibGui/releases/tag/14.0.0) |
41+
| 1.21.10 | [CurseForge](https://www.curseforge.com/minecraft/mc-mods/fabric-api/files?version=1.21.10) \| [Modrinth](https://modrinth.com/mod/fabric-api/versions?g=1.21.10) | 15.0.0 [GitHub](https://github.com/CottonMC/LibGui/releases/tag/15.0.0) |
4042

4143
## 功能
4244

@@ -64,7 +66,7 @@ Command GUI Buttons 是 Minecraft 的 Fabric 模组,允许用户在其客户
6466

6567
### 支持
6668

67-
当前主开发版本: `1.21.8`
69+
当前主开发版本: `1.21.10`
6870

6971
并且使用 `预处理` 来兼容下列版本。
7072

@@ -79,8 +81,10 @@ Command GUI Buttons 是 Minecraft 的 Fabric 模组,允许用户在其客户
7981
- Minecraft `1.19.3`
8082
- Minecraft `1.19.4`
8183
- Minecraft `1.20.6`
84+
- Minecraft `1.21.1`
8285
- Minecraft `1.21.5`
8386
- Minecraft `1.21.8`
87+
- Minecraft `1.21.10`
8488

8589
### 混淆映射表
8690

fabricWrapper/src/main/resources/fabric.mod.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"environment": "client",
2121
"entrypoints": {
2222
"modmenu": [
23-
"work.msdnicrosoft.commandbuttons.compat.modmenu.ModMenuImpl"
23+
"work.msdnicrosoft.commandbuttons.compat.ModMenuCompat"
2424
]
2525
},
2626
"depends": {
Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,13 @@
11
package work.msdnicrosoft.commandbuttons;
22

33
import lombok.Getter;
4-
import net.fabricmc.loader.api.FabricLoader;
54
import org.apache.logging.log4j.LogManager;
65
import org.apache.logging.log4j.Logger;
76

87
public class CommandButtonsReference {
9-
private static final String currentModIdentifier = "@MOD_ID@-@MINECRAFT_VERSION_ID@";
108
@Getter
119
private static final String modIdentifier = "@MOD_ID@";
12-
@Getter
13-
private static final String modName = FabricLoader.getInstance().getModContainer(currentModIdentifier)
14-
.orElseThrow(RuntimeException::new).getMetadata().getName();
15-
@Getter
16-
private static final String modVersion = FabricLoader.getInstance().getModContainer(currentModIdentifier)
17-
.orElseThrow(RuntimeException::new).getMetadata().getVersion().getFriendlyString();
10+
1811
@Getter
1912
private static final Logger logger = LogManager.getLogger(modIdentifier);
2013
}

src/main/java/work/msdnicrosoft/commandbuttons/compat/modmenu/ModMenuImpl.java renamed to src/main/java/work/msdnicrosoft/commandbuttons/compat/ModMenuCompat.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
package work.msdnicrosoft.commandbuttons.compat.modmenu;
1+
package work.msdnicrosoft.commandbuttons.compat;
22

33
import com.terraformersmc.modmenu.api.ConfigScreenFactory;
44
import com.terraformersmc.modmenu.api.ModMenuApi;
55
import work.msdnicrosoft.commandbuttons.gui.CommandGUI;
66
import work.msdnicrosoft.commandbuttons.gui.WrapperCommandGUIScreen;
77

8-
public class ModMenuImpl implements ModMenuApi {
8+
public class ModMenuCompat implements ModMenuApi {
99
@Override
1010
public ConfigScreenFactory<?> getModConfigScreenFactory() {
1111
return screen -> {

src/main/java/work/msdnicrosoft/commandbuttons/data/CommandItemDestination.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
import io.github.cottonmc.cotton.gui.widget.WButton;
44
import io.github.cottonmc.cotton.gui.widget.WPlainPanel;
55
import lombok.Getter;
6-
import work.msdnicrosoft.commandbuttons.compat.minecraft.ComponentCompatApi;
76
import work.msdnicrosoft.commandbuttons.gui.WTextFieldExtra;
7+
import work.msdnicrosoft.commandbuttons.util.ComponentUtil;
88

99
@Getter
1010
public class CommandItemDestination extends WPlainPanel {
1111
private final WTextFieldExtra command = new WTextFieldExtra();
12-
private final WButton up = new WButton().setLabel(ComponentCompatApi.literal("↑"));
13-
private final WButton down = new WButton().setLabel(ComponentCompatApi.literal("↓"));
14-
private final WButton delete = new WButton().setLabel(ComponentCompatApi.literal("×"));
12+
private final WButton up = new WButton().setLabel(ComponentUtil.literal("↑"));
13+
private final WButton down = new WButton().setLabel(ComponentUtil.literal("↓"));
14+
private final WButton delete = new WButton().setLabel(ComponentUtil.literal("×"));
1515

1616
public CommandItemDestination() {
1717
//#if MC > 11605

0 commit comments

Comments
 (0)