Skip to content

Commit 5b6d833

Browse files
committed
📝 Update first spawn
1 parent 7c62c21 commit 5b6d833

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/main/java/fr/maxlego08/essentials/listener/PlayerListener.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,12 @@ public void onJoin(PlayerJoinEvent event) {
189189
User user = this.plugin.getUser(player.getUniqueId());
190190
if (user != null) user.startCurrentSessionPlayTime();
191191

192-
if (user != null && user.isFirstJoin() && ConfigStorage.spawnLocation != null && ConfigStorage.spawnLocation.isValid()) {
193-
this.plugin.getScheduler().teleportAsync(player, ConfigStorage.spawnLocation.getLocation());
192+
if (user != null && user.isFirstJoin()) {
193+
if (ConfigStorage.firstSpawnLocation != null && ConfigStorage.firstSpawnLocation.isValid()) {
194+
this.plugin.getScheduler().teleportAsync(player, ConfigStorage.firstSpawnLocation.getLocation());
195+
} else if (ConfigStorage.spawnLocation != null && ConfigStorage.spawnLocation.isValid()) {
196+
this.plugin.getScheduler().teleportAsync(player, ConfigStorage.spawnLocation.getLocation());
197+
}
194198
}
195199

196200
if (user != null && user.getOption(Option.VANISH)) {

0 commit comments

Comments
 (0)