Added the disguise types which don't need vectors
This commit is contained in:
parent
3f85f0f45a
commit
0888f33d1d
@ -364,12 +364,36 @@ public class Disguise {
|
|||||||
tempWatcher.setValue(dataNo, disguiseValues.get(dataNo));
|
tempWatcher.setValue(dataNo, disguiseValues.get(dataNo));
|
||||||
}
|
}
|
||||||
watcher = tempWatcher;
|
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.
|
// A scheduler to clean up any unused disguises.
|
||||||
runnable = new BukkitRunnable() {
|
runnable = new BukkitRunnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
if (!entity.isValid()) {
|
if (!entity.isValid()) {
|
||||||
DisguiseAPI.undisguiseToAll(entity);
|
DisguiseAPI.undisguiseToAll(entity);
|
||||||
} else if (DisguiseAPI.isVelocitySent() && !entity.isOnGround()) {
|
} else if (sendVector && DisguiseAPI.isVelocitySent() && !entity.isOnGround()) {
|
||||||
Vector vector = entity.getVelocity();
|
Vector vector = entity.getVelocity();
|
||||||
if (vector.getY() != 0)
|
if (vector.getY() != 0)
|
||||||
return;
|
return;
|
||||||
|
@ -225,7 +225,6 @@ public class LibsDisguises extends JavaPlugin {
|
|||||||
getCommand("disguiseradius").setExecutor(new DisguiseRadiusCommand(getConfig().getInt("DisguiseRadiusMax")));
|
getCommand("disguiseradius").setExecutor(new DisguiseRadiusCommand(getConfig().getInt("DisguiseRadiusMax")));
|
||||||
getCommand("undisguiseradius").setExecutor(new UndisguiseRadiusCommand(getConfig().getInt("UndisguiseRadiusMax")));
|
getCommand("undisguiseradius").setExecutor(new UndisguiseRadiusCommand(getConfig().getInt("UndisguiseRadiusMax")));
|
||||||
registerValues();
|
registerValues();
|
||||||
// doVectors();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void registerValues() {
|
private void registerValues() {
|
||||||
|
Loading…
Reference in New Issue
Block a user