Posted April 9, 20169 yr I almost have this figured out. I'm trying to delete the contents of my custom dimension whenever the player returns to the overworld (or more specifically, when there's no more players in the dimension), so it'll generate fresh next time they enter. The only remaining issue I'm encountering is that when I try to delete the dimension's folder, it fails, because it's unable to delete some of the files in the dimension's 'region' folder. For the record, this is after the player has returned to the overworld, and also after the dimension has been unloaded (I'm sure of this, because if I call DimensionManager.unloadWorld() on the dimension, it tells me it's already unloaded). I took a look around through the source files, and as far as I can tell, all open file pointers to the region files are tracked inside Minecraft's RegionFileCache class. I tried calling RegionFileCache.clearRegionFileReferences(), which closes all of the region file pointers, but even with that it still fails to delete the folder.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.