Skip to content

Commit

Permalink
Working hard on messing with leafs patches
Browse files Browse the repository at this point in the history
  • Loading branch information
lynxplay committed Sep 22, 2023
1 parent 574bc96 commit 452009b
Show file tree
Hide file tree
Showing 11 changed files with 102 additions and 100 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ Paper recently reverted this optimisation, so it's been reintroduced
here.

diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index e8a705c432c4f10944eaac33f7d4670916070715..a21b2a100503b1fcceb700da11bef5866f3d178b 100644
index 5b735d018a4b0b1c212f63d941c2aa6a00d129f6..a508716195953260a00497e925d86c3a1f8942d3 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -455,6 +455,15 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -453,6 +453,15 @@ public abstract class Level implements LevelAccessor, AutoCloseable {

@Override
public final LevelChunk getChunk(int chunkX, int chunkZ) { // Paper - final to help inline
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ Lighting is purged on update anyways, so let's not add more
into the conversion process

diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java
index a5da3333e87bcc9def785a8e742a30d38c0ecc27..8ebecb588058da174b0e0e19e54fcddfeeca1422 100644
index 6c0f87535ffa95cf82ab4b03bb7bf8f2132d275f..9c92e936f7227d8fb8a51382907301ce1748513e 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java
@@ -51,6 +51,7 @@ public class ChunkStorage implements AutoCloseable {
@@ -44,6 +44,7 @@ public class ChunkStorage implements AutoCloseable {

// CraftBukkit start
private boolean check(ServerChunkCache cps, int x, int z) {
+ if (true) return true; // Paper - this isn't even needed anymore, light is purged updating to 1.14+, why are we holding up the conversion process reading chunk data off disk - return true, we need to set light populated to true so the converter recognizes the chunk as being "full"
ChunkPos pos = new ChunkPos(x, z);
if (cps != null) {
//com.google.common.base.Preconditions.checkState(org.bukkit.Bukkit.isPrimaryThread(), "primary thread"); // Paper - this function is now MT-Safe
com.google.common.base.Preconditions.checkState(org.bukkit.Bukkit.isPrimaryThread(), "primary thread");
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,20 @@ Plugins leaking scoreboards will make this very expensive,
let server owners debug it easily

diff --git a/src/main/java/co/aikar/timings/MinecraftTimings.java b/src/main/java/co/aikar/timings/MinecraftTimings.java
index 670dcfa32d003870091b75937f1603a5ac9fa7d1..112029cb275d45dced60807820f1bfe9f394496d 100644
index 4d861f9a58f8ea238471af22f387854d855b1801..678a31fb85947ee8807d02d0fe4e11a73d2dafaa 100644
--- a/src/main/java/co/aikar/timings/MinecraftTimings.java
+++ b/src/main/java/co/aikar/timings/MinecraftTimings.java
@@ -47,6 +47,7 @@ public final class MinecraftTimings {
@@ -46,6 +46,8 @@ public final class MinecraftTimings {

public static final Timing antiXrayUpdateTimer = Timings.ofSafe("anti-xray - update");
public static final Timing antiXrayObfuscateTimer = Timings.ofSafe("anti-xray - obfuscate");
public static final Timing distanceManagerTick = Timings.ofSafe("Distance Manager Tick"); // Paper - add timings for distance manager
+ public static final Timing scoreboardScoreSearch = Timings.ofSafe("Scoreboard score search"); // Paper - add timings for scoreboard search
+

public static final Timing midTickChunkTasks = Timings.ofSafe("Mid Tick Chunk Tasks");
private static final Map<Class<?>, String> taskNameCache = new MapMaker().weakKeys().makeMap();

diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java
index afc43b52698db4bf7d89a576c2cbca0ddc9e04e2..500f2eb0df5a07637cd278c263e95592b0037eb6 100644
index 8f20fa2bfbe037fbaa9f4c4c3341a3d9b9a711b5..628951be16da8f19f0e1a974a0b4efa86e873b99 100644
--- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java
+++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java
@@ -113,9 +113,18 @@ public final class CraftScoreboardManager implements ScoreboardManager {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ Configurable under
`send-full-pos-for-hard-colliding-entities`

diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
index f8b3d633e788c3d6cb5b53e606fa798a42582460..e7c0d214abbad1f300049f790ae54e7ea488e150 100644
index 4fa9cb61a72e2713175a91e38ba96493ed12f8b8..fbcb6843492c25a03bdc2efb4efb529f9fecc221 100644
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
@@ -180,7 +180,7 @@ public class ServerEntity {
@@ -177,7 +177,7 @@ public class ServerEntity {
long i1 = this.positionCodec.encodeZ(vec3d);
boolean flag6 = k < -32768L || k > 32767L || l < -32768L || l > 32767L || i1 < -32768L || i1 > 32767L;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ Reference2BooleanOpenHashMap is going to have
better lookups than HashMap.

diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index bcf0dfe50add8e260a280e45673727f964bac6fd..db40680bd9e026d9e98135355e4844c32e82fd51 100644
index 9cdebd7715fca949cc390684d044235d75b89c24..567f264ec20dd9657f5618aeaafcfdf40680675f 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1408,7 +1408,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -1775,7 +1775,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
final Entity entity;
private final int range;
SectionPos lastSectionPos;
Expand Down
Loading

0 comments on commit 452009b

Please sign in to comment.