Skip to content

Commit 80d77d0

Browse files
committed
Update to mc1.21.4
1 parent ca3afe6 commit 80d77d0

File tree

10 files changed

+45
-31
lines changed

10 files changed

+45
-31
lines changed

common/src/main/java/dev/terminalmc/chatnotify/config/TextStyle.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ public boolean isEnabled() {
112112
public Style getStyle() {
113113
return new Style(
114114
doColor ? TextColor.fromRgb(color) : null,
115+
null,
115116
bold != FormatMode.DISABLED ? bold == FormatMode.ON : null,
116117
italic != FormatMode.DISABLED ? italic == FormatMode.ON : null,
117118
underlined != FormatMode.DISABLED ? underlined == FormatMode.ON : null,

common/src/main/java/dev/terminalmc/chatnotify/gui/widget/ExpandingList.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public int getRowWidth() {
136136
}
137137

138138
@Override
139-
protected int getScrollbarPosition() {
139+
protected int scrollBarX() {
140140
return getX() + width - SCROLLBAR_WIDTH;
141141
}
142142

common/src/main/java/dev/terminalmc/chatnotify/gui/widget/HorizontalList.java

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -261,9 +261,9 @@ protected void renderChildren(GuiGraphics graphics, int mouseX, int mouseY, floa
261261
/**
262262
* Renders the scrollbar, if required.
263263
*/
264-
protected void renderScrollbar(GuiGraphics graphics) {
264+
protected void renderScrollbar(@NotNull GuiGraphics graphics) {
265265
if (scrollbarVisible()) {
266-
int y = getScrollbarPosition();
266+
int y = scrollBarX();
267267

268268
int scrollerWidth = (int)((float)(getWidth() * getWidth()) / (float)getMaxPosition());
269269
scrollerWidth = Mth.clamp(scrollerWidth, SCROLLBAR_WIDTH, getWidth());
@@ -384,13 +384,13 @@ public boolean mouseScrolled(double mouseX, double mouseY, double scrollX, doubl
384384

385385
protected void updateScrollingState(double mouseX, double mouseY, int button) {
386386
scrolling = button == 0
387-
&& mouseY >= getScrollbarPosition()
388-
&& mouseY < (getScrollbarPosition() + SCROLLBAR_HEIGHT)
387+
&& mouseY >= scrollBarX()
388+
&& mouseY < (scrollBarX() + SCROLLBAR_HEIGHT)
389389
&& mouseX >= getX()
390390
&& mouseX < getRight();
391391
}
392392

393-
protected int getScrollbarPosition() {
393+
protected int scrollBarX() {
394394
return topScrollbar ? getY() : getY() + getHeight() - SCROLLBAR_HEIGHT;
395395
}
396396

@@ -423,6 +423,18 @@ public int getMaxScroll() {
423423
return Math.max(0, getMaxPosition() - getWidth());
424424
}
425425

426+
@Override
427+
protected int contentHeight() {
428+
// Not currently used
429+
return 0;
430+
}
431+
432+
@Override
433+
protected double scrollRate() {
434+
// Not currently used
435+
return 0;
436+
}
437+
426438
// Narration
427439

428440
public NarratableEntry.@NotNull NarrationPriority narrationPriority() {

common/src/main/java/dev/terminalmc/chatnotify/gui/widget/field/FakeTextField.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,18 @@ public FakeTextField(int x, int y, int width, int height, Runnable onClick) {
3232
}
3333

3434
@Override
35-
public boolean clicked(double mouseX, double mouseY) {
35+
public boolean isMouseOver(double mouseX, double mouseY) {
3636
// Skip the 'active' requirement
3737
return (visible
3838
&& mouseX >= (double)getX()
3939
&& mouseY >= (double)getY()
40-
&& mouseX < (double)(getX() + getWidth())
41-
&& mouseY < (double)(getY() + getHeight()));
40+
&& mouseX < (double)getRight()
41+
&& mouseY < (double)getBottom());
4242
}
4343

4444
@Override
4545
public boolean mouseClicked(double mouseX, double mouseY, int button) {
46-
if (clicked(mouseX, mouseY)) {
46+
if (isMouseOver(mouseX, mouseY)) {
4747
onClick(mouseX, mouseY);
4848
return true;
4949
}

common/src/main/java/dev/terminalmc/chatnotify/gui/widget/list/FilterList.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ protected void refreshSubList() {
142142
addEntry(start, entry);
143143
}
144144
}
145-
clampScrollAmount();
145+
refreshScrollAmount();
146146
}
147147

148148
@FunctionalInterface

common/src/main/java/dev/terminalmc/chatnotify/gui/widget/list/OptionList.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ protected void updateElementBounds() {
106106
* Initializes the {@link OptionList}.
107107
*/
108108
protected void init() {
109-
double scrollAmount = getScrollAmount();
109+
double scrollAmount = scrollAmount();
110110

111111
clearEntries();
112112
setFocused(null);
@@ -167,12 +167,12 @@ public int getRowWidth() {
167167
}
168168

169169
@Override
170-
protected int getScrollbarPosition() {
170+
protected int scrollBarX() {
171171
return width / 2 + rowWidth / 2;
172172
}
173173

174174
@Override
175-
protected boolean isValidMouseClick(int button) {
175+
protected boolean isValidClickButton(int button) {
176176
return button == 0 || button == 1;
177177
}
178178

common/src/main/java/dev/terminalmc/chatnotify/util/FormatUtil.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ private static class FormatCodes {
266266
Style createStyle() {
267267
return new Style(
268268
color == null ? null : TextColor.fromLegacyFormat(color),
269+
null,
269270
bold ? true : null,
270271
italic ? true : null,
271272
underline ? true : null,

common/src/main/resources/META-INF/accesstransformer.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
public net.minecraft.client.OptionInstance$SliderableValueSet
33
public net.minecraft.client.OptionInstance$ValueSet
44
public net.minecraft.network.chat.TextColor formatValue()Ljava/lang/String;
5-
public net.minecraft.network.chat.Style <init>(Lnet/minecraft/network/chat/TextColor;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Lnet/minecraft/network/chat/ClickEvent;Lnet/minecraft/network/chat/HoverEvent;Ljava/lang/String;Lnet/minecraft/resources/ResourceLocation;)V
5+
public net.minecraft.network.chat.Style <init>(Lnet/minecraft/network/chat/TextColor;Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Lnet/minecraft/network/chat/ClickEvent;Lnet/minecraft/network/chat/HoverEvent;Ljava/lang/String;Lnet/minecraft/resources/ResourceLocation;)V

common/src/main/resources/chatnotify.accesswidener

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ accessWidener v2 named
33
accessible class net/minecraft/client/OptionInstance$SliderableValueSet
44
accessible class net/minecraft/client/OptionInstance$ValueSet
55
accessible method net/minecraft/network/chat/TextColor formatValue ()Ljava/lang/String;
6-
accessible method net/minecraft/network/chat/Style <init> (Lnet/minecraft/network/chat/TextColor;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Lnet/minecraft/network/chat/ClickEvent;Lnet/minecraft/network/chat/HoverEvent;Ljava/lang/String;Lnet/minecraft/resources/ResourceLocation;)V
6+
accessible method net/minecraft/network/chat/Style <init> (Lnet/minecraft/network/chat/TextColor;Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Lnet/minecraft/network/chat/ClickEvent;Lnet/minecraft/network/chat/HoverEvent;Ljava/lang/String;Lnet/minecraft/resources/ResourceLocation;)V

gradle.properties

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,36 +27,36 @@ java_versions_fabric=>=21
2727
java_versions_neoforge=[21,)
2828

2929
# Minecraft
30-
minecraft_version=1.21.3
31-
minecraft_versions_fabric=>1.21.1 <1.22
32-
minecraft_versions_neoforge=(1.21.1, 1.22)
30+
minecraft_version=1.21.4
31+
minecraft_versions_fabric=>1.21.3 <1.22
32+
minecraft_versions_neoforge=(1.21.3, 1.22)
3333

3434
# Parchment https://parchmentmc.org/docs/getting-started#choose-a-version
35-
parchment_minecraft_version=1.21.3
36-
parchment_version=2024.12.07
35+
parchment_minecraft_version=1.21.4
36+
parchment_version=2025.01.05
3737

3838
# Fabric https://fabricmc.net/develop
3939
fabric_loader_version=0.16.9
4040
fabric_loader_versions=>=0.15.0
41-
fabric_api_version=0.114.0+1.21.3
41+
fabric_api_version=0.114.3+1.21.4
4242
fabric_api_versions=*
4343

4444
# NeoForge https://projects.neoforged.net/neoforged/neoforge
4545
neoforge_loader_versions=[1,)
46-
neoforge_version=21.3.58
47-
neoforge_versions=[21.2.0-beta, 22)
46+
neoforge_version=21.4.58-beta
47+
neoforge_versions=[21.4.0-beta, 22)
4848
# NeoForm https://projects.neoforged.net/neoforged/neoform
49-
neoform_version=1.21.3-20241023.131943
49+
neoform_version=1.21.4-20241203.161809
5050

5151
# CommandKeys https://modrinth.com/mod/65UyswbY/versions
52-
commandkeys_version=2.3.4+1.21
52+
commandkeys_version=2.3.4+1.21.4
5353

5454
# ChatHeads https://modrinth.com/mod/Wb5oqrBJ/versions
55-
chatheads_version=0.13.7
55+
chatheads_version=0.13.8
5656

5757
# ModMenu https://modrinth.com/mod/mOgUt4GM/versions
58-
modmenu_version=12.0.0
59-
modmenu_versions_fabric=>=12.0.0-beta.1
58+
modmenu_version=13.0.0
59+
modmenu_versions_fabric=>=13.0.0-beta.1
6060

6161
# GitHub, Modrinth, CurseForge releases
6262
# Plural properties expect CSV lists
@@ -68,12 +68,12 @@ curseforge_slug=chatnotify
6868
release_type=STABLE
6969
# Fabric
7070
release_mod_loaders_fabric=fabric
71-
release_game_versions_fabric=1.21.2,1.21.3
71+
release_game_versions_fabric=1.21.4
7272
release_required_dep_ids_fabric_mr=P7dR8mSH,mOgUt4GM
7373
release_required_dep_ids_fabric_cf=fabric-api,modmenu
7474
# NeoForge
7575
release_mod_loaders_neoforge=neoforge
76-
release_game_versions_neoforge=1.21.2,1.21.3
76+
release_game_versions_neoforge=1.21.4
7777

7878
# Mixin https://mvnrepository.com/artifact/org.spongepowered/mixin
7979
mixin_version=0.8.7

0 commit comments

Comments
 (0)