Restore broken lighting logic from spigot

This commit is contained in:
Shane Freeder 2017-12-18 07:35:42 +00:00
parent 099911fbd1
commit 0f97922ebd
No known key found for this signature in database
GPG key ID: A3F61EA5A085289C
15 changed files with 34 additions and 136 deletions

View file

@ -1,4 +1,4 @@
From 8f3d98f7e8848fd6f31d7443b7bb6e59aec262f9 Mon Sep 17 00:00:00 2001
From 018be33ecc0265cd220f7eee9f80977a91f0dfe3 Mon Sep 17 00:00:00 2001
From: Minecrell <minecrell@minecrell.net>
Date: Tue, 10 Oct 2017 18:45:20 +0200
Subject: [PATCH] Expose client protocol version and virtual host
@ -136,5 +136,5 @@ index 00bf55f4b..eeab46333 100644
public double getEyeHeight() {
return getEyeHeight(false);
--
2.15.0
2.15.1

View file

@ -1,64 +0,0 @@
From ef411dffd985f22ec2d489a9af4354b2442d5e04 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Wed, 4 Oct 2017 04:19:51 +0100
Subject: [PATCH] Revert "Allow Disabling of Random Lighting Updates"
This patch by Spigot allows the disabling of chunks to be lit as they're ticked by server
operators, the side effects of this is that there will potentially be chunks which are unlit
with an invalid skymaps, this could have potential implications on plugins which care about
this for checking the highest block in a region, as well as serves to just cause issues with
invalid lighting in chunks which isn't accurately fixed.
There is inherently nothing random about these light updates, they're there to ensure that
the worlds lightmap is properly updated and disabling them only serves to cause sporadic
lighting issues in the world.
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index ed5959559..d6e6f4d3e 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -1110,7 +1110,7 @@ public class Chunk {
}
this.r = true;
- if (!this.lit && this.done && this.world.spigotConfig.randomLightUpdates) { // Spigot - also use random light updates setting to determine if we should relight
+ if (!this.lit && this.done) {
this.o();
}
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index c03be509f..4318fe871 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -449,7 +449,7 @@ public class WorldServer extends World implements IAsyncTaskHandler {
protected void i() {
this.methodProfiler.a("playerCheckLight");
- if (spigotConfig.randomLightUpdates && !this.players.isEmpty()) { // Spigot
+ if (!this.players.isEmpty()) {
int i = this.random.nextInt(this.players.size());
EntityHuman entityhuman = (EntityHuman) this.players.get(i);
int j = MathHelper.floor(entityhuman.locX) + this.random.nextInt(11) - 5;
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
index 0b66f5e35..5234be42d 100644
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -182,14 +182,7 @@ public class SpigotWorldConfig
hopperAmount = getInt( "hopper-amount", 1 );
log( "Hopper Transfer: " + hopperTransfer + " Hopper Check: " + hopperCheck + " Hopper Amount: " + hopperAmount );
}
-
- public boolean randomLightUpdates;
- private void lightUpdates()
- {
- randomLightUpdates = getBoolean( "random-light-updates", false );
- log( "Random Lighting Updates: " + randomLightUpdates );
- }
-
+
public boolean saveStructureInfo;
private void structureInfo()
{
--
2.14.2

View file

@ -1,4 +1,4 @@
From 721eff99f0e560a9ce738bdd80183a7ca74d75fe Mon Sep 17 00:00:00 2001
From b9e5686a9c938851a0a3b41e34f0558890d6623a Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Sun, 15 Oct 2017 00:29:07 +0100
Subject: [PATCH] Increase time allowed for a keepalive reply
@ -10,7 +10,7 @@ tempermental due to lag spikes on the network thread, e.g. that caused
by plugins that are interacting with netty.
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index 26fbb30f9..71fae9450 100644
index a92bf8967..5a620f3fd 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -179,18 +179,25 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
@ -50,5 +50,5 @@ index 26fbb30f9..71fae9450 100644
this.minecraftServer.methodProfiler.b();
// CraftBukkit start
--
2.14.2
2.15.1

View file

@ -1,38 +0,0 @@
From 53b4f29fa7c90a534b8eed0c7e5819d81eaae968 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Wed, 4 Oct 2017 04:20:21 +0100
Subject: [PATCH] Revert "Fix some chunks not being sent to the client"
This patch actually allows chunks to be sent before lighting has been calculated in a chunk,
causing lighting to be invalid on chunks sent to clients. as lighting is done during chunk
population and the server tracks which chunks have been sent to the client, this is no longer
an issue.
as the server tracks what chunks have and haven't been sent to the client (and the original
issue for this appears to have already been fixed in the server in 1.9), there is nothing
that this patch is actually achieving as of now.
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index d6e6f4d3e..faa52c933 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -1128,15 +1128,7 @@ public class Chunk {
}
public boolean isReady() {
- // Spigot Start
- /*
- * As of 1.7, Mojang added a check to make sure that only chunks which have been lit are sent to the client.
- * Unfortunately this interferes with our modified chunk ticking algorithm, which will only tick chunks distant from the player on a very infrequent basis.
- * We cannot unfortunately do this lighting stage during chunk gen as it appears to put a lot more noticeable load on the server, than when it is done at play time.
- * For now at least we will simply send all chunks, in accordance with pre 1.7 behaviour.
- */
- return true;
- // Spigot End
+ return this.r && this.done && this.lit;
}
public boolean j() {
--
2.14.2

View file

@ -1,4 +1,4 @@
From a51fb3acd6b6d9b369d33f7802d2723145ec3e0b Mon Sep 17 00:00:00 2001
From e6a019e74db5ec209cd364852d223346187edb6c Mon Sep 17 00:00:00 2001
From: Brokkonaut <hannos17@gmx.de>
Date: Fri, 20 Oct 2017 04:33:45 +0200
Subject: [PATCH] Replace HashSet with fastutil's ObjectOpenHashSet in
@ -13,7 +13,7 @@ ObjectOpenHashSet never uses compareTo(), so the inconsistencies of NextTickList
Fixes https://github.com/PaperMC/Paper/issues/588
diff --git a/src/main/java/org/bukkit/craftbukkit/util/HashTreeSet.java b/src/main/java/org/bukkit/craftbukkit/util/HashTreeSet.java
index 80a5c29..cd864c4 100644
index 80a5c29f3..cd864c404 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/HashTreeSet.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/HashTreeSet.java
@@ -8,7 +8,7 @@ import java.util.TreeSet;
@ -26,5 +26,5 @@ index 80a5c29..cd864c4 100644
public HashTreeSet() {
--
2.7.3.windows.1
2.15.1

View file

@ -1,4 +1,4 @@
From b66a485b02cd5803468f2f111628f8c033a6d130 Mon Sep 17 00:00:00 2001
From c466a781bb64fb94c37aa33bfeaebc2c55147c0c Mon Sep 17 00:00:00 2001
From: Brokkonaut <hannos17@gmx.de>
Date: Tue, 31 Oct 2017 03:26:18 +0100
Subject: [PATCH] Send attack SoundEffects only to players who can see the
@ -6,7 +6,7 @@ Subject: [PATCH] Send attack SoundEffects only to players who can see the
diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java
index 00fe92f..e983831 100644
index 579996d1e..347237055 100644
--- a/src/main/java/net/minecraft/server/EntityHuman.java
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
@@ -939,6 +939,15 @@ public abstract class EntityHuman extends EntityLiving {
@ -72,7 +72,7 @@ index 00fe92f..e983831 100644
entity.extinguish();
}
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index e193f86..9aec59d 100644
index a706f510d..8d28d7e19 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -1061,6 +1061,12 @@ public abstract class World implements IBlockAccess {
@ -89,5 +89,5 @@ index e193f86..9aec59d 100644
for (int i = 0; i < this.u.size(); ++i) {
((IWorldAccess) this.u.get(i)).a(entityhuman, soundeffect, soundcategory, d0, d1, d2, f, f1);
--
2.7.3.windows.1
2.15.1

View file

@ -1,4 +1,4 @@
From 0fd5ff2f5fdbbb4cc02543e5439004e2e049aafd Mon Sep 17 00:00:00 2001
From 286794e0f29870df173aa440b08270dc86a6a513 Mon Sep 17 00:00:00 2001
From: BillyGalbreath <Blake.Galbreath@GMail.com>
Date: Fri, 10 Nov 2017 23:03:12 -0500
Subject: [PATCH] Option for maximum exp value when merging orbs

View file

@ -1,11 +1,11 @@
From fb607ad9851b223ee5585c4e0e873ea33d80a8c7 Mon Sep 17 00:00:00 2001
From b9aa0b63a024e7d87e80b16dd5f2cf008d9eee84 Mon Sep 17 00:00:00 2001
From: pkt77 <parkerkt77@gmail.com>
Date: Fri, 10 Nov 2017 23:46:34 -0500
Subject: [PATCH] Add PlayerArmorChangeEvent
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index 135a9c0e..559aebf2 100644
index 135a9c0e2..559aebf20 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -1,5 +1,6 @@
@ -30,7 +30,7 @@ index 135a9c0e..559aebf2 100644
if (!itemstack.isEmpty()) {
this.getAttributeMap().a(itemstack.a(enumitemslot));
diff --git a/src/main/java/net/minecraft/server/EnumItemSlot.java b/src/main/java/net/minecraft/server/EnumItemSlot.java
index cdf3a3ba..be5d0bf8 100644
index cdf3a3ba4..be5d0bf89 100644
--- a/src/main/java/net/minecraft/server/EnumItemSlot.java
+++ b/src/main/java/net/minecraft/server/EnumItemSlot.java
@@ -16,6 +16,7 @@ public enum EnumItemSlot {
@ -42,5 +42,5 @@ index cdf3a3ba..be5d0bf8 100644
return this.g;
}
--
2.14.2
2.15.1

View file

@ -1,4 +1,4 @@
From 7bdcb1b74acf4d7b9e27f11693273b0043b02903 Mon Sep 17 00:00:00 2001
From c9d649159395d4d366f0a5191c4e89b7108df605 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sat, 11 Nov 2017 17:57:39 -0500
Subject: [PATCH] Improve Structures Checking
@ -195,5 +195,5 @@ index b6abc74e0..f9bb953d0 100644
}
--
2.15.0
2.15.1

View file

@ -1,4 +1,4 @@
From f2bbc719f2f539d22ba2bfc991578d5263d834ae Mon Sep 17 00:00:00 2001
From 84a34b3a750a6d79f040b84fe77cf771c5f2e309 Mon Sep 17 00:00:00 2001
From: killme <killme-git@ibts.me>
Date: Sun, 12 Nov 2017 19:40:01 +0100
Subject: [PATCH] Prevent logins from being processed when the player has
@ -6,7 +6,7 @@ Subject: [PATCH] Prevent logins from being processed when the player has
diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java
index 75df928..eaac25d 100644
index 75df92836..eaac25dc3 100644
--- a/src/main/java/net/minecraft/server/LoginListener.java
+++ b/src/main/java/net/minecraft/server/LoginListener.java
@@ -60,7 +60,11 @@ public class LoginListener implements PacketLoginInListener, ITickable {
@ -23,5 +23,5 @@ index 75df928..eaac25d 100644
EntityPlayer entityplayer = this.server.getPlayerList().a(this.i.getId());
--
2.7.4
2.15.1

View file

@ -1,4 +1,4 @@
From e69d91eb673b19c50595896430b158450077429e Mon Sep 17 00:00:00 2001
From fea7bc7f32f83560dc3a5494a236b95e07f72ed5 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Thu, 16 Nov 2017 12:12:41 +0000
Subject: [PATCH] use CB BlockState implementations for captured blocks
@ -18,7 +18,7 @@ the blockstate that will be valid for restoration, as opposed to dropping
information on restoration when the event is cancelled.
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index f9c5da59f..072b1201f 100644
index ad55631cf..eb8a1c43c 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -393,7 +393,8 @@ public abstract class World implements IBlockAccess {
@ -32,5 +32,5 @@ index f9c5da59f..072b1201f 100644
}
// CraftBukkit end
--
2.15.0
2.15.1

View file

@ -1,4 +1,4 @@
From 78737392a6747edad926f8a1320536955124c5bc Mon Sep 17 00:00:00 2001
From 142def44e39cbda0769d919228faa92376b3add2 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 6 Nov 2017 21:08:22 -0500
Subject: [PATCH] API to get a BlockState without a snapshot
@ -101,5 +101,5 @@ index 22dcaea72..3b5a90c39 100644
// copy tile entity data:
this.snapshot = this.createSnapshot(tileEntity);
--
2.15.0
2.15.1

View file

@ -1,4 +1,4 @@
From b0456f32941d38b616e2e3f3f37583cb7a5713ef Mon Sep 17 00:00:00 2001
From 9d7d7c604f70abfe98b0f08b04305ddcb28b415f Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Sat, 25 Nov 2017 17:02:33 +0000
Subject: [PATCH] Do not use a snapshot for hoppers
@ -63,5 +63,5 @@ index 8ad081316..ebbe5d326 100644
if (event.isCancelled()) {
iinventory.setItem(i, itemstack1);
--
2.15.0
2.15.1

View file

@ -1,4 +1,4 @@
From b2e3579ec648950cc3b9f373b19e02cbfd4dc0d0 Mon Sep 17 00:00:00 2001
From e7430c9e25f8ac7b7af64a674489b50a5438c194 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sun, 26 Nov 2017 13:19:58 -0500
Subject: [PATCH] AsyncTabCompleteEvent
@ -80,7 +80,7 @@ index 5a620f3fd..ead0994f8 100644
public void a(PacketPlayInSettings packetplayinsettings) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index aa098172f..09eb79439 100644
index 7370eae9f..7d3a04cb3 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1640,8 +1640,8 @@ public final class CraftServer implements Server {
@ -139,5 +139,5 @@ index 1e3aae3b8..95d13c146 100644
Waitable<List<String>> waitable = new Waitable<List<String>>() {
@Override
--
2.15.0
2.15.1

View file

@ -1,4 +1,4 @@
From ce308088af5d39170b19f7781e3b4c952e015b4b Mon Sep 17 00:00:00 2001
From 80c9f067330c184f3d1c61ae86a06f6418fe5383 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 29 Nov 2017 22:18:54 -0500
Subject: [PATCH] Avoid NPE in PathfinderGoalTempt
@ -18,5 +18,5 @@ index 188825d19..8004f3a3f 100644
}
}
--
2.15.0
2.15.1