Temporarily remove the better water lighting updates patch while we ensure there are no performance or implementation issues

Specifically around non-water fluids
This commit is contained in:
Zach Brown 2014-07-30 02:44:36 -05:00
parent 651c32a5f7
commit 3e2fa68fe6

View file

@ -1,105 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Iceee <andrew@opticgaming.tv>
Date: Wed, 23 Jul 2014 09:42:45 -0500
Subject: [PATCH] Better water lighting updates
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -0,0 +0,0 @@ public class Chunk {
private int x;
protected net.minecraft.util.gnu.trove.map.hash.TObjectIntHashMap<Class> entityCount = new net.minecraft.util.gnu.trove.map.hash.TObjectIntHashMap<Class>(); // Spigot
+ // PaperSpigot start
+ private boolean waterLightingChanged;
+ private boolean[] waterChanges;
+ private int ticks;
+ // PaperSpigot end
+
// CraftBukkit start - Neighbor loaded cache for chunk lighting and entity ticking
private int neighbors = 0x1 << 12;
@@ -0,0 +0,0 @@ public class Chunk {
this.v = new byte[256];
this.b = new int[256];
this.c = new boolean[256];
+ // PaperSpigot start
+ this.waterChanges = new boolean[256];
+ // PaperSpigot end
this.tileEntities = new HashMap();
this.x = 4096;
this.entitySlices = new List[16];
@@ -0,0 +0,0 @@ public class Chunk {
this.n = true;
}
+ // PaperSpigot start
+ private void scheduleWaterLightingUpdate(int i, int j) {
+ this.waterChanges[i + j * 16] = true;
+ this.waterLightingChanged = true;
+ }
+
+ // PaperSpigot end
+
private void e(int i, int j) {
this.c[i + j * 16] = true;
this.w = true;
@@ -0,0 +0,0 @@ public class Chunk {
if (this.world.areChunksLoaded(this.locX * 16 + 8, 0, this.locZ * 16 + 8, 16)) {
for (int i = 0; i < 16; ++i) {
for (int j = 0; j < 16; ++j) {
- if (this.c[i + j * 16]) {
+ // PaperSpigot start
+ if (this.c[i + j * 16] || this.waterChanges[i + j * 16]) {
this.c[i + j * 16] = false;
+ this.waterChanges[i + j * 16] = false;
+ // PaperSpigot end
int k = this.b(i, j);
int l = this.locX * 16 + i;
int i1 = this.locZ * 16 + j;
@@ -0,0 +0,0 @@ public class Chunk {
}
this.w = false;
+ // PaperSpigot start
+ this.waterLightingChanged = false;
+ // PaperSpigot end
}
this.world.methodProfiler.b();
@@ -0,0 +0,0 @@ public class Chunk {
}
if (j2 != k2 && (j2 < k2 || this.getBrightness(EnumSkyBlock.SKY, i, j, k) > 0 || this.getBrightness(EnumSkyBlock.BLOCK, i, j, k) > 0)) {
- this.e(i, k);
+ // PaperSpigot start
+ if(block.material == Material.WATER || block1.material == Material.WATER) {
+ this.scheduleWaterLightingUpdate(i, k);
+ } else {
+ this.e(i, k);
+ }
+ // PaperSpigot end
}
}
@@ -0,0 +0,0 @@ public class Chunk {
}
public void b(boolean flag) {
- if (this.w && !this.world.worldProvider.g && !flag) {
+ // PaperSpigot start
+ ++ticks;
+ if(ticks % 20 == 0 && this.waterLightingChanged) {
+ this.c(this.world.isStatic);
+ } else if (this.w && !this.world.worldProvider.g && !flag) {
this.c(this.world.isStatic);
}
+ // PaperSpigot end
this.m = true;
if (!this.lit && this.done && this.world.spigotConfig.randomLightUpdates) { // Spigot - also use random light updates setting to determine if we should relight
--
1.9.4.msysgit.0