From 4b41c6b1d702470d7584d958d712a09cf6e110c3 Mon Sep 17 00:00:00 2001 From: Brady Date: Wed, 29 Aug 2018 18:32:16 -0500 Subject: [PATCH] Replace anonymous thread creation with runnable constructor --- src/main/java/baritone/chunk/CachedWorld.java | 26 +++++++++---------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/src/main/java/baritone/chunk/CachedWorld.java b/src/main/java/baritone/chunk/CachedWorld.java index f3e1ca1f..56d8ef38 100644 --- a/src/main/java/baritone/chunk/CachedWorld.java +++ b/src/main/java/baritone/chunk/CachedWorld.java @@ -67,22 +67,20 @@ public final class CachedWorld implements IBlockTypeAccess { // Insert an invalid region element cachedRegions.put(0, null); new PackerThread().start(); - new Thread() { - public void run() { - try { - Thread.sleep(30000); - while (true) { - // since a region only saves if it's been modified since its last save - // saving every 10 minutes means that once it's time to exit - // we'll only have a couple regions to save - save(); - Thread.sleep(600000); - } - } catch (InterruptedException e) { - e.printStackTrace(); + new Thread(() -> { + try { + Thread.sleep(30000); + while (true) { + // since a region only saves if it's been modified since its last save + // saving every 10 minutes means that once it's time to exit + // we'll only have a couple regions to save + save(); + Thread.sleep(600000); } + } catch (InterruptedException e) { + e.printStackTrace(); } - }.start(); + }).start(); } public final void queueForPacking(Chunk chunk) {