mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-25 14:24:35 +00:00
Use ATed methods & fields instead of ReflectionUtils. Removed ObfuscatedNames as no longer needed.
This commit is contained in:
1 parent
7640990aa2
commit
a30f3e076b
8 files changed
+23
-93
No files matched your search
@@ -3,9 +3,7 @@ package mekanism.client.sound;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import mekanism.common.ObfuscatedNames;
|
||||
import mekanism.common.config.MekanismConfig.client;
|
||||
import mekanism.common.util.ReflectionUtils;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.audio.ISound;
|
||||
import net.minecraft.client.audio.ITickableSound;
|
||||
@@ -118,11 +116,7 @@ public class SoundHandler
|
||||
|
||||
public static SoundManager getSoundManager()
|
||||
{
|
||||
try {
|
||||
return (SoundManager)ReflectionUtils.getPrivateValue(mc.getSoundHandler(), net.minecraft.client.audio.SoundHandler.class, ObfuscatedNames.SoundHandler_sndManager);
|
||||
} catch(Exception e) {
|
||||
return null;
|
||||
}
|
||||
return mc.getSoundHandler().sndManager;
|
||||
}
|
||||
|
||||
//Fudge required because sound thread gets behind and the biMap crashes when rapidly toggling sounds.
|
||||
@@ -130,11 +124,7 @@ public class SoundHandler
|
||||
{
|
||||
if(invPlayingSounds == null)
|
||||
{
|
||||
try {
|
||||
invPlayingSounds = (Map<ISound, String>)ReflectionUtils.getPrivateValue(getSoundManager(), net.minecraft.client.audio.SoundManager.class, ObfuscatedNames.SoundManager_invPlayingSounds);
|
||||
} catch(Exception e) {
|
||||
invPlayingSounds = null;
|
||||
}
|
||||
invPlayingSounds = getSoundManager().invPlayingSounds;
|
||||
}
|
||||
|
||||
return invPlayingSounds;
|
||||
|
||||
Reference in new issue
Block a user