diff --git a/build.gradle.kts b/build.gradle.kts index 4a6681a..fe52775 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -42,6 +42,7 @@ java { } repositories { + mavenLocal() mavenCentral() maven("https://oss.sonatype.org/content/repositories/snapshots") { name = "Nexus Repository OSS" diff --git a/gradle.properties b/gradle.properties index 1769ecf..ff12de5 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,6 +3,6 @@ org.gradle.jvmargs=-Xmx1G # Your project's version group=gay.ampflower -projectVersion=0.4.2 +projectVersion=0.4.3 modrinthId=z23qey0b -minecraftCompatible=1.20,1.20.1 +minecraftCompatible=1.20.2 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 3ba7f9a..d073a64 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -2,14 +2,14 @@ annotations = "23.0.0" # https://github.com/LambdAurora/SpruceUI -spruceui = "5.0.0+1.20" -modmenu = "7.0.1" +spruceui = "5.0.3+1.20.2" +modmenu = "8.0.+" # Minecraft -minecraft_version = "1.20" -minecraft_required = ">=1.20 <=1.20.1" +minecraft_version = "1.20.2" +minecraft_required = "1.20.2" fabric_loader = "0.15.+" -fabric_api = "0.83.0+1.20" +fabric_api = "0.89.1+1.20.2" # Plugins loom = "1.+" diff --git a/src/main/java/gay/ampflower/musicmoods/Constants.java b/src/main/java/gay/ampflower/musicmoods/Constants.java index 5809ed3..90b45fa 100644 --- a/src/main/java/gay/ampflower/musicmoods/Constants.java +++ b/src/main/java/gay/ampflower/musicmoods/Constants.java @@ -7,6 +7,7 @@ package gay.ampflower.musicmoods;// Created 2023-16-01T21:35:22 import net.minecraft.client.gui.components.Button; +import net.minecraft.client.gui.components.WidgetSprites; import net.minecraft.resources.ResourceLocation; /** @@ -14,10 +15,9 @@ * @since 0.0.0 **/ public final class Constants { - public static final ResourceLocation moodsResource = new ResourceLocation("music-moods", - "textures/gui/widgets.png"); + public static final String modId = "music-moods"; - public static final int atlasSize = 256; + public static final WidgetSprites musicSprites = widgetHoverable("music"); public static final int buttonHeight = Button.DEFAULT_HEIGHT; public static final int buttonWidth = Button.DEFAULT_WIDTH; @@ -29,4 +29,12 @@ public final class Constants { public static final int primaryButtonLeftOffset = buttonWidth + twoColumnButtonOffset; public static final int primaryButtonRightOffset = primaryButtonLeftOffset + twoColumnButtonOffset; + + public static WidgetSprites widgetHoverable(String widget) { + return new WidgetSprites(widget(widget), widget(widget + "_hover")); + } + + public static ResourceLocation widget(String widget) { + return new ResourceLocation(modId, "widget/" + widget); + } } diff --git a/src/main/java/gay/ampflower/musicmoods/client/WidgetAttachment.java b/src/main/java/gay/ampflower/musicmoods/client/WidgetAttachment.java index 1168071..e9f590a 100644 --- a/src/main/java/gay/ampflower/musicmoods/client/WidgetAttachment.java +++ b/src/main/java/gay/ampflower/musicmoods/client/WidgetAttachment.java @@ -32,8 +32,7 @@ public static void init(final Minecraft minecraft) { final int x = deriveX(widget, first, Constants.smallButtonWidth, Constants.smallButtonPlacementOffset); final int y = widget.getY(); - return new ImageButton(x, y, Constants.smallButtonWidth, Constants.smallButtonWidth, 0, 0, - Constants.smallButtonWidth, Constants.moodsResource, Constants.atlasSize, Constants.atlasSize, + return new ImageButton(x, y, Constants.smallButtonWidth, Constants.smallButtonWidth, Constants.musicSprites, button -> minecraft.setScreen(new ConfigurationScreen(minecraft.screen))); }); } diff --git a/src/main/resources/assets/music-moods/textures/gui/sprites/widget/music.png b/src/main/resources/assets/music-moods/textures/gui/sprites/widget/music.png new file mode 100644 index 0000000..9b65c20 Binary files /dev/null and b/src/main/resources/assets/music-moods/textures/gui/sprites/widget/music.png differ diff --git a/src/main/resources/assets/music-moods/textures/gui/sprites/widget/music_hover.png b/src/main/resources/assets/music-moods/textures/gui/sprites/widget/music_hover.png new file mode 100644 index 0000000..dc4a011 Binary files /dev/null and b/src/main/resources/assets/music-moods/textures/gui/sprites/widget/music_hover.png differ diff --git a/src/main/resources/assets/music-moods/textures/gui/widgets.png b/src/main/resources/assets/music-moods/textures/gui/widgets.png deleted file mode 100644 index b471356..0000000 Binary files a/src/main/resources/assets/music-moods/textures/gui/widgets.png and /dev/null differ