fix feedback for soundreload and potential npe

This commit is contained in:
Bella 2019-12-03 21:21:34 -05:00
parent ce02890740
commit b9bc98b4e5
1 changed files with 3 additions and 1 deletions

View File

@ -11,6 +11,7 @@ import me.zeroeightsix.kami.module.Module;
/**
* Created By AceOfSpades
* Updated by S-B99 on 03/12/19
*/
@Module.Info(name = "ReloadSounds", category = Module.Category.MISC, description = "Reload broken sounds")
@ -21,10 +22,11 @@ public class ReloadSounds extends Module
public void onEnable() {
if (mc.player == null) { this.disable();return; } // :thonk:
Command.sendChatMessage("[ReloadSounds] Reloaded!");
try {
final SoundManager sndManager = (SoundManager)ObfuscationReflectionHelper.getPrivateValue((Class)SoundHandler.class, (Object)this.ReloadSoundSystem.mc.getSoundHandler(), new String[] { "sndManager", "sndManager" });
sndManager.reloadSoundSystem();
Command.sendChatMessage("[ReloadSounds] Reloaded!");
this.disable();
}
catch (Exception e) {