Skip to content

Commit

Permalink
Update to 1.20.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Ampflower committed Sep 26, 2023
1 parent fba7c4f commit bf25e4e
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 20 deletions.
5 changes: 3 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ java {
}

repositories {
mavenLocal()
mavenCentral()
maven("https://oss.sonatype.org/content/repositories/snapshots") {
name = "Nexus Repository OSS"
Expand Down Expand Up @@ -124,8 +125,8 @@ modrinth {
)
val ref = System.getenv("GITHUB_REF")
changelog.set(
System.getenv("CHANGELOG") ?: if (ref != null && ref.startsWith("refs/tags/")) "You may view the changelog at https://github.com/the-glitch-network/music-moods/releases/tag/${URLEncoder.encode(ref.substring(10), StandardCharsets.UTF_8)}"
else "No changelog is available. Perhaps poke at https://github.com/the-glitch-network/music-moods for a changelog?"
System.getenv("CHANGELOG") ?: if (ref != null && ref.startsWith("refs/tags/")) "You may view the changelog at https://github.com/Modflower/music-moods/releases/tag/${URLEncoder.encode(ref.substring(10), StandardCharsets.UTF_8)}"
else "No changelog is available. Perhaps poke at https://github.com/Modflower/music-moods for a changelog?"
)
uploadFile.set(tasks.remapJar.get())
gameVersions.set(minecraftCompatible.split(","))
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ org.gradle.jvmargs=-Xmx1G

# Your project's version
group=gay.ampflower
projectVersion=0.3.2
projectVersion=0.3.3
modrinthId=z23qey0b
minecraftCompatible=1.20,1.20.1
minecraftCompatible=1.20.2
16 changes: 9 additions & 7 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
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'
quilt_loader = "0.18.+"
quilted_fabric_api = "7.2.1+0.88.0-1.20.1"
minecraft_version = "1.20.2"
minecraft_required = '>=1.20.2'
quilt_loader = "0.20.+"
# quilted_fabric_api = "7.2.1+0.88.0-1.20.1"
fabric_api = "0.89.1+1.20.2"

# Plugins
loom = "1.+"
Expand All @@ -28,7 +29,8 @@ annotations = { module = "org.jetbrains:annotations", version.ref = "annotations
# Mods
spruceui = { module = "dev.lambdaurora:spruceui", version.ref = "spruceui" }
modmenu = { module = "com.terraformersmc:modmenu", version.ref = "modmenu" }
quilted_fabric_api = { module = "org.quiltmc.quilted-fabric-api:quilted-fabric-api", version.ref = "quilted_fabric_api" }
# quilted_fabric_api = { module = "org.quiltmc.quilted-fabric-api:quilted-fabric-api", version.ref = "quilted_fabric_api" }
quilted_fabric_api = { module = "net.fabricmc.fabric-api:fabric-api", version.ref = "fabric_api" }

[bundles]
compileOnly = ["annotations"]
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/gay/ampflower/musicmoods/ClientMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@

package gay.ampflower.musicmoods;// Created 2023-12-01T02:08:34

import org.quiltmc.loader.api.ModContainer;
import net.fabricmc.api.ClientModInitializer;
import org.quiltmc.loader.api.QuiltLoader;
import org.quiltmc.qsl.base.api.entrypoint.client.ClientModInitializer;

import java.io.IOException;

Expand All @@ -20,7 +19,7 @@ public class ClientMain implements ClientModInitializer {
public static boolean isModMenuPresent = QuiltLoader.isModLoaded("modmenu");

@Override
public void onInitializeClient(final ModContainer mod) {
public void onInitializeClient() {
try {
Config.read();
} catch (IOException ioe) {
Expand Down
14 changes: 11 additions & 3 deletions src/main/java/gay/ampflower/musicmoods/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
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;

/**
* @author Ampflower
* @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;
Expand All @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
});
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
2 changes: 1 addition & 1 deletion src/main/resources/quilt.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"icon": "assets/music-moods/pack.png"
},
"entrypoints": {
"client_init": [
"client": [
"gay.ampflower.musicmoods.ClientMain"
],
"modmenu": [
Expand Down

0 comments on commit bf25e4e

Please sign in to comment.