temporarily disable cached region ram pruning

This commit is contained in:
Leijurv 2018-11-05 17:30:45 -08:00
parent 75a224cef1
commit d59c7cb7a8
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A
2 changed files with 11 additions and 1 deletions

View File

@ -24,8 +24,8 @@ import net.minecraft.util.text.ITextComponent;
import java.awt.*; import java.awt.*;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.util.List;
import java.util.*; import java.util.*;
import java.util.List;
import java.util.function.Consumer; import java.util.function.Consumer;
/** /**
@ -276,6 +276,13 @@ public class Settings {
*/ */
public Setting<Boolean> chunkCaching = new Setting<>(true); public Setting<Boolean> chunkCaching = new Setting<>(true);
/**
* On save, delete from RAM any cached regions that are more than 1024 blocks away from the player
* <p>
* Temporarily disabled, see issue #248
*/
public Setting<Boolean> pruneRegionsFromRAM = new Setting<>(false);
/** /**
* Print all the debug messages to chat * Print all the debug messages to chat
*/ */

View File

@ -165,6 +165,9 @@ public final class CachedWorld implements ICachedWorld, Helper {
* Delete regions that are too far from the player * Delete regions that are too far from the player
*/ */
private synchronized void prune() { private synchronized void prune() {
if (!Baritone.settings().pruneRegionsFromRAM.get()) {
return;
}
BlockPos pruneCenter = guessPosition(); BlockPos pruneCenter = guessPosition();
for (CachedRegion region : allRegions()) { for (CachedRegion region : allRegions()) {
if (region == null) { if (region == null) {