mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 15:49:00 +01:00
Improve Light Queue and force enable it for all
There is no reason for the light queue to even be an option. This enables the light queue for everyone. This also improves the "can we still tick" time logic to always check before running a light operation. previously, we always executed at least 10 on the first world (but not other worlds...), but we are seeing light take up some heavy time, so improving that for now. I've now also improved recheck gaps logic to happen at the end of all single block updates This also prevents multiple gap checks, as previously if a tick skipped the gaps check, the next tick would end up re-adding the entry again, resulting in multiple gap checks. This now just sets a marker "We need to recheck gaps" and will only occur once. This also should reduce chunk loads, as previously, we checked if the neighbor chunks were loaded for the gap check, however those neighbor chunks might of unloaded before the light queue operation actually ran. Now, the neighbor chunk is done when the gap check is being done, so it should avoid loading chunks. Fixes #1466 Fixes #1431
This commit is contained in:
parent
655668c630
commit
d12c81860a
18 changed files with 105 additions and 70 deletions
|
@ -6,7 +6,7 @@ Subject: [PATCH] Add World Util Methods
|
|||
Methods that can be used for other patches to help improve logic.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
||||
index 68f8459861..dcd122d8b5 100644
|
||||
index ab579b9052..b006282f38 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 implements IChunkAccess {
|
||||
|
|
|
@ -50,7 +50,7 @@ index 0000000000..93397188b7
|
|||
+}
|
||||
\ No newline at end of file
|
||||
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
||||
index d41cd7a6e9..68f8459861 100644
|
||||
index a04a296172..ab579b9052 100644
|
||||
--- a/src/main/java/net/minecraft/server/Chunk.java
|
||||
+++ b/src/main/java/net/minecraft/server/Chunk.java
|
||||
@@ -0,0 +0,0 @@
|
||||
|
@ -239,7 +239,7 @@ index e649d662ae..560edb523f 100644
|
|||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index fbcdf9ecaf..8aa8d40cb4 100644
|
||||
index 65e84b666f..19eb905979 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -0,0 +0,0 @@
|
||||
|
|
|
@ -9,7 +9,7 @@ This should hopefully avoid duplicate entities ever being created
|
|||
if the entity was to end up in 2 different chunk slices
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
||||
index 33ce24479..e8af8f419 100644
|
||||
index 66712db2a2..39cbde281b 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 implements IChunkAccess {
|
||||
|
@ -73,7 +73,7 @@ index 33ce24479..e8af8f419 100644
|
|||
// Do not pass along players, as doing so can get them stuck outside of time.
|
||||
// (which for example disables inventory icon updates and prevents block breaking)
|
||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||
index 9339b3255..f2eb479ad 100644
|
||||
index fdc9d96c27..8951ac8095 100644
|
||||
--- a/src/main/java/net/minecraft/server/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/server/Entity.java
|
||||
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
|
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Anti-Xray
|
|||
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
index 19f4c61cdc..3acb1ff9fd 100644
|
||||
index 5fddb11774..bafc43f83c 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
@@ -0,0 +0,0 @@
|
||||
|
@ -1049,7 +1049,7 @@ index 0000000000..37093419cf
|
|||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
||||
index 56c3783412..f3d9211baa 100644
|
||||
index 4a39461eb2..3a22e69d99 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 implements IChunkAccess {
|
||||
|
|
|
@ -32,7 +32,7 @@ index aa0e3c757d..c1845d6811 100644
|
|||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
index 547ab09627..78a3188274 100644
|
||||
index 8918bbf7da..015d7fcb5c 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
@@ -0,0 +0,0 @@ package com.destroystokyo.paper;
|
||||
|
@ -64,7 +64,7 @@ index 547ab09627..78a3188274 100644
|
|||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
||||
index 3c9c3cd41d..8d1264879b 100644
|
||||
index 7f1d0b39cf..5285bfb409 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 implements IChunkAccess {
|
||||
|
|
|
@ -10,7 +10,7 @@ to the object directly on the Entity/TileEntity object we can directly grab.
|
|||
Use that local value instead to reduce lookups in many hot places.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
||||
index 614fce4447..e806d13d22 100644
|
||||
index 9f2a08b03d..0dab65c870 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 implements IChunkAccess {
|
||||
|
|
|
@ -14,7 +14,7 @@ And since minecart hoppers are used _very_ rarely near we can avoid alot of sear
|
|||
Combined, this adds up a lot.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
||||
index d4bebddab..d41cd7a6e 100644
|
||||
index 703c377f93..a04a296172 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 implements IChunkAccess {
|
||||
|
|
|
@ -5,12 +5,12 @@ Subject: [PATCH] Configurable end credits
|
|||
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
index 4b36a0f053..53921b381e 100644
|
||||
index 9fd1bde0ef..29d5f30545 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
@@ -0,0 +0,0 @@ public class PaperWorldConfig {
|
||||
queueLightUpdates = getBoolean("queue-light-updates", false);
|
||||
log("Lighting Queue enabled: " + queueLightUpdates);
|
||||
//queueLightUpdates = getBoolean("queue-light-updates", false);
|
||||
//log("Lighting Queue enabled: " + queueLightUpdates);
|
||||
}
|
||||
+
|
||||
+ public boolean disableEndCredits;
|
||||
|
@ -20,7 +20,7 @@ index 4b36a0f053..53921b381e 100644
|
|||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
index 3112ee5453..9f23c0d2c2 100644
|
||||
index 09e2859c4a..95ab3d2cda 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
@@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
|
|
|
@ -17,7 +17,7 @@ This allows servers with smaller worlds who do less long distance exploring to s
|
|||
wasting cpu cycles on saving/unloading/reloading chunks repeatedly.
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
index f8102d9f0..547ab0962 100644
|
||||
index ab2568ffcb..8918bbf7da 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
@@ -0,0 +0,0 @@ public class PaperWorldConfig {
|
||||
|
@ -40,7 +40,7 @@ index f8102d9f0..547ab0962 100644
|
|||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
||||
index 5390396d5..3c9c3cd41 100644
|
||||
index 7e1a90d904..7f1d0b39cf 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 implements IChunkAccess {
|
||||
|
@ -50,9 +50,9 @@ index 5390396d5..3c9c3cd41 100644
|
|||
+ public Long scheduledForUnload; // Paper - delay chunk unloads
|
||||
public final int locX;
|
||||
public final int locZ;
|
||||
private boolean l;
|
||||
private boolean l; public boolean needsGapCheck() { return l; } // Paper - OBFHELPER
|
||||
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
||||
index b1e690109..9739288b5 100644
|
||||
index b1e6901090..9739288b53 100644
|
||||
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
||||
@@ -0,0 +0,0 @@ public class ChunkProviderServer implements IChunkProvider {
|
||||
|
@ -76,7 +76,7 @@ index b1e690109..9739288b5 100644
|
|||
this.chunkScheduler.a(booleansupplier);
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java
|
||||
index ac0e90eec..3f4a8f21c 100644
|
||||
index ac0e90eeca..3f4a8f21c0 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerChunk.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerChunk.java
|
||||
@@ -0,0 +0,0 @@ public class PlayerChunk {
|
||||
|
@ -113,7 +113,7 @@ index ac0e90eec..3f4a8f21c 100644
|
|||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
|
||||
index a69d510dd..7b67fa320 100644
|
||||
index a69d510dd1..7b67fa3208 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
|
||||
@@ -0,0 +0,0 @@ public class PlayerChunkMap {
|
||||
|
@ -132,7 +132,7 @@ index a69d510dd..7b67fa320 100644
|
|||
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index 785f02065..d31101861 100644
|
||||
index 785f020652..d31101861c 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
|
||||
|
@ -151,7 +151,7 @@ index 785f02065..d31101861 100644
|
|||
this.methodProfiler.a(() -> {
|
||||
return String.valueOf(TileEntityTypes.a(tileentity.C()));
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index 50923951a..8421c397a 100644
|
||||
index 50923951a5..8421c397a1 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -0,0 +0,0 @@ public class CraftWorld implements World {
|
||||
|
@ -164,7 +164,7 @@ index 50923951a..8421c397a 100644
|
|||
}
|
||||
|
||||
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
|
||||
index 12040596d..f9bb19fed 100644
|
||||
index 12040596df..f9bb19fed6 100644
|
||||
--- a/src/main/java/org/spigotmc/ActivationRange.java
|
||||
+++ b/src/main/java/org/spigotmc/ActivationRange.java
|
||||
@@ -0,0 +0,0 @@ public class ActivationRange
|
||||
|
|
|
@ -33,7 +33,7 @@ But for those who are ok with leaving this inconsistent behavior, you may use WA
|
|||
It is recommended you regenerate the entities, as these were legit entities, and deserve your love.
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
index fb2467636a..3aa6f031f3 100644
|
||||
index 01670da006..6a3d92e742 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
@@ -0,0 +0,0 @@ public class PaperWorldConfig {
|
||||
|
@ -85,7 +85,7 @@ index fb2467636a..3aa6f031f3 100644
|
|||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
||||
index e806d13d22..3bddc5f9b5 100644
|
||||
index 0dab65c870..91049ed20f 100644
|
||||
--- a/src/main/java/net/minecraft/server/Chunk.java
|
||||
+++ b/src/main/java/net/minecraft/server/Chunk.java
|
||||
@@ -0,0 +0,0 @@
|
||||
|
@ -106,7 +106,7 @@ index e806d13d22..3bddc5f9b5 100644
|
|||
+ private static final Logger logger = LogManager.getLogger(); // Paper
|
||||
public final int locX;
|
||||
public final int locZ;
|
||||
private boolean l;
|
||||
private boolean l; public boolean needsGapCheck() { return l; } // Paper - OBFHELPER
|
||||
@@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess {
|
||||
if (i != this.locX || j != this.locZ) {
|
||||
Chunk.d.warn("Wrong location! ({}, {}) should be ({}, {}), {}", Integer.valueOf(i), Integer.valueOf(j), Integer.valueOf(this.locX), Integer.valueOf(this.locZ), entity);
|
||||
|
@ -180,7 +180,7 @@ index 7d8f723968..46399cc9b0 100644
|
|||
this.uniqueID = uuid;
|
||||
this.au = this.uniqueID.toString();
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index ba1fb577a1..ae7e17231a 100644
|
||||
index ee2cdb897c..956eabd7dc 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
|
||||
|
@ -193,7 +193,7 @@ index ba1fb577a1..ae7e17231a 100644
|
|||
public final List<TileEntity> tileEntityListTick = Lists.newArrayList();
|
||||
private final List<TileEntity> c = Lists.newArrayList();
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
index 8e8cf659f8..6579387623 100644
|
||||
index 709f3e525c..2692d0a1b6 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler {
|
||||
|
|
|
@ -14,7 +14,7 @@ Fix this by differing entity add to world for all entities at the same time
|
|||
the original entity is dead, overwrite it as the logic does for unloaod queued entities.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
||||
index e8af8f4196..56c3783412 100644
|
||||
index 39cbde281b..4a39461eb2 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 implements IChunkAccess {
|
||||
|
|
|
@ -7,7 +7,7 @@ Allows you to determine why an inventory was closed, enabling plugin developers
|
|||
to "confirm" things based on if it was player triggered close or not.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
||||
index 6bbb737df..614fce444 100644
|
||||
index ca6107a5af..9f2a08b03d 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 implements IChunkAccess {
|
||||
|
@ -29,7 +29,7 @@ index 6bbb737df..614fce444 100644
|
|||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java
|
||||
index 5e13cb064..c7dc6fe0e 100644
|
||||
index 5e13cb0640..c7dc6fe0ef 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityHuman.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
|
||||
@@ -0,0 +0,0 @@ public abstract class EntityHuman extends EntityLiving {
|
||||
|
@ -56,7 +56,7 @@ index 5e13cb064..c7dc6fe0e 100644
|
|||
this.activeContainer = this.defaultContainer;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
index 3644fde3b..68f5842cf 100644
|
||||
index 3644fde3bb..68f5842cfe 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
@@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
|
@ -110,7 +110,7 @@ index 3644fde3b..68f5842cf 100644
|
|||
this.m();
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
index 4cdf79002..793174c51 100644
|
||||
index 4cdf790029..793174c51b 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
@@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
||||
|
@ -123,7 +123,7 @@ index 4cdf79002..793174c51 100644
|
|||
this.player.m();
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
|
||||
index 304cae655..6d511b623 100644
|
||||
index 304cae655d..6d511b6230 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerList.java
|
||||
@@ -0,0 +0,0 @@ public abstract class PlayerList {
|
||||
|
@ -136,7 +136,7 @@ index 304cae655..6d511b623 100644
|
|||
PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(cserver.getPlayer(entityplayer), "\u00A7e" + entityplayer.getName() + " left the game");
|
||||
cserver.getPluginManager().callEvent(playerQuitEvent);
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
|
||||
index 92fe80316..70a4dbe26 100644
|
||||
index 92fe80316f..70a4dbe26b 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
|
||||
@@ -0,0 +0,0 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
||||
|
@ -155,7 +155,7 @@ index 92fe80316..70a4dbe26 100644
|
|||
public boolean isBlocking() {
|
||||
return getHandle().isBlocking();
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 40b590da3..f372f19de 100644
|
||||
index 40b590da36..f372f19dec 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
|
@ -168,7 +168,7 @@ index 40b590da3..f372f19de 100644
|
|||
|
||||
// Check if the fromWorld and toWorld are the same.
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
index 29d8773f2..ea787a523 100644
|
||||
index 29d8773f2e..ea787a523c 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
@@ -0,0 +0,0 @@ public class CraftEventFactory {
|
||||
|
|
|
@ -28,7 +28,7 @@ index 145cb274b0..eff9dcf54f 100644
|
|||
|
||||
public static Timing getTickList(WorldServer worldserver, String timingsType) {
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
index 39d565db1f..f0d1ae630e 100644
|
||||
index 39d565db1f..9fd1bde0ef 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
@@ -0,0 +0,0 @@ public class PaperWorldConfig {
|
||||
|
@ -36,16 +36,25 @@ index 39d565db1f..f0d1ae630e 100644
|
|||
log("Top of the nether void damage: " + netherVoidTopDamage);
|
||||
}
|
||||
+
|
||||
+ public boolean queueLightUpdates;
|
||||
+ public boolean queueLightUpdates = true; // This doesn't need to be configurable, it's not buggy.
|
||||
+ private void queueLightUpdates() {
|
||||
+ queueLightUpdates = getBoolean("queue-light-updates", false);
|
||||
+ log("Lighting Queue enabled: " + queueLightUpdates);
|
||||
+ //queueLightUpdates = getBoolean("queue-light-updates", false);
|
||||
+ //log("Lighting Queue enabled: " + queueLightUpdates);
|
||||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
||||
index 4622e92b05..d4bebddab0 100644
|
||||
index 4622e92b05..703c377f93 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 implements IChunkAccess {
|
||||
public final Map<HeightMap.Type, HeightMap> heightMap;
|
||||
public final int locX;
|
||||
public final int locZ;
|
||||
- private boolean l;
|
||||
+ private boolean l; public boolean needsGapCheck() { return l; } // Paper - OBFHELPER
|
||||
private final ChunkConverter m;
|
||||
public final Map<BlockPosition, TileEntity> tileEntities;
|
||||
public final List<Entity>[] entitySlices; // Spigot
|
||||
@@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess {
|
||||
return removed;
|
||||
}
|
||||
|
@ -55,19 +64,13 @@ index 4622e92b05..d4bebddab0 100644
|
|||
public boolean areNeighborsLoaded(final int radius) {
|
||||
switch (radius) {
|
||||
@@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess {
|
||||
this.l = true;
|
||||
}
|
||||
|
||||
+ private void recheckGaps(boolean flag) { g(flag); } // Paper - OBFHELPER
|
||||
private void g(boolean flag) {
|
||||
this.world.methodProfiler.a("recheckGaps");
|
||||
if (this.world.areChunksLoaded(new BlockPosition(this.locX * 16 + 8, 0, this.locZ * 16 + 8), 16)) {
|
||||
+ this.runOrQueueLightUpdate(() -> recheckGaps(flag)); // Paper - Queue light update
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ private void recheckGaps(boolean flag) {
|
||||
+ if (true) {
|
||||
+ // Paper end
|
||||
for (int i = 0; i < 16; ++i) {
|
||||
for (int j = 0; j < 16; ++j) {
|
||||
if (this.g[i + j * 16]) {
|
||||
@@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess {
|
||||
if (flag1) {
|
||||
this.initLighting();
|
||||
|
@ -84,6 +87,26 @@ index 4622e92b05..d4bebddab0 100644
|
|||
}
|
||||
|
||||
TileEntity tileentity;
|
||||
@@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess {
|
||||
return false;
|
||||
}
|
||||
|
||||
- public void d(boolean flag) {
|
||||
- if (this.l && this.world.worldProvider.g() && !flag) {
|
||||
- this.g(this.world.isClientSide);
|
||||
+ // Paper start
|
||||
+ private boolean shouldRecheckGaps = false;
|
||||
+ public void doGapCheck() {
|
||||
+ if (shouldRecheckGaps) {
|
||||
+ this.recheckGaps(false);
|
||||
+ shouldRecheckGaps = false;
|
||||
}
|
||||
+ }
|
||||
+ public void d(boolean flag) {
|
||||
+ shouldRecheckGaps = this.needsGapCheck() && this.world.worldProvider.hasNaturalLight() && !flag; // Paper
|
||||
|
||||
this.u = true;
|
||||
|
||||
@@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess {
|
||||
return this.D == 8;
|
||||
}
|
||||
|
@ -136,7 +159,7 @@ index d6ea4ae532..5086fe4027 100644
|
|||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/PaperLightingQueue.java b/src/main/java/net/minecraft/server/PaperLightingQueue.java
|
||||
new file mode 100644
|
||||
index 0000000000..60562f1fd2
|
||||
index 0000000000..f3d6eb7694
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/net/minecraft/server/PaperLightingQueue.java
|
||||
@@ -0,0 +0,0 @@
|
||||
|
@ -149,12 +172,8 @@ index 0000000000..60562f1fd2
|
|||
+
|
||||
+class PaperLightingQueue {
|
||||
+ private static final long MAX_TIME = (long) (1000000000 / 20 * .95);
|
||||
+ private static int updatesThisTick;
|
||||
+
|
||||
+
|
||||
+ static void processQueue(long curTime) {
|
||||
+ updatesThisTick = 0;
|
||||
+
|
||||
+ final long startTime = System.nanoTime();
|
||||
+ final long maxTickTime = MAX_TIME - (startTime - curTime);
|
||||
+
|
||||
|
@ -165,10 +184,11 @@ index 0000000000..60562f1fd2
|
|||
+ }
|
||||
+
|
||||
+ ObjectCollection<Chunk> loadedChunks = ((WorldServer) world).getChunkProviderServer().chunks.values();
|
||||
+ for (Chunk chunk : loadedChunks.toArray(new Chunk[loadedChunks.size()])) {
|
||||
+ for (Chunk chunk : loadedChunks.toArray(new Chunk[0])) {
|
||||
+ if (chunk.lightingQueue.processQueue(startTime, maxTickTime)) {
|
||||
+ break START;
|
||||
+ }
|
||||
+ chunk.doGapCheck();
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
|
@ -195,12 +215,10 @@ index 0000000000..60562f1fd2
|
|||
+ try (Timing ignored = chunk.world.timings.lightingQueueTimer.startTiming()) {
|
||||
+ Runnable lightUpdate;
|
||||
+ while ((lightUpdate = this.poll()) != null) {
|
||||
+ lightUpdate.run();
|
||||
+ if (startTime > 0 && ++PaperLightingQueue.updatesThisTick % 10 == 0 && PaperLightingQueue.updatesThisTick > 10) {
|
||||
+ if (System.nanoTime() - startTime > maxTickTime) {
|
||||
+ return true;
|
||||
+ }
|
||||
+ if (startTime > 0 && isOutOfTime(maxTickTime, System.nanoTime() - startTime)) {
|
||||
+ return true;
|
||||
+ }
|
||||
+ lightUpdate.run();
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
|
@ -231,6 +249,10 @@ index 0000000000..60562f1fd2
|
|||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ private static boolean isOutOfTime(long maxTickTime, long l) {
|
||||
+ return l > maxTickTime;
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index 499d64ea2c..e06da6bef9 100644
|
||||
|
@ -245,4 +267,17 @@ index 499d64ea2c..e06da6bef9 100644
|
|||
this.methodProfiler.e();
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldProvider.java b/src/main/java/net/minecraft/server/WorldProvider.java
|
||||
index 517b1e7124..53ce7d5e11 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldProvider.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldProvider.java
|
||||
@@ -0,0 +0,0 @@ public abstract class WorldProvider {
|
||||
protected World b;
|
||||
protected boolean c;
|
||||
protected boolean d;
|
||||
- protected boolean e;
|
||||
+ protected boolean e; public boolean hasNaturalLight() { return e; } // Paper - OBFHELPER
|
||||
protected final float[] f = new float[16];
|
||||
private final float[] g = new float[4];
|
||||
|
||||
--
|
|
@ -9,7 +9,7 @@ loss from chunks if they crossed chunk boundries.
|
|||
This fixes the issue.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
||||
index 33f5aa721f..ca5cd62866 100644
|
||||
index 4f72b1b184..1c4e892aad 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 implements IChunkAccess {
|
||||
|
|
|
@ -6,7 +6,7 @@ Subject: [PATCH] Mark chunk dirty anytime entities change to guarantee it
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
||||
index 3bddc5f9b..33ce24479 100644
|
||||
index 91049ed20f..66712db2a2 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 implements IChunkAccess {
|
||||
|
|
|
@ -52,7 +52,7 @@ index 5ed34cf7e3..f4ed98d2d9 100644
|
|||
public MutableBlockPosition() {
|
||||
this(0, 0, 0);
|
||||
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
||||
index dcd122d8b5..dee1f7bfe9 100644
|
||||
index b006282f38..a36034cc52 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 implements IChunkAccess {
|
||||
|
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Option to remove corrupt tile entities
|
|||
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
index 78a318827..79260172d 100644
|
||||
index 015d7fcb5c..9ee62da233 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
@@ -0,0 +0,0 @@ public class PaperWorldConfig {
|
||||
|
@ -19,7 +19,7 @@ index 78a318827..79260172d 100644
|
|||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
||||
index 8d1264879..6bbb737df 100644
|
||||
index 5285bfb409..ca6107a5af 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 implements IChunkAccess {
|
||||
|
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Prevent Mob AI Rules from Loading Chunks
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
||||
index 1d301dcb70..33f5aa721f 100644
|
||||
index 92101375c4..4f72b1b184 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 implements IChunkAccess {
|
||||
|
|
Loading…
Reference in a new issue