Skip to content

Commit

Permalink
Fix player not getting teleported back to spawn after reload if he's …
Browse files Browse the repository at this point in the history
…under Y=30
  • Loading branch information
DocSystem committed Oct 17, 2022
1 parent b8f19d1 commit af5f928
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/java/fr/efreicraft/eclobby/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.google.common.io.ByteArrayDataOutput;
import com.google.common.io.ByteStreams;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import fr.efreicraft.eclobby.commands.*;
Expand Down Expand Up @@ -30,6 +31,10 @@ public void onEnable() {
registerCommand("menu", new Menu());
for (Player player : Bukkit.getOnlinePlayers()) {
fr.efreicraft.eclobby.utils.HUDManager.setScoreboard(player);
Location loc = player.getLocation();
if (loc.getY() < -30) {
player.teleport(new Location(player.getWorld(), 0.5, 1, 0.5, 90, 0));
}
}
}

Expand Down

0 comments on commit af5f928

Please sign in to comment.