Skip to content

Commit 1e43f66

Browse files
committed
Update to mc1.21.3
1 parent 1d84586 commit 1e43f66

File tree

7 files changed

+50
-36
lines changed

7 files changed

+50
-36
lines changed

common/build.gradle

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,24 @@ plugins {
33
id("net.neoforged.moddev")
44
}
55

6+
// Vanilla depends on ASM 9.3, MDG makes that a 'strict' version constraint,
7+
// but Mixin and MixinExtras needs newer ASM so we override that here.
8+
configurations.configureEach {
9+
resolutionStrategy.eachDependency { details ->
10+
if (details.requested.group == "org.ow2.asm") {
11+
details.useVersion(asm_version)
12+
details.because("Mixin requires new ASM")
13+
}
14+
}
15+
}
16+
617
dependencies {
18+
compileOnly "org.ow2.asm:asm:${asm_version}"
19+
compileOnly "org.ow2.asm:asm-analysis:${asm_version}"
20+
compileOnly "org.ow2.asm:asm-commons:${asm_version}"
21+
compileOnly "org.ow2.asm:asm-tree:${asm_version}"
22+
compileOnly "org.ow2.asm:asm-util:${asm_version}"
23+
724
compileOnly("org.spongepowered:mixin:${mixin_version}")
825
compileOnly(annotationProcessor("io.github.llamalad7:mixinextras-common:${mixinextras_version}"))
926

common/src/main/java/dev/terminalmc/chatnotify/ChatNotify.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public static void onEndTick(Minecraft mc) {
8686
// Config reset warning toast
8787
if (hasResetConfig && mc.screen instanceof TitleScreen) {
8888
hasResetConfig = false;
89-
mc.getToasts().addToast(new SystemToast(new SystemToast.SystemToastId(15000L),
89+
mc.getToastManager().addToast(new SystemToast(new SystemToast.SystemToastId(15000L),
9090
localized("toast", "reset.title"), localized("toast", "reset.message",
9191
Component.literal(Config.UNREADABLE_FILE_NAME).withStyle(ChatFormatting.GOLD))));
9292
}

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

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@
2727
import net.minecraft.client.gui.GuiGraphics;
2828
import net.minecraft.client.gui.components.AbstractWidget;
2929
import net.minecraft.client.gui.components.Button;
30-
import net.minecraft.client.renderer.GameRenderer;
30+
import net.minecraft.client.renderer.CoreShaders;
3131
import net.minecraft.network.chat.CommonComponents;
3232
import net.minecraft.network.chat.Component;
3333
import net.minecraft.network.chat.TextColor;
34-
import net.minecraft.util.FastColor;
34+
import net.minecraft.util.ARGB;
3535
import net.minecraft.util.Mth;
3636
import org.jetbrains.annotations.NotNull;
3737

@@ -229,8 +229,7 @@ public int getMaxHeight() {
229229

230230
public void updateColorFromSource() {
231231
int color = source.get();
232-
Color.RGBtoHSB(FastColor.ARGB32.red(color), FastColor.ARGB32.green(color),
233-
FastColor.ARGB32.blue(color), hsv);
232+
Color.RGBtoHSB(ARGB.red(color), ARGB.green(color), ARGB.blue(color), hsv);
234233
oldColor = color;
235234
if (hexField != null) {
236235
hexField.setValue(TextColor.fromRgb(color).formatValue());
@@ -249,8 +248,7 @@ private void updateColorFromHexField(String s) {
249248
if (textColor != null) {
250249
int color = textColor.getValue();
251250
if (!updateFromCursor) {
252-
Color.RGBtoHSB(FastColor.ARGB32.red(color), FastColor.ARGB32.green(color),
253-
FastColor.ARGB32.blue(color), hsv);
251+
Color.RGBtoHSB(ARGB.red(color), ARGB.green(color), ARGB.blue(color), hsv);
254252
updateHCursor();
255253
updateSvCursor();
256254
}
@@ -407,7 +405,7 @@ protected void renderWidget(@NotNull GuiGraphics graphics, int mouseX, int mouse
407405

408406
private void drawQuads(GuiGraphics graphics) {
409407
// Setup
410-
RenderSystem.setShader(GameRenderer::getPositionColorShader);
408+
RenderSystem.setShader(CoreShaders.POSITION_COLOR);
411409
RenderSystem.depthFunc(GlConst.GL_ALWAYS);
412410
RenderSystem.depthMask(false);
413411
RenderSystem.enableBlend();
@@ -552,9 +550,9 @@ private void drawQuads(GuiGraphics graphics) {
552550

553551
// New color
554552
int color = Mth.hsvToRgb(hsv[0], hsv[1], hsv[2]);
555-
int colorR = FastColor.ARGB32.red(color);
556-
int colorG = FastColor.ARGB32.green(color);
557-
int colorB = FastColor.ARGB32.blue(color);
553+
int colorR = ARGB.red(color);
554+
int colorG = ARGB.green(color);
555+
int colorB = ARGB.blue(color);
558556
builder.addVertex(x+newCFieldX, y+newCFieldY, 0F).setColor(colorR, colorG, colorB, 255);
559557
builder.addVertex(x+newCFieldX, y+newCFieldY+newCFieldHeight, 0F).setColor(colorR, colorG, colorB, 255);
560558
builder.addVertex(x+newCFieldX+newCFieldWidth, y+newCFieldY+newCFieldHeight, 0F).setColor(colorR, colorG, colorB, 255);
@@ -567,9 +565,9 @@ private void drawQuads(GuiGraphics graphics) {
567565
builder.addVertex(x+oldCFieldX+oldCFieldWidth+OUTLINE, y+oldCFieldY-OUTLINE, 0F).setColor(GUI_LIGHT, GUI_LIGHT, GUI_LIGHT, 255);
568566

569567
// Old color
570-
colorR = FastColor.ARGB32.red(oldColor);
571-
colorG = FastColor.ARGB32.green(oldColor);
572-
colorB = FastColor.ARGB32.blue(oldColor);
568+
colorR = ARGB.red(oldColor);
569+
colorG = ARGB.green(oldColor);
570+
colorB = ARGB.blue(oldColor);
573571
builder.addVertex(x+oldCFieldX, y+oldCFieldY, 0F).setColor(colorR, colorG, colorB, 255);
574572
builder.addVertex(x+oldCFieldX, y+oldCFieldY+oldCFieldHeight, 0F).setColor(colorR, colorG, colorB, 255);
575573
builder.addVertex(x+oldCFieldX+oldCFieldWidth, y+oldCFieldY+oldCFieldHeight, 0F).setColor(colorR, colorG, colorB, 255);

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
import net.minecraft.network.chat.Style;
3232
import net.minecraft.network.chat.TextColor;
3333
import net.minecraft.sounds.SoundSource;
34-
import net.minecraft.util.FastColor;
34+
import net.minecraft.util.ARGB;
3535

3636
import java.awt.*;
3737

@@ -226,8 +226,7 @@ private static class DefaultColorEntry extends MainOptionList.Entry {
226226
mainButton.setMessage(localized("option", "global.default_color")
227227
.setStyle(Style.EMPTY.withColor(textColor)));
228228
float[] hsv = new float[3];
229-
Color.RGBtoHSB(FastColor.ARGB32.red(color), FastColor.ARGB32.green(color),
230-
FastColor.ARGB32.blue(color), hsv);
229+
Color.RGBtoHSB(ARGB.red(color), ARGB.green(color), ARGB.blue(color), hsv);
231230
if (hsv[2] < 0.1) colorField.setTextColor(16777215);
232231
else colorField.setTextColor(color);
233232
}

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
import net.minecraft.client.resources.language.I18n;
3535
import net.minecraft.network.chat.*;
3636
import net.minecraft.network.chat.Component;
37-
import net.minecraft.util.FastColor;
37+
import net.minecraft.util.ARGB;
3838
import net.minecraft.util.StringUtil;
3939
import org.jetbrains.annotations.Nullable;
4040

@@ -406,8 +406,7 @@ private static class NotifConfigEntry extends Entry {
406406
int color = textColor.getValue();
407407
notif.textStyle.color = color;
408408
float[] hsv = new float[3];
409-
Color.RGBtoHSB(FastColor.ARGB32.red(color), FastColor.ARGB32.green(color),
410-
FastColor.ARGB32.blue(color), hsv);
409+
Color.RGBtoHSB(ARGB.red(color), ARGB.green(color), ARGB.blue(color), hsv);
411410
if (hsv[2] < 0.1) colorField.setTextColor(16777215);
412411
else colorField.setTextColor(color);
413412
// Update status button color

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
import net.minecraft.client.gui.components.Button;
2828
import net.minecraft.network.chat.*;
2929
import net.minecraft.network.chat.Component;
30-
import net.minecraft.util.FastColor;
30+
import net.minecraft.util.ARGB;
3131
import org.jetbrains.annotations.Nullable;
3232

3333
import java.awt.*;
@@ -550,8 +550,7 @@ static class ColorConfigEntry extends Entry {
550550
// Update color of main button and field
551551
mainButton.setMessage(mainButton.getMessage().copy().withColor(color));
552552
float[] hsv = new float[3];
553-
Color.RGBtoHSB(FastColor.ARGB32.red(color), FastColor.ARGB32.green(color),
554-
FastColor.ARGB32.blue(color), hsv);
553+
Color.RGBtoHSB(ARGB.red(color), ARGB.green(color), ARGB.blue(color), hsv);
555554
if (hsv[2] < 0.1) colorField.setTextColor(16777215);
556555
else colorField.setTextColor(color);
557556
}

gradle.properties

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

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

3434
# Parchment https://parchmentmc.org/docs/getting-started#choose-a-version
35-
parchment_minecraft_version=1.21
36-
parchment_version=2024.11.10
35+
parchment_minecraft_version=1.21.3
36+
parchment_version=2024.12.07
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.102.0+1.21
41+
fabric_api_version=0.114.0+1.21.3
4242
fabric_api_versions=*
4343

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

5151
# CommandKeys https://modrinth.com/mod/65UyswbY/versions
5252
commandkeys_version=2.3.4+1.21
@@ -55,8 +55,8 @@ commandkeys_version=2.3.4+1.21
5555
chatheads_version=0.13.7
5656

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

6161
# GitHub, Modrinth, CurseForge releases
6262
# Plural properties expect CSV lists
@@ -68,17 +68,19 @@ curseforge_slug=chatnotify
6868
release_type=STABLE
6969
# Fabric
7070
release_mod_loaders_fabric=fabric
71-
release_game_versions_fabric=1.21,1.21.1
71+
release_game_versions_fabric=1.21.2,1.21.3
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,1.21.1
76+
release_game_versions_neoforge=1.21.2,1.21.3
7777

7878
# Mixin https://mvnrepository.com/artifact/org.spongepowered/mixin
7979
mixin_version=0.8.7
8080
# MixinExtras https://github.com/LlamaLad7/MixinExtras/releases
8181
mixinextras_version=0.4.1
82+
# ASM https://mvnrepository.com/artifact/org.ow2.asm/asm
83+
asm_version=9.7
8284

8385
# Plugins
8486
# Fabric Loom https://mvnrepository.com/artifact/net.fabricmc/fabric-loom

0 commit comments

Comments
 (0)