Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import dev.lrxh.neptune.utils.sign.SignInputMenu;
import dev.lrxh.neptune.utils.tasks.NeptuneRunnable;
import dev.lrxh.neptune.utils.tasks.TaskScheduler;
import io.papermc.paper.event.player.AsyncPlayerSpawnLocationEvent;
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;

import org.bukkit.Bukkit;
Expand All @@ -29,6 +30,11 @@

public class ProfileListener implements Listener {

@EventHandler
public void onPlayerSpawnLocation(AsyncPlayerSpawnLocationEvent event) {
event.setSpawnLocation(Neptune.get().getCache().getSpawn());
}

@EventHandler
public void onJoin(PlayerJoinEvent event) {
Player player = event.getPlayer();
Expand All @@ -44,7 +50,6 @@ public void onJoin(PlayerJoinEvent event) {
.thenAccept(unused -> TaskScheduler.get().startTask(new NeptuneRunnable() {
@Override
public void run() {
PlayerUtil.teleportToSpawn(player.getUniqueId());
if (!MessagesLocale.JOIN_MESSAGE.getString().equals("NONE")) {
ServerUtils.broadcast(MessagesLocale.JOIN_MESSAGE,
Placeholder.unparsed("player", player.getName()));
Expand Down