geforkt von Mirrors/Paper
Make the recheckGaps method async like other lighting updates
Dieser Commit ist enthalten in:
Ursprung
6cbf685402
Commit
6bcae0c948
@ -37,6 +37,39 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.q = true;
|
this.q = true;
|
||||||
|
@@ -0,0 +0,0 @@ public class Chunk {
|
||||||
|
|
||||||
|
public void b(boolean flag) {
|
||||||
|
if (this.k && !this.world.worldProvider.o() && !flag) {
|
||||||
|
- this.h(this.world.isClientSide);
|
||||||
|
+ this.recheckGaps(this.world.isClientSide); // PaperSpigot - Asynchronous lighting updates
|
||||||
|
}
|
||||||
|
|
||||||
|
this.p = true;
|
||||||
|
@@ -0,0 +0,0 @@ public class Chunk {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
+ /**
|
||||||
|
+ * PaperSpigot - Recheck gaps asynchronously.
|
||||||
|
+ */
|
||||||
|
+ public void recheckGaps(final boolean isClientSide) {
|
||||||
|
+ if (!world.paperSpigotConfig.useAsyncLighting) {
|
||||||
|
+ this.h(isClientSide);
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ world.lightingExecutor.submit(new Runnable() {
|
||||||
|
+ @Override
|
||||||
|
+ public void run() {
|
||||||
|
+ Chunk.this.h(isClientSide);
|
||||||
|
+ }
|
||||||
|
+ });
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
public boolean isReady() {
|
||||||
|
// Spigot Start
|
||||||
|
/*
|
||||||
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
||||||
@ -75,7 +108,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
public static boolean haveWeSilencedAPhysicsCrash;
|
public static boolean haveWeSilencedAPhysicsCrash;
|
||||||
public static String blockLocation;
|
public static String blockLocation;
|
||||||
private int tileTickPosition;
|
private int tileTickPosition;
|
||||||
+ private ExecutorService lightingExecutor; // PaperSpigot - Asynchronous lighting updates
|
+ public ExecutorService lightingExecutor; // PaperSpigot - Asynchronous lighting updates
|
||||||
|
|
||||||
public static long chunkToKey(int x, int z)
|
public static long chunkToKey(int x, int z)
|
||||||
{
|
{
|
||||||
@ -170,6 +203,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
|
+ if (!Bukkit.isPrimaryThread()) {
|
||||||
|
+ return this.c(enumskyblock, position, chunk, neighbors);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
+ lightingExecutor.submit(new Runnable() {
|
+ lightingExecutor.submit(new Runnable() {
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public void run() {
|
+ public void run() {
|
||||||
@ -198,6 +235,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ log( "World async lighting: " + useAsyncLighting );
|
+ log( "World async lighting: " + useAsyncLighting );
|
||||||
+ }
|
+ }
|
||||||
}
|
}
|
||||||
--
|
--
|
||||||
1.9.5.msysgit.1
|
|
||||||
|
|
@ -128,7 +128,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess {
|
@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess {
|
||||||
public static String blockLocation;
|
public static String blockLocation;
|
||||||
private int tileTickPosition;
|
private int tileTickPosition;
|
||||||
private ExecutorService lightingExecutor; // PaperSpigot - Asynchronous lighting updates
|
public ExecutorService lightingExecutor; // PaperSpigot - Asynchronous lighting updates
|
||||||
+ public final Map<Explosion.CacheKey, Float> explosionDensityCache = new HashMap<Explosion.CacheKey, Float>(); // PaperSpigot - Optimize explosions
|
+ public final Map<Explosion.CacheKey, Float> explosionDensityCache = new HashMap<Explosion.CacheKey, Float>(); // PaperSpigot - Optimize explosions
|
||||||
|
|
||||||
public static long chunkToKey(int x, int z)
|
public static long chunkToKey(int x, int z)
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren