diff options
author | Luke Hohlin <luke@tctcl.dev> | 2024-09-01 14:12:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-01 14:12:58 +0200 |
commit | 784fc5aaca22995a9652ca228484c1833c962db0 (patch) | |
tree | 427aedf738b39c893881e7a423eb68990ef45fbe /src/main | |
parent | eabac50a47d1bd5eee62a9ac0aad9932e2ec997e (diff) | |
download | GT5-Unofficial-784fc5aaca22995a9652ca228484c1833c962db0.tar.gz GT5-Unofficial-784fc5aaca22995a9652ca228484c1833c962db0.tar.bz2 GT5-Unofficial-784fc5aaca22995a9652ca228484c1833c962db0.zip |
Fix server crashing when trying to load MusicRecordDurations (#3008)
* Fix server crashing when trying to load MusicRecordDurations
* Use Loader.getConfigDir() instead of current working dir
---------
Co-authored-by: Martin Robertz <dream-master@gmx.net>
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/gregtech/api/util/GT_MusicSystem.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main/java/gregtech/api/util/GT_MusicSystem.java b/src/main/java/gregtech/api/util/GT_MusicSystem.java index 3a171e0395..7c0ec929e9 100644 --- a/src/main/java/gregtech/api/util/GT_MusicSystem.java +++ b/src/main/java/gregtech/api/util/GT_MusicSystem.java @@ -20,7 +20,6 @@ import net.minecraft.client.audio.SoundRegistry; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemRecord; import net.minecraft.item.ItemStack; -import net.minecraft.launchwrapper.Launch; import net.minecraft.util.ResourceLocation; import org.apache.commons.io.FileUtils; @@ -33,6 +32,7 @@ import com.google.gson.GsonBuilder; import com.jcraft.jorbis.VorbisFile; import baubles.api.BaublesApi; +import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.network.ByteBufUtils; import gregtech.GT_Mod; import gregtech.api.enums.GT_Values; @@ -628,8 +628,9 @@ public final class GT_MusicSystem { final ArrayList<URL> candidates = Collections.list( GT_MusicSystem.class.getClassLoader() .getResources("soundmeta/durations.json")); - final Path configPath = Launch.minecraftHome.toPath() - .resolve("config") + final Path configPath = Loader.instance() + .getConfigDir() + .toPath() .resolve("soundmeta") .resolve("durations.json"); if (Files.exists(configPath)) { |