Skip to content

Commit aa700db

Browse files
authored
Merge pull request #51 from Hendrix-Shen/feature-1.20.2
2 parents 9b47033 + c94269c commit aa700db

10 files changed

Lines changed: 84 additions & 39 deletions

File tree

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ For your convenience, download links are listed below:
3636
| 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) |
3737
| 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) |
3838
| 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) |
39-
| 1.20.1 | [CurseForge](https://www.curseforge.com/minecraft/mc-mods/fabric-api/files?version=1.20.1) \| [Modrinth](https://modrinth.com/mod/fabric-api/versions?g=1.20.1) | 8.0.1 [GitHub](https://github.com/CottonMC/LibGui/releases/tag/8.0.1) |
39+
| 1.20.1 | [CurseForge](https://www.curseforge.com/minecraft/mc-mods/fabric-api/files?version=1.20.1) \| [Modrinth](https://modrinth.com/mod/fabric-api/versions?g=1.20.1) | 8.1.0 [GitHub](https://github.com/CottonMC/LibGui/releases/tag/8.1.0) |
40+
| 1.20.2 | [CurseForge](https://www.curseforge.com/minecraft/mc-mods/fabric-api/files?version=1.20.2) \| [Modrinth](https://modrinth.com/mod/fabric-api/versions?g=1.20.2) | 9.0.0 [GitHub](https://github.com/CottonMC/LibGui/releases/tag/9.0.0) |
4041

4142
## Features
4243

@@ -64,7 +65,7 @@ commands into the JSON as new buttons are created, and loads the JSON at the nex
6465

6566
## Support
6667

67-
Current main development for Minecraft version: `1.20.1`
68+
Current main development for Minecraft version: `1.20.2`
6869

6970
And use `preprocess` to be compatible with the following versions.
7071

@@ -79,6 +80,7 @@ And use `preprocess` to be compatible with the following versions.
7980
- Minecraft `1.19.3`
8081
- Minecraft `1.19.4`
8182
- Minecraft `1.20.1`
83+
- Minecraft `1.20.2`
8284

8385
### Mappings
8486

README_ZH_CN.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ Command GUI Buttons 是 Minecraft 的 Fabric 模组,允许用户在其客户
3434
| 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) |
3535
| 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) |
3636
| 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.1 | [CurseForge](https://www.curseforge.com/minecraft/mc-mods/fabric-api/files?version=1.20.1) \| [Modrinth](https://modrinth.com/mod/fabric-api/versions?g=1.20.1) | 8.0.1 [GitHub](https://github.com/CottonMC/LibGui/releases/tag/8.0.1) |
37+
| 1.20.1 | [CurseForge](https://www.curseforge.com/minecraft/mc-mods/fabric-api/files?version=1.20.1) \| [Modrinth](https://modrinth.com/mod/fabric-api/versions?g=1.20.1) | 8.1.0 [GitHub](https://github.com/CottonMC/LibGui/releases/tag/8.1.0) |
38+
| 1.20.2 | [CurseForge](https://www.curseforge.com/minecraft/mc-mods/fabric-api/files?version=1.20.2) \| [Modrinth](https://modrinth.com/mod/fabric-api/versions?g=1.20.2) | 9.0.0 [GitHub](https://github.com/CottonMC/LibGui/releases/tag/9.0.0) |
3839

3940
## 功能
4041

@@ -62,7 +63,7 @@ Command GUI Buttons 是 Minecraft 的 Fabric 模组,允许用户在其客户
6263

6364
### 支持
6465

65-
当前主开发版本: `1.20.1`
66+
当前主开发版本: `1.20.2`
6667

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

@@ -77,6 +78,7 @@ Command GUI Buttons 是 Minecraft 的 Fabric 模组,允许用户在其客户
7778
- Minecraft `1.19.3`
7879
- Minecraft `1.19.4`
7980
- Minecraft `1.20.1`
81+
- Minecraft `1.20.2`
8082

8183
### 混淆映射表
8284

build.gradle

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
id("fabric-loom").version("1.3-SNAPSHOT").apply(false)
2+
id("fabric-loom").version("1.4-SNAPSHOT").apply(false)
33
id("com.replaymod.preprocess").version("SNAPSHOT")
44
id("org.ajoberstar.grgit").version("5.2.1")
55
id("net.kyori.blossom").version("1.3.1").apply(false)
@@ -13,13 +13,15 @@ preprocess {
1313
def mc1193 = createNode("1.19.3", 1_19_03, "mojang")
1414
def mc1194 = createNode("1.19.4", 1_19_04, "mojang")
1515
def mc1201 = createNode("1.20.1", 1_20_01, "mojang")
16+
def mc1202 = createNode("1.20.2", 1_20_02, "mojang")
1617

1718
mc1165.link(mc1171, null)
1819
mc1171.link(mc1182, null)
1920
mc1182.link(mc1192, null)
2021
mc1192.link(mc1193, null)
2122
mc1193.link(mc1194, null)
22-
mc1201.link(mc1194, null)
23+
mc1194.link(mc1201, null)
24+
mc1201.link(mc1202, null)
2325
}
2426

2527
def ENV = System.getenv()

settings.gradle

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
pluginManagement {
22
repositories {
3+
mavenLocal()
4+
mavenCentral()
5+
gradlePluginPortal()
36
maven {
47
name("Fabric")
58
url("https://maven.fabricmc.net/")
@@ -12,8 +15,6 @@ pluginManagement {
1215
name("Nyan Maven")
1316
url("https://maven.hendrixshen.top")
1417
}
15-
mavenCentral()
16-
gradlePluginPortal()
1718
}
1819
}
1920

@@ -25,6 +26,7 @@ def versions = Arrays.asList(
2526
"1.19.3",
2627
"1.19.4",
2728
"1.20.1",
29+
"1.20.2",
2830
)
2931

3032
for (String version : versions) {

src/main/java/work/msdnicrosoft/commandbuttons/gui/WrapperCommandGUIScreen.java

Lines changed: 34 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,62 @@
11
package work.msdnicrosoft.commandbuttons.gui;
22

3-
//#if MC < 1194
3+
//#if MC < 12000
44
//$$ import com.mojang.blaze3d.vertex.PoseStack;
55
//#endif
66
import io.github.cottonmc.cotton.gui.GuiDescription;
77
import io.github.cottonmc.cotton.gui.client.CottonClientScreen;
88
import lombok.Getter;
99
import lombok.Setter;
1010
import net.minecraft.client.Minecraft;
11+
import net.minecraft.client.gui.GuiGraphics;
1112
import net.minecraft.client.gui.screens.Screen;
1213
import org.jetbrains.annotations.Nullable;
1314
import org.lwjgl.glfw.GLFW;
1415

16+
@Getter
17+
@Setter
1518
public class WrapperCommandGUIScreen extends CottonClientScreen {
1619
@Nullable
17-
@Getter
18-
@Setter
1920
private Runnable closeCallback;
20-
@Getter
21-
@Setter
2221
@Nullable
2322
private Screen parent;
24-
@Getter
25-
@Setter
2623
@Nullable
2724
private Runnable returnAction;
2825

2926
public WrapperCommandGUIScreen(GuiDescription description) {
3027
super(description);
3128
}
3229

33-
//#if MC <= 1193
34-
//$$ @Override
35-
//$$ protected void fillGradient(PoseStack poseStack, int i, int j, int k, int l, int m, int n) {
36-
//$$ // Do not use background color.
37-
//$$ }
38-
//#endif
30+
31+
// Do not render background color in-game
32+
@Override
33+
public void renderBackground(
34+
//#if MC > 11904
35+
GuiGraphics guiGraphics
36+
//#if MC > 12001
37+
,int mouseX,
38+
int mouseY,
39+
float partialTick
40+
//#endif
41+
//#else
42+
//$$ PoseStack poseStack
43+
//#if MC < 11904
44+
//$$ ,int vOffset
45+
//#endif
46+
//#endif
47+
) {
48+
if (this.minecraft != null && this.minecraft.level == null) {
49+
this.renderDirtBackground(
50+
//#if MC > 11904
51+
guiGraphics
52+
//#elseif MC > 11903
53+
//$$ poseStack
54+
//#else
55+
//$$ vOffset
56+
//#endif
57+
);
58+
}
59+
}
3960

4061
@Override
4162
public void removed() {

versions/1.19.3/gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ libgui_version=6.5.3+1.19.3
1515
# LazyDFU 0.1.3
1616
lazydfu_version=0.1.3
1717

18-
# Mod Menu - 5.0.2
19-
modmenu_version=5.0.2
18+
# Mod Menu - 5.1.0
19+
modmenu_version=5.1.0
2020

2121
# Smooth Boot - 1.7.1
2222
smoothboot_version=1.19-1.7.1

versions/1.19.4/gradle.properties

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@ minecraft_version=1.19.4
55
minecraft_out=1.19.4
66

77
# Required Libraries
8-
# FabricAPI 0.85.0+1.19.4
9-
fabric_version=0.85.0+1.19.4
8+
# FabricAPI 0.87.0+1.19.4
9+
fabric_version=0.87.0+1.19.4
1010

11-
# LibGui 7.1.0+1.19.4
12-
libgui_version=7.1.0+1.19.4
11+
# LibGui 7.1.1+1.19.4
12+
libgui_version=7.1.1+1.19.4
1313

1414
# Runtime Libraries - Only for development environment
1515
# LazyDFU 0.1.3
1616
lazydfu_version=0.1.3
1717

18-
# Mod Menu - 6.2.3
19-
modmenu_version=6.2.3
18+
# Mod Menu - 6.3.1
19+
modmenu_version=6.3.1
2020

2121
# Smooth Boot - 1.7.0
2222
smoothboot_version=1.19.4-1.7.0

versions/1.20.1/gradle.properties

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,15 @@ minecraft_version=1.20.1
55
minecraft_out=1.20.1
66

77
# Required Libraries
8-
# FabricAPI 0.85.0+1.20.1
9-
fabric_version=0.85.0+1.20.1
8+
# FabricAPI 0.89.0+1.20.1
9+
fabric_version=0.89.0+1.20.1
1010

11-
# LibGui 8.0.1+1.20
12-
libgui_version=8.0.1+1.20
11+
# LibGui 8.1.0+1.20.1
12+
libgui_version=8.1.0+1.20.1
1313

1414
# Runtime Libraries - Only for development environment
15-
# LazyDFU - No longer needed since MC 1.19.4
16-
lazydfu_version=0
17-
18-
# Mod Menu - 7.1.0
19-
modmenu_version=7.1.0
15+
# Mod Menu - 7.2.2
16+
modmenu_version=7.2.2
2017

2118
# Smooth Boot - No longer needed since MC 1.20
2219
smoothboot_version=0

versions/1.20.2/gradle.properties

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Independent branch configuration for MC 1.20.2
2+
# Development Environment
3+
minecraft_dependency=1.20.2
4+
minecraft_version=1.20.2
5+
minecraft_out=1.20.2
6+
7+
# Required Libraries
8+
# FabricAPI 0.90.0+1.20.2
9+
fabric_version=0.90.0+1.20.2
10+
11+
# LibGui 9.0.0+1.20.2
12+
libgui_version=9.0.0+1.20.2
13+
14+
# Runtime Libraries - Only for development environment
15+
# Mod Menu - 8.0.0
16+
modmenu_version=8.0.0
17+
18+
# Smooth Boot - No longer needed since MC 1.20
19+
smoothboot_version=0

versions/mainProject

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.20.1
1+
1.20.2

0 commit comments

Comments
 (0)