mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-29 13:05:41 +01:00
revert this
This commit is contained in:
parent
2185384746
commit
83b1be8944
@ -1838,7 +1838,6 @@ public class PS {
|
|||||||
|
|
||||||
// Chunk processor
|
// Chunk processor
|
||||||
options.put("chunk-processor.enabled", Settings.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-blockstates", Settings.CHUNK_PROCESSOR_MAX_BLOCKSTATES);
|
||||||
options.put("chunk-processor.max-entities", Settings.CHUNK_PROCESSOR_MAX_ENTITIES);
|
options.put("chunk-processor.max-entities", Settings.CHUNK_PROCESSOR_MAX_ENTITIES);
|
||||||
options.put("chunk-processor.disable-physics", Settings.CHUNK_PROCESSOR_DISABLE_PHYSICS);
|
options.put("chunk-processor.disable-physics", Settings.CHUNK_PROCESSOR_DISABLE_PHYSICS);
|
||||||
@ -1952,7 +1951,6 @@ public class PS {
|
|||||||
|
|
||||||
// Chunk processor
|
// Chunk processor
|
||||||
Settings.CHUNK_PROCESSOR = config.getBoolean("chunk-processor.enabled");
|
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_BLOCKSTATES = config.getInt("chunk-processor.max-blockstates");
|
||||||
Settings.CHUNK_PROCESSOR_MAX_ENTITIES = config.getInt("chunk-processor.max-entities");
|
Settings.CHUNK_PROCESSOR_MAX_ENTITIES = config.getInt("chunk-processor.max-entities");
|
||||||
Settings.CHUNK_PROCESSOR_DISABLE_PHYSICS = config.getBoolean("chunk-processor.disable-physics");
|
Settings.CHUNK_PROCESSOR_DISABLE_PHYSICS = config.getBoolean("chunk-processor.disable-physics");
|
||||||
|
@ -69,7 +69,6 @@ public class Settings {
|
|||||||
*/
|
*/
|
||||||
public static boolean CHUNK_PROCESSOR = false;
|
public static boolean CHUNK_PROCESSOR = false;
|
||||||
public static int CHUNK_PROCESSOR_MAX_BLOCKSTATES = 4096;
|
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 int CHUNK_PROCESSOR_MAX_ENTITIES = 512;
|
||||||
public static boolean CHUNK_PROCESSOR_DISABLE_PHYSICS = false;
|
public static boolean CHUNK_PROCESSOR_DISABLE_PHYSICS = false;
|
||||||
/**
|
/**
|
||||||
|
@ -30,27 +30,6 @@ public class ChunkListener implements Listener {
|
|||||||
private long last = 0;
|
private long last = 0;
|
||||||
private int count = 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
|
@EventHandler
|
||||||
public void onChunkUnload(ChunkUnloadEvent event) {
|
public void onChunkUnload(ChunkUnloadEvent event) {
|
||||||
if (processChunk(event.getChunk(), true)) {
|
if (processChunk(event.getChunk(), true)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user