Skip to content

Commit

Permalink
Add setting to disable force spawning of new players.
Browse files Browse the repository at this point in the history
  • Loading branch information
creatorfromhell committed Mar 7, 2024
1 parent 6574951 commit c635bc2
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void onJoin(PlayerJoinEvent event) {
}

//We don't manage so send the player to the spawn world
if(!event.getPlayer().hasPlayedBefore()) {
if(!event.getPlayer().hasPlayedBefore() && PhantomWorlds.instance().settings.getConfig().getBoolean("spawning.default-first", true)) {
event.getPlayer().teleport(Utils.parseSpawn(sWorld));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ void alertIncorrectVersion(final PWFile pwFile) {
* @since v2.0.0
*/
public enum PWFile {
SETTINGS(2),
SETTINGS(3),
ADVANCED_SETTINGS(1),
MESSAGES(9),
DATA(2);
Expand Down
27 changes: 27 additions & 0 deletions src/main/java/me/lokka30/phantomworlds/misc/PAPIHook.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package me.lokka30.phantomworlds.misc;
/*
* Phantom Worlds
* Copyright (C) 2023 - 2024 Daniel "creatorfromhell" Vidmar
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

/**
* PAPIHook
*
* @author creatorfromhell
* @since 2.0.5.0
*/
public class PAPIHook {
}
5 changes: 4 additions & 1 deletion src/main/resources/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ spawning:
#they will go to.
default-world: world

#If players should be sent to the default-world if they haven't played before.
default-first: true

#Should players respawn at the world spawn if they don't have a bed?
respawn-world: true

Expand All @@ -31,5 +34,5 @@ backup-delay: 600

# Do not touch anything here unless you know what you are doing.
advanced:
file-version: 2
file-version: 3
generated-with: '${project.version}'

0 comments on commit c635bc2

Please sign in to comment.