Skip to content

Commit

Permalink
Remove Village and Fortress Cleanup
Browse files Browse the repository at this point in the history
If you enter a village or fortress, unload the chunks, have the world save twice, and then come back, the village and fortress will be broken.

Restarting the game or server, however, brings them back, which I don't quite understand, but it's a good thing, as it means this feature might be workable on server stopping.

For now, the tweak is removed. Mineshafts are still cleaned up though as this bug hardly matters for them.
  • Loading branch information
Charles445 committed Nov 26, 2021
1 parent 5ff3949 commit 2b5f001
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ public class ConfigMinecraft
@RLConfig.RLCraftTwoNine("true")
public boolean lessCollisions = true;

@Config.Comment("Cleans up Mineshaft, Village, and Fortress .dat files regularly to lower RAM usage")
@Config.Name("Cleanup Worldgen Files")
@Config.Comment("Cleans up Mineshaft .dat files regularly to lower RAM usage. May break mods that need to locate Mineshafts.")
@Config.Name("Cleanup Mineshaft Worldgen Files")
@RLConfig.ImprovementsOnly("true")
@RLConfig.RLCraftTwoEightTwo("true")
@RLConfig.RLCraftTwoNine("true")
public boolean cleanupWorldgenFiles = true;
public boolean cleanupMineshaftWorldgenFiles = true;

@Config.Comment("Replace thrown witch potions with configured potions")
@Config.Name("Witch Potion Replacements")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,20 @@ public void onWorldUnload(WorldEvent.Save event)
if(world.isRemote)
return;

if(ModConfig.server.minecraft.cleanupWorldgenFiles)
//TODO other worldgen
//Uf you enter an area for the first time, leave, world saves twice, come back, the area will be broken
//This is very uncommon, but it's still a possibility
//They seem to regenerate when the game is restarted, which is very peculiar, but could also be incredibly helpful
//It may be possible to run these cleanups on server stopping, or something similar
//
//Nobody uses Mineshafts, though, so that cleaner gets to stay for now


if(ModConfig.server.minecraft.cleanupMineshaftWorldgenFiles)
{
cleanMapGenStructureData(world, "Mineshaft", false, true);
cleanMapGenStructureData(world, "Village", false, true);
cleanMapGenStructureData(world, "Fortress", false, true);
//cleanMapGenStructureData(world, "Village", false, true);
//cleanMapGenStructureData(world, "Fortress", false, true);
}
}

Expand Down

0 comments on commit 2b5f001

Please sign in to comment.