Use ATed methods & fields instead of ReflectionUtils. Removed ObfuscatedNames as no longer needed.

This commit is contained in:
Xander Victory committed 2017-08-14 17:24:19 +08:00
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;