Change entity in disguise to getEntity()

This commit is contained in:
libraryaddict 2013-11-25 15:52:08 +13:00
parent ee9a30561a
commit 6d1e9a7655
2 changed files with 7 additions and 7 deletions

View file

@ -59,7 +59,7 @@
<version>2.7.0</version> <version>2.7.0</version>
</dependency> </dependency>
</dependencies> </dependencies>
<version>7.7.3</version> <version>7.7.3-SNAPSHOT</version>
<distributionManagement> <distributionManagement>
<repository> <repository>

View file

@ -196,9 +196,9 @@ public abstract class Disguise {
// If the vectorY isn't 0. Cos if it is. Then it doesn't want to send any vectors. // If the vectorY isn't 0. Cos if it is. Then it doesn't want to send any vectors.
// If this disguise has velocity sending enabled and the entity is flying. // If this disguise has velocity sending enabled and the entity is flying.
if (vectorY != 0 && isVelocitySent() && (alwaysSendVelocity || !entity.isOnGround())) { if (vectorY != 0 && isVelocitySent() && (alwaysSendVelocity || !entity.isOnGround())) {
Vector vector = entity.getVelocity(); Vector vector = getEntity().getVelocity();
// If the entity doesn't have velocity changes already // If the entity doesn't have velocity changes already
if (vector.getY() != 0 && !(vector.getY() < 0 && alwaysSendVelocity && entity.isOnGround())) { if (vector.getY() != 0 && !(vector.getY() < 0 && alwaysSendVelocity && getEntity().isOnGround())) {
return; return;
} }
if (getType() != DisguiseType.EXPERIENCE_ORB || !entity.isOnGround()) { if (getType() != DisguiseType.EXPERIENCE_ORB || !entity.isOnGround()) {
@ -206,8 +206,8 @@ public abstract class Disguise {
if (getType() == DisguiseType.WITHER_SKULL) { if (getType() == DisguiseType.WITHER_SKULL) {
lookPacket = new PacketContainer(Packets.Server.ENTITY_LOOK); lookPacket = new PacketContainer(Packets.Server.ENTITY_LOOK);
StructureModifier<Object> mods = lookPacket.getModifier(); StructureModifier<Object> mods = lookPacket.getModifier();
mods.write(0, entity.getEntityId()); mods.write(0, getEntity().getEntityId());
Location loc = entity.getLocation(); Location loc = getEntity().getLocation();
mods.write( mods.write(
4, 4,
PacketsManager.getYaw(getType(), DisguiseType.getType(entity.getType()), PacketsManager.getYaw(getType(), DisguiseType.getType(entity.getType()),
@ -235,7 +235,7 @@ public abstract class Disguise {
} }
mods.write(0, DisguiseAPI.getFakeDisguise(entity.getEntityId())); mods.write(0, DisguiseAPI.getFakeDisguise(entity.getEntityId()));
} else { } else {
mods.write(0, entity.getEntityId()); mods.write(0, getEntity().getEntityId());
} }
mods.write(1, (int) (vector.getX() * 8000)); mods.write(1, (int) (vector.getX() * 8000));
mods.write( mods.write(
@ -256,7 +256,7 @@ public abstract class Disguise {
if (sendMovementPacket) { if (sendMovementPacket) {
PacketContainer packet = new PacketContainer(Packets.Server.REL_ENTITY_MOVE); PacketContainer packet = new PacketContainer(Packets.Server.REL_ENTITY_MOVE);
StructureModifier<Object> mods = packet.getModifier(); StructureModifier<Object> mods = packet.getModifier();
mods.write(0, entity.getEntityId()); mods.write(0, getEntity().getEntityId());
for (Player player : getPerverts()) { for (Player player : getPerverts()) {
if (DisguiseAPI.isViewDisguises() || entity != player) { if (DisguiseAPI.isViewDisguises() || entity != player) {
try { try {