Set the sound strength when loading the entitys
This commit is contained in:
parent
3e0b557d14
commit
890e17ba36
@ -1,6 +1,7 @@
|
|||||||
package me.libraryaddict.disguise;
|
package me.libraryaddict.disguise;
|
||||||
|
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
|
import java.lang.reflect.Method;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@ -8,6 +9,7 @@ import java.util.Iterator;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import me.libraryaddict.disguise.Commands.*;
|
import me.libraryaddict.disguise.Commands.*;
|
||||||
import me.libraryaddict.disguise.DisguiseTypes.Disguise;
|
import me.libraryaddict.disguise.DisguiseTypes.Disguise;
|
||||||
|
import me.libraryaddict.disguise.DisguiseTypes.DisguiseSound;
|
||||||
import me.libraryaddict.disguise.DisguiseTypes.DisguiseType;
|
import me.libraryaddict.disguise.DisguiseTypes.DisguiseType;
|
||||||
import me.libraryaddict.disguise.DisguiseTypes.PlayerDisguise;
|
import me.libraryaddict.disguise.DisguiseTypes.PlayerDisguise;
|
||||||
import me.libraryaddict.disguise.DisguiseTypes.Values;
|
import me.libraryaddict.disguise.DisguiseTypes.Values;
|
||||||
@ -282,6 +284,12 @@ public class LibsDisguises extends JavaPlugin {
|
|||||||
value.setAttributesValue(GenericAttributes.d.a(), livingEntity.getAttributeInstance(GenericAttributes.d)
|
value.setAttributesValue(GenericAttributes.d.a(), livingEntity.getAttributeInstance(GenericAttributes.d)
|
||||||
.getValue());
|
.getValue());
|
||||||
}
|
}
|
||||||
|
DisguiseSound sound = DisguiseSound.getType(disguiseType.name());
|
||||||
|
if (sound != null) {
|
||||||
|
Method soundStrength = EntityLiving.class.getDeclaredMethod("aZ");
|
||||||
|
soundStrength.setAccessible(true);
|
||||||
|
sound.setDamageSoundVolume((Float) soundStrength.invoke(entity));
|
||||||
|
}
|
||||||
} catch (Exception e1) {
|
} catch (Exception e1) {
|
||||||
System.out.print("[LibsDisguises] Trouble while making values for " + name + ": " + e1.getMessage());
|
System.out.print("[LibsDisguises] Trouble while making values for " + name + ": " + e1.getMessage());
|
||||||
System.out.print("[LibsDisguises] Please report this to LibsDisguises author");
|
System.out.print("[LibsDisguises] Please report this to LibsDisguises author");
|
||||||
|
Loading…
Reference in New Issue
Block a user