Don't send bat if bat aint flying

This commit is contained in:
libraryaddict 2014-06-14 20:32:47 +12:00
parent c145ae5106
commit b4f1569b95

View File

@ -10,6 +10,7 @@ import me.libraryaddict.disguise.DisguiseAPI;
import me.libraryaddict.disguise.DisguiseConfig; import me.libraryaddict.disguise.DisguiseConfig;
import me.libraryaddict.disguise.disguisetypes.TargetedDisguise.TargetType; import me.libraryaddict.disguise.disguisetypes.TargetedDisguise.TargetType;
import me.libraryaddict.disguise.disguisetypes.watchers.AgeableWatcher; import me.libraryaddict.disguise.disguisetypes.watchers.AgeableWatcher;
import me.libraryaddict.disguise.disguisetypes.watchers.BatWatcher;
import me.libraryaddict.disguise.disguisetypes.watchers.HorseWatcher; import me.libraryaddict.disguise.disguisetypes.watchers.HorseWatcher;
import me.libraryaddict.disguise.disguisetypes.watchers.ZombieWatcher; import me.libraryaddict.disguise.disguisetypes.watchers.ZombieWatcher;
import me.libraryaddict.disguise.utilities.DisguiseUtilities; import me.libraryaddict.disguise.utilities.DisguiseUtilities;
@ -216,6 +217,9 @@ public abstract class Disguise {
if (isModifyBoundingBox()) { if (isModifyBoundingBox()) {
DisguiseUtilities.doBoundingBox(disguise); DisguiseUtilities.doBoundingBox(disguise);
} }
if (getType() == DisguiseType.BAT && !((BatWatcher) getWatcher()).isFlying()) {
return;
}
// 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 (isVelocitySent() && vectorY != 0 && (alwaysSendVelocity || !getEntity().isOnGround())) { if (isVelocitySent() && vectorY != 0 && (alwaysSendVelocity || !getEntity().isOnGround())) {