client
client copied to clipboard
Avoid - Prevent going into unloaded chunks
This is useful for elytraflight (#616) and afk travelling. Iirc baritone has this built in and as it's LGPL you can use that as reference for how it works.
@EventHandler
public Listener<ChunkEvent> listener = new Listener<>(event -> {
if (event.getPacket().isFullChunk()) {
chunks.add(event.getChunk());
dirty = true;
if (saveNewChunks.getValue()) {
saveNewChunk(event.getChunk());
}
}
});