Add sounds for self disguises player to not be cancelled.
This commit is contained in:
parent
d4461f7ade
commit
b026f30087
@ -551,11 +551,11 @@ public abstract class Disguise {
|
||||
* Can the disguised view himself as the disguise
|
||||
*/
|
||||
public void setViewSelfDisguise(boolean viewSelfDisguise) {
|
||||
if (this.viewSelfDisguise != viewSelfDisguise) {
|
||||
if (isSelfDisguiseVisible() != viewSelfDisguise) {
|
||||
this.viewSelfDisguise = viewSelfDisguise;
|
||||
if (getEntity() != null && getEntity() instanceof Player) {
|
||||
if (DisguiseAPI.getDisguise((Player) getEntity(), getEntity()) == this) {
|
||||
if (viewSelfDisguise) {
|
||||
if (isSelfDisguiseVisible()) {
|
||||
DisguiseUtilities.setupFakeDisguise(this);
|
||||
} else
|
||||
DisguiseUtilities.removeSelfDisguise((Player) getEntity());
|
||||
|
@ -764,7 +764,8 @@ public class PacketsManager {
|
||||
}
|
||||
|
||||
else if (event.getPacketType() == PacketType.Play.Server.ENTITY_STATUS) {
|
||||
if (DisguiseAPI.getDisguise(event.getPlayer(), event.getPlayer()).isSelfDisguiseSoundsReplaced()
|
||||
Disguise disguise = DisguiseAPI.getDisguise(event.getPlayer(), event.getPlayer());
|
||||
if (disguise.getType() != DisguiseType.PLAYER && disguise.isSelfDisguiseSoundsReplaced()
|
||||
&& (Byte) event.getPacket().getModifier().read(1) == (ReflectionManager.isAfter17() ? 2 : 1)) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user