Don't do checks if the player is self disguised. Perverts see everything anyways unless we want to show em something special
This commit is contained in:
parent
1e12939d87
commit
567a84b8dc
@ -6,7 +6,6 @@ import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.EntityEquipment;
|
||||
@ -235,16 +234,14 @@ public class FlagWatcher {
|
||||
return;
|
||||
if (!entityValues.containsKey(data) || entityValues.get(data) == null)
|
||||
return;
|
||||
Entity entity = getDisguise().getEntity();
|
||||
Object value = entityValues.get(data);
|
||||
List<WrappedWatchableObject> list = new ArrayList<WrappedWatchableObject>();
|
||||
list.add(new WrappedWatchableObject(data, value));
|
||||
PacketContainer packet = new PacketContainer(PacketType.Play.Server.ENTITY_METADATA);
|
||||
StructureModifier<Object> mods = packet.getModifier();
|
||||
mods.write(0, entity.getEntityId());
|
||||
mods.write(0, getDisguise().getEntity().getEntityId());
|
||||
packet.getWatchableCollectionModifier().write(0, list);
|
||||
for (Player player : DisguiseUtilities.getPerverts(getDisguise())) {
|
||||
if (DisguiseConfig.isViewDisguises() || player != entity) {
|
||||
try {
|
||||
ProtocolLibrary.getProtocolManager().sendServerPacket(player, packet);
|
||||
} catch (InvocationTargetException e) {
|
||||
@ -252,7 +249,6 @@ public class FlagWatcher {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setAddEntityAnimations(boolean isEntityAnimationsAdded) {
|
||||
this.addEntityAnimations = isEntityAnimationsAdded;
|
||||
@ -322,7 +318,6 @@ public class FlagWatcher {
|
||||
mods.write(1, slot);
|
||||
mods.write(2, itemToSend);
|
||||
for (Player player : DisguiseUtilities.getPerverts(getDisguise())) {
|
||||
if (player != getDisguise().getEntity()) {
|
||||
try {
|
||||
ProtocolLibrary.getProtocolManager().sendServerPacket(player, packet);
|
||||
} catch (InvocationTargetException e) {
|
||||
@ -330,7 +325,6 @@ public class FlagWatcher {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setItemStack(SlotType slot, ItemStack itemStack) {
|
||||
setItemStack(slot.getSlot(), itemStack);
|
||||
|
Loading…
Reference in New Issue
Block a user