[SPIGOT-7167] Warning when deleting world files before loading it. Created: 08/Oct/22  Updated: 25/Dec/24

Status: Open
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Sergey Maliy Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: World, worldloading
Environment:

OS: Windows 10


Version: CraftBukkit version 3597-Spigot-4aa5ead-aaf484f (MC: 1.19.2) (Implementing API version 1.19.2-R0.1-SNAPSHOT)
Guidelines Read: Yes

 Description   

In fact I don't know if I should expect this to be fixed. Because it's not really a bug. However, I will leave this report.

I'm also not the first to encounter this. https://www.spigotmc.org/threads/failed-to-write-world-uid-dat.480727/

All of the following applies only to the main world. ("level-name" at server.properties)
So, I want the old world to be completely deleted when the server starts, and a new one is generated instead. To do this, I wrote a plugin in which I delete the default world folder and all attached files in method onEnable with plugin.yml load: STARTUP.
But after deletion, when it comes to generating a new world i get a warning:

[03:22:34] [Server thread/WARN]: Failed to write .\bingo\uid.dat
java.io.FileNotFoundException: .\world\uid.dat (The system cannot find the specified path)
        at java.io.FileOutputStream.open0(Native Method) ~[?:?]
        at java.io.FileOutputStream.open(FileOutputStream.java:293) ~[?:?]
        at java.io.FileOutputStream.<init>(FileOutputStream.java:235) ~[?:?]
        at java.io.FileOutputStream.<init>(FileOutputStream.java:184) ~[?:?]
        at org.bukkit.craftbukkit.v1_19_R1.util.WorldUUID.getUUID(WorldUUID.java:42) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3597-Spigot-4aa5ead-aaf484f]
        at org.bukkit.craftbukkit.v1_19_R1.generator.CraftWorldInfo.<init>(CraftWorldInfo.java:23) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3597-Spigot-4aa5ead-aaf484f]
        at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:544) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3597-Spigot-4aa5ead-aaf484f]
        at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:403) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3597-Spigot-4aa5ead-aaf484f]
        at net.minecraft.server.dedicated.DedicatedServer.e(DedicatedServer.java:255) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3597-Spigot-4aa5ead-aaf484f]
        at net.minecraft.server.MinecraftServer.v(MinecraftServer.java:968) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3597-Spigot-4aa5ead-aaf484f]
        at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:293) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3597-Spigot-4aa5ead-aaf484f]
        at java.lang.Thread.run(Thread.java:833) [?:?] 

and the world is loading, but I'm not sure if everything works as I planned, and if I'm breaking something because of this warning.
I understand that the warning is not an error, however I am afraid that something is wrong here.

Thank you for your attention.

 



 Comments   
Comment by Sergey Maliy [ 09/Oct/22 ]

I thought about it, but it seemed to me that this solution is not clean, but ok, thanks for explaining this to me. This works fine.

Comment by md_5 [ 09/Oct/22 ]

It's difficult because datapacks are so baked into the server now they have to be loaded before plugins, and datapacks may come from that world folder.
You can try removing the contents of the folder, but not the folder itself.

Generated at Tue Apr 22 06:21:05 UTC 2025 using Jira 10.3.5#10030005-sha1:190c783f2bd6c69cd5accdb70f97e48812a78d14.