Skip to content

Commit ba2ef72

Browse files
committed
Save spawn locations in Island correctly.
1 parent 2ef2370 commit ba2ef72

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

src/main/java/world/bentobox/bentobox/database/objects/Island.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1398,13 +1398,11 @@ public void setSettingsFlag(Flag flag, boolean state, boolean doSubflags) {
13981398
* @param l - location
13991399
*/
14001400
public void setSpawnPoint(Environment islandType, Location l) {
1401-
spawnPoint.compute(islandType, (key, value) -> {
1402-
if (value == null || !value.equals(l)) {
1403-
setChanged(); // Call setChanged only if the value is updated.
1404-
return l; // clone??
1405-
}
1406-
return value;
1407-
});
1401+
if (spawnPoint.containsKey(islandType) && spawnPoint.get(islandType).equals(l)) {
1402+
return;
1403+
}
1404+
spawnPoint.put(islandType, l.clone());
1405+
setChanged();
14081406
}
14091407

14101408
/**

src/main/java/world/bentobox/bentobox/managers/IslandsManager.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1117,7 +1117,6 @@ private CompletableFuture<Boolean> homeTeleportAsync(@NonNull World world, @NonN
11171117
user.sendMessage("commands.island.go.teleport");
11181118
goingHome.add(user.getUniqueId());
11191119

1120-
// TODO
11211120
readyPlayer(player);
11221121
this.getAsyncSafeHomeLocation(world, user, name).thenAccept(home -> {
11231122
Island island = getIsland(world, user);

0 commit comments

Comments
 (0)