or if you look in player.java where the stopmovement() void is.
theres another void which you could use, along side with stopmovement()
Code:
clearUpdateFlags();
This will stop movement until the current action has been completed.
try it and it should work
but if you want a timer above this
Code:
public void stopMovement() {
Add this:
Code:
public long MovementTimer = 0;
Below your public void stopmovement() {
add this new Void which is the timer version of your original stopmovement()
Code:
public void stopMovement(int Timer) {
if (teleportToX <= 0 && teleportToY <= 0) {
teleportToX = absX;
teleportToY = absY;
}
if (System.currentTimeMillis() - MovementTimer > Timer) {
newWalkCmdSteps = 0;
getNewWalkCmdX()[0] = getNewWalkCmdY()[0] = travelBackX[0] = travelBackY[0] = 0;
getNextPlayerMovement();
MovementTimer = System.currentTimeMillis();
}
}
Then thats your timer Sorted
Use it like: stopMovement(TIMER IN MILLISECONDS);