From 536af803c43df0e53c9a183fc04c3b6094975799 Mon Sep 17 00:00:00 2001 From: Byteflux Date: Wed, 15 Jul 2015 02:01:49 -0700 Subject: [PATCH] Lookup neighbor chunks more efficiently in async lighting --- ...figurable-despawn-distances-for-living-entiti.patch | 6 +++--- .../0019-Player-affects-spawning-API.patch | 6 +++--- .../0041-Configurable-async-light-updates.patch | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Spigot-Server-Patches/0015-Add-configurable-despawn-distances-for-living-entiti.patch b/Spigot-Server-Patches/0015-Add-configurable-despawn-distances-for-living-entiti.patch index a5537cb..59dc06d 100644 --- a/Spigot-Server-Patches/0015-Add-configurable-despawn-distances-for-living-entiti.patch +++ b/Spigot-Server-Patches/0015-Add-configurable-despawn-distances-for-living-entiti.patch @@ -1,14 +1,14 @@ -From d2087b8499048bc411ed3d619cb73f344b8fc800 Mon Sep 17 00:00:00 2001 +From f2df5ed23fb9826e49d5e97060ca5c34bdb0a325 Mon Sep 17 00:00:00 2001 From: Suddenly Date: Sat, 7 Mar 2015 21:40:48 -0600 Subject: [PATCH] Add configurable despawn distances for living entities diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java -index 120e75b..fdca016 100644 +index e83d94f..783e43e 100644 --- a/src/main/java/net/minecraft/server/EntityInsentient.java +++ b/src/main/java/net/minecraft/server/EntityInsentient.java -@@ -438,13 +438,13 @@ public abstract class EntityInsentient extends EntityLiving { +@@ -439,13 +439,13 @@ public abstract class EntityInsentient extends EntityLiving { double d2 = entityhuman.locZ - this.locZ; double d3 = d0 * d0 + d1 * d1 + d2 * d2; diff --git a/Spigot-Server-Patches/0019-Player-affects-spawning-API.patch b/Spigot-Server-Patches/0019-Player-affects-spawning-API.patch index 13b69d1..028f6bc 100644 --- a/Spigot-Server-Patches/0019-Player-affects-spawning-API.patch +++ b/Spigot-Server-Patches/0019-Player-affects-spawning-API.patch @@ -1,4 +1,4 @@ -From a77ebbd5e6e27cd51a1062001b905cfc686b90a3 Mon Sep 17 00:00:00 2001 +From aa29950c7eec042e9b0f3c063129a9a5cee85037 Mon Sep 17 00:00:00 2001 From: Jedediah Smith Date: Mon, 18 May 2015 17:52:45 -0500 Subject: [PATCH] Player affects spawning API @@ -17,10 +17,10 @@ index 88e63f7..2a08976 100644 // CraftBukkit start public boolean fauxSleeping; diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java -index 657585b..c4dcad3 100644 +index 783e43e..c684bcd 100644 --- a/src/main/java/net/minecraft/server/EntityInsentient.java +++ b/src/main/java/net/minecraft/server/EntityInsentient.java -@@ -430,7 +430,7 @@ public abstract class EntityInsentient extends EntityLiving { +@@ -431,7 +431,7 @@ public abstract class EntityInsentient extends EntityLiving { if (this.persistent) { this.ticksFarFromPlayer = 0; } else { diff --git a/Spigot-Server-Patches/0041-Configurable-async-light-updates.patch b/Spigot-Server-Patches/0041-Configurable-async-light-updates.patch index 37871fe..c6b3f78 100644 --- a/Spigot-Server-Patches/0041-Configurable-async-light-updates.patch +++ b/Spigot-Server-Patches/0041-Configurable-async-light-updates.patch @@ -1,4 +1,4 @@ -From 8a61969c23ac2a0c49898281c8e0c3a9560b8ab1 Mon Sep 17 00:00:00 2001 +From d07732a069908d93da75d3a248da456f696dd8a8 Mon Sep 17 00:00:00 2001 From: Byteflux Date: Wed, 1 Jul 2015 00:18:10 -0700 Subject: [PATCH] Configurable async light updates @@ -55,7 +55,7 @@ index 975d666..ae0f276 100644 if (!this.world.c(i, j)) { // CraftBukkit start diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 915a02d..b66dd81 100644 +index 915a02d..e0a7161 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -18,6 +18,12 @@ import org.bukkit.generator.ChunkGenerator; @@ -159,9 +159,9 @@ index 915a02d..b66dd81 100644 + final List neighbors = new ArrayList(); + for (int cx = (x >> 4) - 1; cx <= (x >> 4) + 1; ++cx) { + for (int cz = (z >> 4) - 1; cz <= (z >> 4) + 1; ++cz) { -+ if (this.chunkProvider.isChunkLoaded(cx, cz)) { -+ Chunk neighbor = this.getChunkAt(cx, cz); -+ if (neighbor != chunk) { ++ if (cx != x >> 4 && cz != z >> 4) { ++ Chunk neighbor = this.getChunkIfLoaded(cx, cz); ++ if (neighbor != null) { + neighbor.pendingLightUpdates.incrementAndGet(); + neighbor.lightUpdateTime = chunk.world.getTime(); + neighbors.add(neighbor);