fix region pruning
This commit is contained in:
parent
236d02cb47
commit
3333797144
@ -401,10 +401,12 @@ public final class Settings {
|
||||
* On save, delete from RAM any cached regions that are more than 1024 blocks away from the player
|
||||
* <p>
|
||||
* Temporarily disabled
|
||||
* <p>
|
||||
* Temporarily reenabled
|
||||
*
|
||||
* @see <a href="https://github.com/cabaletta/baritone/issues/248">Issue #248</a>
|
||||
*/
|
||||
public final Setting<Boolean> pruneRegionsFromRAM = new Setting<>(false);
|
||||
public final Setting<Boolean> pruneRegionsFromRAM = new Setting<>(true);
|
||||
|
||||
/**
|
||||
* Remember the contents of containers (chests, echests, furnaces)
|
||||
@ -575,7 +577,7 @@ public final class Settings {
|
||||
/**
|
||||
* How far to move before repeating the build. -1 for the size of the build in that axis. 0 to disable
|
||||
*/
|
||||
public final Setting<Integer> buildRepeatDistance=new Setting<>(0);
|
||||
public final Setting<Integer> buildRepeatDistance = new Setting<>(0);
|
||||
|
||||
/**
|
||||
* What direction te repeat the build in
|
||||
|
@ -180,8 +180,8 @@ public final class CachedWorld implements ICachedWorld, Helper {
|
||||
if (region == null) {
|
||||
continue;
|
||||
}
|
||||
int distX = (region.getX() << 9 + 256) - pruneCenter.getX();
|
||||
int distZ = (region.getZ() << 9 + 256) - pruneCenter.getZ();
|
||||
int distX = ((region.getX() << 9) + 256) - pruneCenter.getX();
|
||||
int distZ = ((region.getZ() << 9) + 256) - pruneCenter.getZ();
|
||||
double dist = Math.sqrt(distX * distX + distZ * distZ);
|
||||
if (dist > 1024) {
|
||||
logDebug("Deleting cached region " + region.getX() + "," + region.getZ() + " from ram");
|
||||
@ -216,7 +216,7 @@ public final class CachedWorld implements ICachedWorld, Helper {
|
||||
if (mostRecentlyModified == null) {
|
||||
return new BlockPos(0, 0, 0);
|
||||
}
|
||||
return new BlockPos(mostRecentlyModified.x << 4 + 8, 0, mostRecentlyModified.z << 4 + 8);
|
||||
return new BlockPos((mostRecentlyModified.x << 4) + 8, 0, (mostRecentlyModified.z << 4) + 8);
|
||||
}
|
||||
|
||||
private synchronized List<CachedRegion> allRegions() {
|
||||
|
Loading…
Reference in New Issue
Block a user