Fixes #2486 where spawn island was not being saved

This commit is contained in:
tastybento 2024-08-29 17:27:50 -07:00
parent c2737f00e1
commit e476f33743

View File

@ -1209,6 +1209,7 @@ public class IslandsManager {
*/ */
public void setSpawn(@NonNull Island spawn) { public void setSpawn(@NonNull Island spawn) {
if (spawn.getWorld() != null) { if (spawn.getWorld() != null) {
spawn.setSpawn(true);
spawns.put(Util.getWorld(spawn.getWorld()), spawn); spawns.put(Util.getWorld(spawn.getWorld()), spawn);
// Tell other servers // Tell other servers
MultiLib.notify("bentobox-setspawn", spawn.getWorld().getUID().toString() + "," + spawn.getUniqueId()); MultiLib.notify("bentobox-setspawn", spawn.getWorld().getUID().toString() + "," + spawn.getUniqueId());
@ -1223,10 +1224,13 @@ public class IslandsManager {
* @since 1.8.0 * @since 1.8.0
*/ */
public void clearSpawn(World world) { public void clearSpawn(World world) {
if (spawns.containsKey(world)) {
spawns.get(world).setSpawn(false);
spawns.remove(world); spawns.remove(world);
// Tell other servers // Tell other servers
MultiLib.notify("bentobox-setspawn", world.getUID().toString()); MultiLib.notify("bentobox-setspawn", world.getUID().toString());
} }
}
/** /**
* Check is a player has an island and owns it in world * Check is a player has an island and owns it in world