Add Lighting Queue

The lighting queue spreads out the processing of light updates across
multiple ticks based on how much free time the server has left at the end
of the tick.
This commit is contained in:
Byteflux
2016-03-24 23:38:38 -07:00
parent fc2341a996
commit dd60ba4869
7 changed files with 260 additions and 263 deletions

View File

@@ -139,19 +139,19 @@ diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/m
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -0,0 +0,0 @@ import org.bukkit.generator.ChunkGenerator;
// Paper start
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
+import java.util.HashMap;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
// Paper end
@@ -0,0 +0,0 @@ import java.util.concurrent.Callable;
// CraftBukkit start
import com.google.common.collect.Maps;
+import java.util.HashMap; // Paper
import java.util.Map;
import org.bukkit.Bukkit;
import org.bukkit.block.BlockState;
@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess {
private org.spigotmc.TickLimiter entityLimiter;
private org.spigotmc.TickLimiter tileLimiter;
private int tileTickPosition;
public ExecutorService lightingExecutor = Executors.newSingleThreadExecutor(new ThreadFactoryBuilder().setNameFormat("Paper - Lighting Thread").build()); // Paper - Asynchronous lighting updates
+ public final Map<Explosion.CacheKey, Float> explosionDensityCache = new HashMap<Explosion.CacheKey, Float>(); // Paper - Optimize explosions
+ public final Map<Explosion.CacheKey, Float> explosionDensityCache = new HashMap<>(); // Paper - Optimize explosions
public CraftWorld getWorld() {
return this.world;