Re-addition of blinkActive related methods.

This commit is contained in:
MobiusDevelopment
2021-08-28 17:42:18 +00:00
parent d723a13403
commit 422492b2e4
63 changed files with 641 additions and 21 deletions

View File

@@ -41,6 +41,7 @@ import java.util.concurrent.ConcurrentSkipListMap;
import java.util.concurrent.Future;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.logging.Level;
import java.util.stream.Collectors;
@@ -545,6 +546,8 @@ public class PlayerInstance extends Playable
/** Stored from last ValidatePosition **/
private final Location _lastServerPosition = new Location(0, 0, 0);
private final AtomicBoolean _blinkActive = new AtomicBoolean();
/** The number of recommendation obtained by the PlayerInstance */
private int _recomHave; // how much I was recommended by others
/** The number of recommendation that the PlayerInstance can give */
@@ -10384,6 +10387,16 @@ public class PlayerInstance extends Playable
return _lastServerPosition;
}
public void setBlinkActive(boolean value)
{
_blinkActive.set(value);
}
public boolean isBlinkActive()
{
return _blinkActive.get();
}
@Override
public void addExpAndSp(double addToExp, double addToSp)
{

View File

@@ -106,7 +106,14 @@ public class ValidatePosition implements IClientIncomingPacket
// Check out of sync.
if (player.calculateDistance3D(_x, _y, _z) > player.getStat().getMoveSpeed())
{
player.setXYZ(_x, _y, _z);
if (player.isBlinkActive())
{
player.setBlinkActive(false);
}
else
{
player.setXYZ(_x, _y, _z);
}
}
player.setClientX(_x);

View File

@@ -62,6 +62,11 @@ public class FlyToLocation implements IClientOutgoingPacket
_destY = destY;
_destZ = destZ;
_type = type;
if (creature.isPlayer())
{
creature.getActingPlayer().setBlinkActive(true);
}
}
public FlyToLocation(Creature creature, int destX, int destY, int destZ, FlyType type, int flySpeed, int flyDelay, int animationSpeed)
@@ -77,6 +82,11 @@ public class FlyToLocation implements IClientOutgoingPacket
_flySpeed = flySpeed;
_flyDelay = flyDelay;
_animationSpeed = animationSpeed;
if (creature.isPlayer())
{
creature.getActingPlayer().setBlinkActive(true);
}
}
public FlyToLocation(Creature creature, ILocational dest, FlyType type)