Cancel velocities on squid disguises
This commit is contained in:
parent
4014aab004
commit
04271be455
@ -24,6 +24,7 @@ import org.bukkit.Location;
|
|||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Damageable;
|
import org.bukkit.entity.Damageable;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
|
import org.bukkit.entity.EntityType;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.EquipmentSlot;
|
import org.bukkit.inventory.EquipmentSlot;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
@ -219,6 +220,10 @@ public class PacketHandlerSpawn implements IPacketHandler {
|
|||||||
} else if (disguise.isMobDisguise() || disguise.getType() == DisguiseType.ARMOR_STAND) {
|
} else if (disguise.isMobDisguise() || disguise.getType() == DisguiseType.ARMOR_STAND) {
|
||||||
Vector vec = disguisedEntity.getVelocity();
|
Vector vec = disguisedEntity.getVelocity();
|
||||||
|
|
||||||
|
if (disguise.getType() == DisguiseType.SQUID && disguisedEntity.getType() != EntityType.SQUID) {
|
||||||
|
vec = new Vector();
|
||||||
|
}
|
||||||
|
|
||||||
PacketContainer spawnEntity = new PacketContainer(PacketType.Play.Server.SPAWN_ENTITY_LIVING);
|
PacketContainer spawnEntity = new PacketContainer(PacketType.Play.Server.SPAWN_ENTITY_LIVING);
|
||||||
packets.addPacket(spawnEntity);
|
packets.addPacket(spawnEntity);
|
||||||
|
|
||||||
|
@ -22,7 +22,8 @@ public class PacketHandlerVelocity implements IPacketHandler {
|
|||||||
public void handle(Disguise disguise, PacketContainer sentPacket, LibsPackets packets, Player observer,
|
public void handle(Disguise disguise, PacketContainer sentPacket, LibsPackets packets, Player observer,
|
||||||
Entity entity) {
|
Entity entity) {
|
||||||
// If the disguise isnt a misc or the disguised is the same type
|
// If the disguise isnt a misc or the disguised is the same type
|
||||||
if (!disguise.getType().isMisc() || DisguiseType.getType(entity) == disguise.getType()) {
|
if ((!disguise.getType().isMisc() && disguise.getType() != DisguiseType.SQUID) ||
|
||||||
|
DisguiseType.getType(entity) == disguise.getType()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user