Posted May 8, 201411 yr I have a need in one of my mods to regenerate a world automatically. This could be while running or on a server restart. I could make either work. I've done a lot of searching and I can't figure out how to do this. Any advice? Long time Bukkit & Forge Programmer Happy to try and help
May 8, 201411 yr Is there any way to delete the specific world folder so that it will re generate the next time the world is loaded? I am the author of Draconic Evolution
May 8, 201411 yr Author That is an idea. I would have to figure out where the folder is at from the code and then deleting it if nobody is in it, should be easy. It would regen the next time entered. Any idea how to get the location of the world folders? Long time Bukkit & Forge Programmer Happy to try and help
May 8, 201411 yr unfortunately no i am very new no modding. I just know that if you delete a dimension the game will re generate it Edit: maby look into how the world is deleted if you die in hardcore mode. I am the author of Draconic Evolution
May 8, 201411 yr Author That could be a good starting point, i'll give it a shot. Long time Bukkit & Forge Programmer Happy to try and help
May 8, 201411 yr Author I searched through the code and I'm having trouble finding where the hardcore mode locks or deletes a world. Anyone found it before? Long time Bukkit & Forge Programmer Happy to try and help
May 9, 201411 yr I searched through the code and I'm having trouble finding where the hardcore mode locks or deletes a world. Anyone found it before? To get the world's save directory (the folder where the level.dat is in), use this: worldObj.getSaveHandler().getWorldDirectory() It returns a File instance. Append the dimension folder name upon that. To get the name of the dimension (if you're uncertain what the name is, if you wanna delete a dimension from a mod or whatever), use this: this.worldObj.provider.getSaveFolder() Please note that this can return null, when it's the Overworld. Also I strongly recommend to check if a player is in the dimension, and only delete it if it's not the case. Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! | mah twitter This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.
May 9, 201411 yr Author I'll do that. I already have the code build trolling for players in dimensions that would cause problems. I search offline players to move them to a safe dimension if the dimension no longer exists, ect. This would be simpler since just need to look for live players. Thanks for the help. I'll work on it tonight and post how it went. Long time Bukkit & Forge Programmer Happy to try and help
May 10, 201411 yr Author That worked. The problem now is determining if the Enderdragon exists. Easy to do if the relevant chunk is loaded, not sure how to if not. I could just check for a player to be present, do a scan to see if dragon is alive, then delete the world when it is devoid of players (probably best on next reboot). This could cause issues if player isn't near enough to load the chunk. Unlikely, but someone could have built a walkway. Anyone know of a way to determine if the Enderdragon is there without its chunk being loaded? Long time Bukkit & Forge Programmer Happy to try and help
May 10, 201411 yr I dont know much about this but could you search the spawn area and surrounding chunks for the end portal block? or would the chunk have to be loaded for that to work aswell? I am the author of Draconic Evolution
May 10, 201411 yr Author I'll try it, but I think it is the same issue. Needs to be loaded. Long time Bukkit & Forge Programmer Happy to try and help
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.