(Path directory, DimensionType dimension)
| 75 | private final DimensionType dimension; |
| 76 | |
| 77 | CachedWorld(Path directory, DimensionType dimension) { |
| 78 | if (!Files.exists(directory)) { |
| 79 | try { |
| 80 | Files.createDirectories(directory); |
| 81 | } catch (IOException ignored) { |
| 82 | } |
| 83 | } |
| 84 | this.directory = directory.toString(); |
| 85 | this.dimension = dimension; |
| 86 | System.out.println("Cached world directory: " + directory); |
| 87 | Baritone.getExecutor().execute(new PackerThread()); |
| 88 | Baritone.getExecutor().execute(() -> { |
| 89 | try { |
| 90 | Thread.sleep(30000); |
| 91 | while (true) { |
| 92 | // since a region only saves if it's been modified since its last save |
| 93 | // saving every 10 minutes means that once it's time to exit |
| 94 | // we'll only have a couple regions to save |
| 95 | save(); |
| 96 | Thread.sleep(600000); |
| 97 | } |
| 98 | } catch (InterruptedException e) { |
| 99 | e.printStackTrace(); |
| 100 | } |
| 101 | }); |
| 102 | } |
| 103 | |
| 104 | @Override |
| 105 | public final void queueForPacking(LevelChunk chunk) { |
nothing calls this directly
no test coverage detected