mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-02 06:28:49 +00:00
Ensure spawn.yml is properly deleted when overwritten, close #400
This commit is contained in:
1 parent
aeff866b48
commit
cb9d4808f2
3 files changed
+19
-4
No files matched your search
@@ -327,7 +327,12 @@ public class FabricHuskHomes implements DedicatedServerModInitializer, HuskHomes
|
||||
@Override
|
||||
public void setServerSpawn(@NotNull Location location) {
|
||||
try {
|
||||
this.serverSpawn = Annotaml.create(new File(getDataFolder(), "spawn.yml"), new Spawn(location)).get();
|
||||
// Create or update the spawn.yml file
|
||||
final File spawnFile = new File(getDataFolder(), "spawn.yml");
|
||||
if (spawnFile.exists() && !spawnFile.delete()) {
|
||||
log(Level.WARNING, "Failed to delete the existing spawn.yml file");
|
||||
}
|
||||
this.serverSpawn = Annotaml.create(spawnFile, new Spawn(location)).get();
|
||||
|
||||
// Update the world spawn location, too
|
||||
minecraftServer.getWorlds().forEach(world -> {
|
||||
|
||||
Reference in new issue
Block a user