salpland / haze

☘️ A simple command line tool to manage your Minecraft Bedrock worlds
MIT License
4 stars 3 forks source link

`haze test` can overwrite an already existing world by default #1

Closed Nusiq closed 1 year ago

Nusiq commented 1 year ago

I don't have exact reproduction steps. I was basically trying to do everything to break my world using haze and I think that the problem may depend Minecraft saving the game at the same time as haze copies files.

Haze is not safe for careless users. If you haze test while having the world open, you can easily break your world. In my case, the world could still be opened but the chunks were broken. The best solution for that problem would probably be testing whether the world is being used and preventing haze from doing any kind of operation on the world files.

arexon commented 1 year ago

I sort of had the suspicion this could happen, but never managed to get it to actually happen.

I've thought about this for a little bit and I think haze test shouldn't overwrite worlds. In practice, the only time you would use it is when you want to copy a new world to com.mojang. in addition, I can probably implement an --overwrite flag for when you really need to overwrite an already existing world, which in that specific case, should be after you've quit the world and don't need the current version of it.

This is definitely a design oversight I made, so thank you for bringing it up to my attention!

Nusiq commented 1 year ago

Overwriting worlds is useful. With that feature you can use haze for reloading the game to a specific state. This way you can be very destructive when you work on your map. It helps when you're testing things that break blocks (for example custom explosive weapon).

arexon commented 1 year ago

Yeah, that's actually a great use case that I've never thought about until now! Making overwriting disabled by default for haze test will just ensure users wouldn't destroy a world by accident. They could then enable it when they know what they're doing.

arexon commented 1 year ago

Fixed with #2