From 83b1be89442d7ee7a3e83c9a882480b39048be62 Mon Sep 17 00:00:00 2001 From: boy0001 Date: Fri, 21 Aug 2015 19:24:20 +1000 Subject: [PATCH] revert this --- .../com/intellectualcrafters/plot/PS.java | 2 -- .../plot/config/Settings.java | 1 - .../bukkit/listeners/ChunkListener.java | 21 ------------------- 3 files changed, 24 deletions(-) diff --git a/src/main/java/com/intellectualcrafters/plot/PS.java b/src/main/java/com/intellectualcrafters/plot/PS.java index fcbf25add..6a4d0ca11 100644 --- a/src/main/java/com/intellectualcrafters/plot/PS.java +++ b/src/main/java/com/intellectualcrafters/plot/PS.java @@ -1838,7 +1838,6 @@ public class PS { // Chunk processor options.put("chunk-processor.enabled", Settings.CHUNK_PROCESSOR); - options.put("chunk-processor.random-chunk-unloads", Settings.CHUNK_PROCESSOR_RANDOM_CHUNK_UNLOADS); options.put("chunk-processor.max-blockstates", Settings.CHUNK_PROCESSOR_MAX_BLOCKSTATES); options.put("chunk-processor.max-entities", Settings.CHUNK_PROCESSOR_MAX_ENTITIES); options.put("chunk-processor.disable-physics", Settings.CHUNK_PROCESSOR_DISABLE_PHYSICS); @@ -1952,7 +1951,6 @@ public class PS { // Chunk processor Settings.CHUNK_PROCESSOR = config.getBoolean("chunk-processor.enabled"); - Settings.CHUNK_PROCESSOR_RANDOM_CHUNK_UNLOADS = config.getInt("chunk-processor.random-chunk-unloads"); Settings.CHUNK_PROCESSOR_MAX_BLOCKSTATES = config.getInt("chunk-processor.max-blockstates"); Settings.CHUNK_PROCESSOR_MAX_ENTITIES = config.getInt("chunk-processor.max-entities"); Settings.CHUNK_PROCESSOR_DISABLE_PHYSICS = config.getBoolean("chunk-processor.disable-physics"); diff --git a/src/main/java/com/intellectualcrafters/plot/config/Settings.java b/src/main/java/com/intellectualcrafters/plot/config/Settings.java index f42c37a9c..7ba3a18fe 100644 --- a/src/main/java/com/intellectualcrafters/plot/config/Settings.java +++ b/src/main/java/com/intellectualcrafters/plot/config/Settings.java @@ -69,7 +69,6 @@ public class Settings { */ public static boolean CHUNK_PROCESSOR = false; public static int CHUNK_PROCESSOR_MAX_BLOCKSTATES = 4096; - public static int CHUNK_PROCESSOR_RANDOM_CHUNK_UNLOADS = 1; public static int CHUNK_PROCESSOR_MAX_ENTITIES = 512; public static boolean CHUNK_PROCESSOR_DISABLE_PHYSICS = false; /** diff --git a/src/main/java/com/plotsquared/bukkit/listeners/ChunkListener.java b/src/main/java/com/plotsquared/bukkit/listeners/ChunkListener.java index 73016a808..1af4c639e 100644 --- a/src/main/java/com/plotsquared/bukkit/listeners/ChunkListener.java +++ b/src/main/java/com/plotsquared/bukkit/listeners/ChunkListener.java @@ -30,27 +30,6 @@ public class ChunkListener implements Listener { private long last = 0; private int count = 0; - public ChunkListener() { - final PseudoRandom r = new PseudoRandom(); - r.state = System.currentTimeMillis(); - if (Settings.CHUNK_PROCESSOR_RANDOM_CHUNK_UNLOADS > 0) { - TaskManager.runTaskRepeat(new Runnable() { - @Override - public void run() { - for (World world : Bukkit.getWorlds()) { - if (!PS.get().isPlotWorld(world.getName())) { - continue; - } - Chunk[] chunks = world.getLoadedChunks(); - for (int i = 0; i < Math.min(chunks.length, Settings.CHUNK_PROCESSOR_RANDOM_CHUNK_UNLOADS); i++) { - chunks[r.random(chunks.length)].unload(true, true); - } - } - } - }, 1); - } - } - @EventHandler public void onChunkUnload(ChunkUnloadEvent event) { if (processChunk(event.getChunk(), true)) {