File tree Expand file tree Collapse file tree 3 files changed +16
-4
lines changed
src/main/java/org/mvplugins/multiverse/core/world Expand file tree Collapse file tree 3 files changed +16
-4
lines changed Original file line number Diff line number Diff line change 1414
1515import org .mvplugins .multiverse .core .configuration .handle .StringPropertyHandle ;
1616import org .mvplugins .multiverse .core .world .config .AllowedPortalType ;
17+ import org .mvplugins .multiverse .core .world .config .SpawnLocation ;
1718import org .mvplugins .multiverse .core .world .config .WorldConfig ;
1819
1920/**
@@ -533,7 +534,7 @@ public long getSeed() {
533534 *
534535 * @return The spawn location of this world.
535536 */
536- public Location getSpawnLocation () {
537+ public SpawnLocation getSpawnLocation () {
537538 return worldConfig .getSpawnLocation ();
538539 }
539540
@@ -544,6 +545,17 @@ public Location getSpawnLocation() {
544545 * @return Result of setting property.
545546 */
546547 public Try <Void > setSpawnLocation (Location spawnLocation ) {
548+ return setSpawnLocation (new SpawnLocation (spawnLocation ));
549+ }
550+
551+ /**
552+ * Sets the spawn location for a world.
553+ *
554+ * @param spawnLocation The spawn location for a world.
555+ * @return Result of setting property.
556+ */
557+ public Try <Void > setSpawnLocation (SpawnLocation spawnLocation ) {
558+ //todo: Maybe check of safe location if adjust spawn is enabled
547559 return worldConfig .setSpawnLocation (spawnLocation );
548560 }
549561
Original file line number Diff line number Diff line change @@ -301,11 +301,11 @@ public Try<Void> setSeed(long seed) {
301301 return configHandle .set (configNodes .SEED , seed );
302302 }
303303
304- public Location getSpawnLocation () {
304+ public SpawnLocation getSpawnLocation () {
305305 return configHandle .get (configNodes .SPAWN_LOCATION );
306306 }
307307
308- public Try <Void > setSpawnLocation (Location spawnLocation ) {
308+ public Try <Void > setSpawnLocation (SpawnLocation spawnLocation ) {
309309 return configHandle .set (configNodes .SPAWN_LOCATION , spawnLocation );
310310 }
311311
Original file line number Diff line number Diff line change @@ -186,7 +186,7 @@ private <N extends Node> N node(N node) {
186186 .name (null )
187187 .build ());
188188
189- final ConfigNode <Location > SPAWN_LOCATION = node (ConfigNode .builder ("spawn-location" , Location .class )
189+ final ConfigNode <SpawnLocation > SPAWN_LOCATION = node (ConfigNode .builder ("spawn-location" , SpawnLocation .class )
190190 .defaultValue (NullLocation .get ())
191191 .name (null )
192192 .onSetValue ((oldValue , newValue ) -> {
You can’t perform that action at this time.
0 commit comments