Skip to content

Commit 7ee2a7d

Browse files
committed
Update to Minecraft 1.20.2
1 parent a27c380 commit 7ee2a7d

File tree

8 files changed

+20
-12
lines changed

8 files changed

+20
-12
lines changed

build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ java {
4242
}
4343

4444
repositories {
45+
mavenLocal()
4546
mavenCentral()
4647
maven("https://oss.sonatype.org/content/repositories/snapshots") {
4748
name = "Nexus Repository OSS"

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ org.gradle.jvmargs=-Xmx1G
33

44
# Your project's version
55
group=gay.ampflower
6-
projectVersion=0.4.2
6+
projectVersion=0.4.3
77
modrinthId=z23qey0b
8-
minecraftCompatible=1.20,1.20.1
8+
minecraftCompatible=1.20.2

gradle/libs.versions.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
annotations = "23.0.0"
33

44
# https://github.com/LambdAurora/SpruceUI
5-
spruceui = "5.0.0+1.20"
6-
modmenu = "7.0.1"
5+
spruceui = "5.0.3+1.20.2"
6+
modmenu = "8.0.+"
77

88
# Minecraft
9-
minecraft_version = "1.20"
10-
minecraft_required = ">=1.20 <=1.20.1"
9+
minecraft_version = "1.20.2"
10+
minecraft_required = "1.20.2"
1111
fabric_loader = "0.15.+"
12-
fabric_api = "0.83.0+1.20"
12+
fabric_api = "0.89.1+1.20.2"
1313

1414
# Plugins
1515
loom = "1.+"

src/main/java/gay/ampflower/musicmoods/Constants.java

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@
77
package gay.ampflower.musicmoods;// Created 2023-16-01T21:35:22
88

99
import net.minecraft.client.gui.components.Button;
10+
import net.minecraft.client.gui.components.WidgetSprites;
1011
import net.minecraft.resources.ResourceLocation;
1112

1213
/**
1314
* @author Ampflower
1415
* @since 0.0.0
1516
**/
1617
public final class Constants {
17-
public static final ResourceLocation moodsResource = new ResourceLocation("music-moods",
18-
"textures/gui/widgets.png");
18+
public static final String modId = "music-moods";
1919

20-
public static final int atlasSize = 256;
20+
public static final WidgetSprites musicSprites = widgetHoverable("music");
2121

2222
public static final int buttonHeight = Button.DEFAULT_HEIGHT;
2323
public static final int buttonWidth = Button.DEFAULT_WIDTH;
@@ -29,4 +29,12 @@ public final class Constants {
2929

3030
public static final int primaryButtonLeftOffset = buttonWidth + twoColumnButtonOffset;
3131
public static final int primaryButtonRightOffset = primaryButtonLeftOffset + twoColumnButtonOffset;
32+
33+
public static WidgetSprites widgetHoverable(String widget) {
34+
return new WidgetSprites(widget(widget), widget(widget + "_hover"));
35+
}
36+
37+
public static ResourceLocation widget(String widget) {
38+
return new ResourceLocation(modId, "widget/" + widget);
39+
}
3240
}

src/main/java/gay/ampflower/musicmoods/client/WidgetAttachment.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ public static void init(final Minecraft minecraft) {
3232
final int x = deriveX(widget, first, Constants.smallButtonWidth, Constants.smallButtonPlacementOffset);
3333
final int y = widget.getY();
3434

35-
return new ImageButton(x, y, Constants.smallButtonWidth, Constants.smallButtonWidth, 0, 0,
36-
Constants.smallButtonWidth, Constants.moodsResource, Constants.atlasSize, Constants.atlasSize,
35+
return new ImageButton(x, y, Constants.smallButtonWidth, Constants.smallButtonWidth, Constants.musicSprites,
3736
button -> minecraft.setScreen(new ConfigurationScreen(minecraft.screen)));
3837
});
3938
}
Loading
Loading
Binary file not shown.

0 commit comments

Comments
 (0)