Added the disguise types which don't need vectors

This commit is contained in:
Andrew 2013-07-21 15:37:29 +12:00
parent 3f85f0f45a
commit 0888f33d1d
2 changed files with 25 additions and 2 deletions

View File

@ -364,12 +364,36 @@ public class Disguise {
tempWatcher.setValue(dataNo, disguiseValues.get(dataNo));
}
watcher = tempWatcher;
boolean doesntMove = false;
switch (getType()) {
case ARROW:
case BAT:
case BOAT:
case ENDER_CRYSTAL:
case ENDER_DRAGON:
case GHAST:
case ITEM_FRAME:
case MINECART:
case MINECART_CHEST:
case MINECART_FURNACE:
case MINECART_HOPPER:
case MINECART_MOB_SPAWNER:
case MINECART_TNT:
case PAINTING:
case PLAYER:
case SQUID:
case WITHER:
doesntMove = true;
default:
break;
}
final boolean sendVector = !doesntMove;
// A scheduler to clean up any unused disguises.
runnable = new BukkitRunnable() {
public void run() {
if (!entity.isValid()) {
DisguiseAPI.undisguiseToAll(entity);
} else if (DisguiseAPI.isVelocitySent() && !entity.isOnGround()) {
} else if (sendVector && DisguiseAPI.isVelocitySent() && !entity.isOnGround()) {
Vector vector = entity.getVelocity();
if (vector.getY() != 0)
return;

View File

@ -225,7 +225,6 @@ public class LibsDisguises extends JavaPlugin {
getCommand("disguiseradius").setExecutor(new DisguiseRadiusCommand(getConfig().getInt("DisguiseRadiusMax")));
getCommand("undisguiseradius").setExecutor(new UndisguiseRadiusCommand(getConfig().getInt("UndisguiseRadiusMax")));
registerValues();
// doVectors();
}
private void registerValues() {