command to rescan and repack all loaded chunks
This commit is contained in:
parent
0ce68ee21f
commit
3f15451e88
@ -36,8 +36,10 @@ import baritone.pathing.movement.Movement;
|
||||
import baritone.pathing.movement.MovementHelper;
|
||||
import baritone.utils.pathing.BetterBlockPos;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.multiplayer.ChunkProviderClient;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@ -119,6 +121,24 @@ public class ExampleBaritoneControl extends Behavior implements Helper {
|
||||
event.cancel();
|
||||
return;
|
||||
}
|
||||
if (msg.equals("repack") || msg.equals("rescan")) {
|
||||
ChunkProviderClient cli = world().getChunkProvider();
|
||||
int playerChunkX = playerFeet().getX() >> 4;
|
||||
int playerChunkZ = playerFeet().getZ() >> 4;
|
||||
int count = 0;
|
||||
for (int x = playerChunkX - 40; x <= playerChunkX + 40; x++) {
|
||||
for (int z = playerChunkZ - 40; z <= playerChunkZ + 40; z++) {
|
||||
Chunk chunk = cli.getLoadedChunk(x, z);
|
||||
if (chunk != null) {
|
||||
count++;
|
||||
WorldProvider.INSTANCE.getCurrentWorld().cache.queueForPacking(chunk);
|
||||
}
|
||||
}
|
||||
}
|
||||
logDirect("Queued " + count + " chunks for repacking");
|
||||
event.cancel();
|
||||
return;
|
||||
}
|
||||
if (msg.equals("axis")) {
|
||||
PathingBehavior.INSTANCE.setGoal(new GoalAxis());
|
||||
PathingBehavior.INSTANCE.path();
|
||||
|
Loading…
Reference in New Issue
Block a user