Skip to content

Commit

Permalink
Set normal speed on join
Browse files Browse the repository at this point in the history
  • Loading branch information
PainOchoco committed Oct 14, 2023
1 parent a417f44 commit de89a20
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
Expand Down Expand Up @@ -80,6 +81,11 @@ void onPlayerMount(EntityMountEvent event) {
mount.addPotionEffect(getPotionEffectForSpeed(player.getWalkSpeed()));
}

@EventHandler
void onPlayerJoin(PlayerJoinEvent event) {
goNormal(event.getPlayer());
}

private boolean hasLeftPath(Player player) {
return playerPaths.containsKey(player.getUniqueId())
&& !speedPathManager.getPath(playerPaths.get(player.getUniqueId())).isOnIt(player.getLocation());
Expand Down

0 comments on commit de89a20

Please sign in to comment.