Skip to content

Commit 5d5b719

Browse files
author
Fr4gm3nt3d_sh
committed
dev-1.19.2 (TeamFelNull#59)
Fixing Multiple Issues with Modfiles not working, updating from IMP to IMPR Reviewed-on: https://codeberg.org/Mod-Sauce/IamMusicPlayerRenewed/pulls/59
1 parent b366637 commit 5d5b719

File tree

6 files changed

+86
-15
lines changed

6 files changed

+86
-15
lines changed

.github/workflows/gradle.yml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,27 @@ jobs:
4040
with:
4141
name: IamMusicPlayerRenewedFabric
4242
path: fabric/build/libs
43-
compression-level: 9
43+
compression-level: 9
44+
45+
- name: Install GitHub CLI
46+
if: failure()
47+
run: sudo apt update && sudo apt install -y gh
48+
49+
- name: Dump logs and notify Discord
50+
if: failure()
51+
env:
52+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53+
DISCORD_WEBHOOK_URL: ${{ secrets.IAMLOGGER }}
54+
run: |
55+
mkdir logs
56+
gh run download $GITHUB_RUN_ID -D logs
57+
58+
# Extract the last 100 lines from all logs (or change as needed)
59+
output=$(find logs -type f -name '*.txt' -exec tail -n 100 {} \; | sed 's/"/\\"/g' | head -c 1800)
60+
61+
payload="{\"content\": \"❌ **Build failed!**\n\`\`\`\n$output\n\`\`\`\"}"
62+
63+
curl -H "Content-Type: application/json" \
64+
-X POST \
65+
-d "$payload" \
66+
"$DISCORD_WEBHOOK_URL"

build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ allprojects {
3737
apply plugin: "java"
3838
apply plugin: "architectury-plugin"
3939
apply plugin: "maven-publish"
40+
41+
version = rootProject.mod_version
4042

4143
repositories {
4244
mavenCentral()

common/src/main/java/dev/felnull/imp/IMPConfig.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,12 @@ public class IMPConfig implements ConfigData {
2424
public boolean useYoutubeDownloader = true;
2525

2626
@ConfigEntry.Category("client")
27-
public String relayServerURL = "https://raw.githubusercontent.com/TeamFelnull/IamMusicPlayer/master/relay_server.json";
27+
public String relayServerURL =
28+
"https://raw.githubusercontent.com/TeamFelnull/IamMusicPlayer/master/relay_server.json";
2829

2930
@ConfigEntry.Category("client")
30-
public String lavaPlayerNativesURL = "https://raw.githubusercontent.com/Mod-Sauce/test_lavaplayer_IMP/refs/heads/main/lavaplayer/natives_link.json";
31+
public String lavaPlayerNativesURL =
32+
"https://raw.githubusercontent.com/Mod-Sauce/test_lavaplayer_IMP/refs/heads/main/lavaplayer/natives_link.json";
3133

3234
@ConfigEntry.Category("client")
3335
public boolean hideDisplaySprite = false;
@@ -56,4 +58,8 @@ public class IMPConfig implements ConfigData {
5658

5759
@ConfigEntry.Category("debug")
5860
public boolean showSpeakerRange = false;
61+
62+
@ConfigEntry.Category("internal")
63+
@ConfigEntry.Gui.Excluded
64+
public String configVersion = "1";
5965
}

common/src/main/java/dev/felnull/imp/IamMusicPlayer.java

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,16 @@
1818
import me.shedaniel.autoconfig.serializer.Toml4jConfigSerializer;
1919

2020
public class IamMusicPlayer {
21-
public static final IMPConfig CONFIG = AutoConfig.register(IMPConfig.class, Toml4jConfigSerializer::new).getConfig();
21+
22+
public static final IMPConfig CONFIG = AutoConfig.register(
23+
IMPConfig.class,
24+
Toml4jConfigSerializer::new
25+
).getConfig();
2226
public static final String MODID = "iammusicplayer";
23-
private static final Supplier<String> MODNAME = Suppliers.memoize(() -> Platform.getMod(MODID).getName());
27+
public static final String CONFIG_VERSION = "1";
28+
private static final Supplier<String> MODNAME = Suppliers.memoize(() ->
29+
Platform.getMod(MODID).getName()
30+
);
2431

2532
public static void init() {
2633
IMPPackets.init();
@@ -36,6 +43,39 @@ public static void init() {
3643
CommonHandler.init();
3744
}
3845

46+
private static void checkAndResetConfig() {
47+
if (
48+
CONFIG.configVersion == null ||
49+
CONFIG.configVersion.isEmpty() ||
50+
!CONFIG.configVersion.equals(CONFIG_VERSION)
51+
) {
52+
// Reset all config values to defaults
53+
CONFIG.volume = 1f;
54+
CONFIG.maxPlayCont = 8;
55+
CONFIG.spatial = true;
56+
CONFIG.sampleRate = 44100;
57+
CONFIG.useYoutubeDownloader = true;
58+
CONFIG.relayServerURL =
59+
"https://raw.githubusercontent.com/TeamFelnull/IamMusicPlayer/master/relay_server.json";
60+
CONFIG.lavaPlayerNativesURL =
61+
"https://raw.githubusercontent.com/Mod-Sauce/test_lavaplayer_IMP/refs/heads/main/lavaplayer/natives_link.json";
62+
CONFIG.hideDisplaySprite = false;
63+
CONFIG.hideDecorativeAntenna = false;
64+
CONFIG.maxWaitTime = 1000 * 10;
65+
CONFIG.retryTime = 1000 * 3;
66+
CONFIG.dropItemRing = true;
67+
CONFIG.soundPhysicsRemasteredIntegration = true;
68+
CONFIG.showMusicLines = false;
69+
CONFIG.showSpeakerRange = false;
70+
71+
// Update config version
72+
CONFIG.configVersion = CONFIG_VERSION;
73+
74+
// Save the config
75+
AutoConfig.getConfigHolder(IMPConfig.class).save();
76+
}
77+
}
78+
3979
public static void setup() {
4080
IMPVillagerProfessions.setup();
4181
}

forge/src/main/resources/META-INF/mods.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
modLoader = "javafml"
2-
loaderVersion = "[43.5,)"
2+
loaderVersion = "[43,)"
33
issueTrackerURL = "https://github.com/Mod-Sauce/IamMusicPlayer_FIX/issues"
44
license = "GNU LGPLv3"
55

66
[[mods]]
77
modId = "iammusicplayer"
88
version = "${version}"
9-
displayName = "Iam Music Player Renewede"
9+
displayName = "Iam Music Player Renewed"
1010
displayURL = "https://modrinth.com/mod/iam-music-player-renewed"
1111
updateJSONURL = ""
1212
authors = "Mooo0042, Shadowbee27"
13-
credits = "Mod-Sauce Dev's"
14-
description = '''
13+
credits = "Mod-Sauce Devs"
14+
description = """
1515
Add a boombox that can play music.
1616
The ikisugi music player mod...
17-
'''
17+
"""
1818
logoFile = "logo.png"
1919

2020
[modproperties.iammusicplayer]
@@ -23,7 +23,7 @@ catalogueImageIcon = "icon.png"
2323
[[dependencies.iammusicplayer]]
2424
modId = "forge"
2525
mandatory = true
26-
versionRange = "[43.5.0,)"
26+
versionRange = "[43,)"
2727
ordering = "NONE"
2828
side = "BOTH"
2929

@@ -44,7 +44,7 @@ side = "BOTH"
4444
[[dependencies.iammusicplayer]]
4545
modId = "cloth_config"
4646
mandatory = true
47-
versionRange = "[8.3.134,)"
47+
versionRange = "[8.0.75,)"
4848
ordering = "NONE"
4949
side = "BOTH"
5050

gradle.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ support_versions=1.19.2
66
#Mod
77
archives_base_name=iammusicplayer
88
mod_display_name=IamMusicPlayer
9-
mod_version=3.20.1-1.19.2
9+
mod_version=3.20.3-1.19.2
1010
enabled_platforms=fabric,forge
1111
#Dependencies
1212
architectury_version=6.6.92
@@ -21,8 +21,8 @@ soundphysics_forge=5525251
2121
soundphysics_fabric=5525254
2222
oe_version=3.2.0
2323
#Lavalink
24-
youtube_src=1.13.3
24+
youtube_src=1.16.0
2525
ytdownloader=3.2.8
2626
lava_natives=2.2.3
2727
#Other
28-
felnull_version=1.75
28+
felnull_version=1.75

0 commit comments

Comments
 (0)