mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-03 09:19:38 +01:00
Lookup neighbor chunks more efficiently in async lighting
This commit is contained in:
parent
8de3946478
commit
536af803c4
@ -1,14 +1,14 @@
|
||||
From d2087b8499048bc411ed3d619cb73f344b8fc800 Mon Sep 17 00:00:00 2001
|
||||
From f2df5ed23fb9826e49d5e97060ca5c34bdb0a325 Mon Sep 17 00:00:00 2001
|
||||
From: Suddenly <suddenly@suddenly.coffee>
|
||||
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;
|
||||
|
||||
|
@ -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 <jedediah@silencegreys.com>
|
||||
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 {
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 8a61969c23ac2a0c49898281c8e0c3a9560b8ab1 Mon Sep 17 00:00:00 2001
|
||||
From d07732a069908d93da75d3a248da456f696dd8a8 Mon Sep 17 00:00:00 2001
|
||||
From: Byteflux <byte@byteflux.net>
|
||||
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<Chunk> neighbors = new ArrayList<Chunk>();
|
||||
+ 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);
|
||||
|
Loading…
Reference in New Issue
Block a user