diff options
author | bowser0000 <bowser0000@gmail.com> | 2022-08-09 20:24:18 -0400 |
---|---|---|
committer | bowser0000 <bowser0000@gmail.com> | 2022-08-09 20:24:18 -0400 |
commit | f56302bee3939677fc3fd015a97b12b5100c45b1 (patch) | |
tree | f1c927068d70ff015d98a0b882d33e70d2f3df8a /src/main | |
parent | 60d3517fc1f70aeeb83dd6627ade3093f7760b04 (diff) | |
download | SkyblockMod-f56302bee3939677fc3fd015a97b12b5100c45b1.tar.gz SkyblockMod-f56302bee3939677fc3fd015a97b12b5100c45b1.tar.bz2 SkyblockMod-f56302bee3939677fc3fd015a97b12b5100c45b1.zip |
Fix issues with custom music volume
Fix custom music set to 50% volume on first load (ignoring config)
Fix island music using hub volume
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/me/Danker/DankersSkyblockMod.java | 8 | ||||
-rw-r--r-- | src/main/java/me/Danker/events/PostConfigInitEvent.java | 13 | ||||
-rw-r--r-- | src/main/java/me/Danker/features/CustomMusic.java | 5 |
3 files changed, 19 insertions, 7 deletions
diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 6322c33..280fc96 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -2,10 +2,7 @@ package me.Danker; import com.google.gson.JsonObject; import me.Danker.commands.*; -import me.Danker.events.ChestSlotClickedEvent; -import me.Danker.events.GuiChestBackgroundDrawnEvent; -import me.Danker.events.ModInitEvent; -import me.Danker.events.RenderOverlayEvent; +import me.Danker.events.*; import me.Danker.features.*; import me.Danker.features.loot.*; import me.Danker.features.puzzlesolvers.*; @@ -181,9 +178,10 @@ public class DankersSkyblockMod { MinecraftForge.EVENT_BUS.register(new TrophyFishTracker()); MinecraftForge.EVENT_BUS.register(new WolfTracker()); MinecraftForge.EVENT_BUS.register(new ZombieTracker()); - + MinecraftForge.EVENT_BUS.post(new ModInitEvent(configDirectory)); ConfigHandler.reloadConfig(); + MinecraftForge.EVENT_BUS.post(new PostConfigInitEvent(configDirectory)); keyBindings[0] = new KeyBinding("Open Maddox Menu", Keyboard.KEY_M, "Danker's Skyblock Mod"); keyBindings[1] = new KeyBinding("Regular Ability", Keyboard.KEY_NUMPAD4, "Danker's Skyblock Mod"); diff --git a/src/main/java/me/Danker/events/PostConfigInitEvent.java b/src/main/java/me/Danker/events/PostConfigInitEvent.java new file mode 100644 index 0000000..3e58456 --- /dev/null +++ b/src/main/java/me/Danker/events/PostConfigInitEvent.java @@ -0,0 +1,13 @@ +package me.Danker.events; + +import net.minecraftforge.fml.common.eventhandler.Event; + +public class PostConfigInitEvent extends Event { + + public final String configDirectory; + + public PostConfigInitEvent(String configDirectory) { + this.configDirectory = configDirectory; + } + +} diff --git a/src/main/java/me/Danker/features/CustomMusic.java b/src/main/java/me/Danker/features/CustomMusic.java index 6c5dd08..38e4ba0 100644 --- a/src/main/java/me/Danker/features/CustomMusic.java +++ b/src/main/java/me/Danker/features/CustomMusic.java @@ -3,6 +3,7 @@ package me.Danker.features; import me.Danker.DankersSkyblockMod; import me.Danker.commands.ToggleCommand; import me.Danker.events.ModInitEvent; +import me.Danker.events.PostConfigInitEvent; import me.Danker.handlers.ScoreboardHandler; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; @@ -218,7 +219,7 @@ public class CustomMusic { } @SubscribeEvent - public void init(ModInitEvent event) { + public void postConfigInit(PostConfigInitEvent event) { init(event.configDirectory); } @@ -237,7 +238,7 @@ public class CustomMusic { phase4 = new Song(directory, "phasefour", phase4Volume); phase5 = new Song(directory, "phasefive", phase5Volume); hub = new Song(directory, "hub", hubVolume); - island = new Song(directory, "island", hubVolume); + island = new Song(directory, "island", islandVolume); dungeonHub = new Song(directory, "dungeonhub", dungeonHubVolume); farmingIslands = new Song(directory, "farmingislands", farmingIslandsVolume); goldMine = new Song(directory, "goldmine", goldMineVolume); |