mirror of
https://github.com/TotalFreedomMC/TF-LibsDisguises.git
synced 2024-11-11 01:17:16 +00:00
Another bug fixed?
This commit is contained in:
parent
e1c410781a
commit
d20a8e5266
1 changed files with 6 additions and 7 deletions
|
@ -64,7 +64,7 @@ public class PacketListenerSounds extends PacketAdapter {
|
||||||
SoundType soundType = null;
|
SoundType soundType = null;
|
||||||
|
|
||||||
Entity disguisedEntity = null;
|
Entity disguisedEntity = null;
|
||||||
SoundGroup entitySound = null;
|
SoundGroup soundGroup = null;
|
||||||
Object soundEffectObj = mods.read(0);
|
Object soundEffectObj = mods.read(0);
|
||||||
|
|
||||||
Disguise disguise = null;
|
Disguise disguise = null;
|
||||||
|
@ -93,16 +93,15 @@ public class PacketListenerSounds extends PacketAdapter {
|
||||||
|
|
||||||
disguise = entityDisguise;
|
disguise = entityDisguise;
|
||||||
disguisedEntity = entity;
|
disguisedEntity = entity;
|
||||||
entitySound = SoundGroup.getGroup(entity.getType().name());
|
soundGroup = SoundGroup.getGroup(entity.getType().name());
|
||||||
|
|
||||||
if (entitySound == null) {
|
if (soundGroup.getSound(soundEffectObj) == null) {
|
||||||
event.setCancelled(true);
|
return;
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((!(entity instanceof LivingEntity)) || ((LivingEntity) entity).getHealth() > 0) {
|
if ((!(entity instanceof LivingEntity)) || ((LivingEntity) entity).getHealth() > 0) {
|
||||||
boolean hasInvun = ReflectionManager.hasInvul(entity);
|
boolean hasInvun = ReflectionManager.hasInvul(entity);
|
||||||
soundType = entitySound.getType(soundEffectObj, !hasInvun);
|
soundType = soundGroup.getType(soundEffectObj, !hasInvun);
|
||||||
} else {
|
} else {
|
||||||
soundType = SoundType.DEATH;
|
soundType = SoundType.DEATH;
|
||||||
}
|
}
|
||||||
|
@ -143,7 +142,7 @@ public class PacketListenerSounds extends PacketAdapter {
|
||||||
float pitch = (float) mods.read(6);
|
float pitch = (float) mods.read(6);
|
||||||
|
|
||||||
// If the volume is the default
|
// If the volume is the default
|
||||||
if (volume == entitySound.getDamageAndIdleSoundVolume()) {
|
if (volume == soundGroup.getDamageAndIdleSoundVolume()) {
|
||||||
volume = disguiseSound.getDamageAndIdleSoundVolume();
|
volume = disguiseSound.getDamageAndIdleSoundVolume();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue