More more more more more more more more more more more more more more more more work
This commit is contained in:
parent
055b8ab9cf
commit
011df7dc84
|
@ -5067,7 +5067,7 @@ index 18f1bfed979e756a62ff8f5ee434d8270ab987d4..2361a92630d2639d602bc1434b061ad9
|
|||
} catch (Throwable throwable) {
|
||||
// Spigot Start
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
||||
index d2fbb6e28db27b3207879be3027bb74410a53900..303125c4d0f8f235703975eab5eccb9aa045ccf8 100644
|
||||
index d2fbb6e28db27b3207879be3027bb74410a53900..faa0f1c72693977b65b3deb0f689756fbc83f568 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
||||
@@ -49,9 +49,9 @@ public class ChunkHolder {
|
||||
|
@ -5286,8 +5286,27 @@ index d2fbb6e28db27b3207879be3027bb74410a53900..303125c4d0f8f235703975eab5eccb9a
|
|||
}
|
||||
|
||||
if (!playerchunk_state1.isOrAfter(playerchunk_state)) {
|
||||
@@ -563,4 +642,18 @@ public class ChunkHolder {
|
||||
}
|
||||
};
|
||||
}
|
||||
+
|
||||
+ // Paper start
|
||||
+ public final boolean isEntityTickingReady() {
|
||||
+ return this.isEntityTickingReady;
|
||||
+ }
|
||||
+
|
||||
+ public final boolean isTickingReady() {
|
||||
+ return this.isTickingReady;
|
||||
+ }
|
||||
+
|
||||
+ public final boolean isFullChunkReady() {
|
||||
+ return this.isFullChunkReady;
|
||||
+ }
|
||||
+ // Paper end
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
index f41f0e6aa12c89b7a8dd95a7c43510bae2d58525..85c177bdf9ab329b7ff30294fd8d45b6690d6b71 100644
|
||||
index f41f0e6aa12c89b7a8dd95a7c43510bae2d58525..3c43b9e510ec1df43a54cde475490c49e57ca1b8 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
@@ -58,6 +58,7 @@ import net.minecraft.network.protocol.game.ClientboundSetChunkCacheCenterPacket;
|
||||
|
@ -5446,6 +5465,38 @@ index f41f0e6aa12c89b7a8dd95a7c43510bae2d58525..85c177bdf9ab329b7ff30294fd8d45b6
|
|||
}
|
||||
|
||||
@Override
|
||||
@@ -1414,7 +1496,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
public class ChunkDistanceManager extends DistanceManager {
|
||||
|
||||
protected ChunkDistanceManager(Executor workerExecutor, Executor mainThreadExecutor) {
|
||||
- super(workerExecutor, mainThreadExecutor);
|
||||
+ super(workerExecutor, mainThreadExecutor, ChunkMap.this);
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/server/level/DistanceManager.java b/src/main/java/net/minecraft/server/level/DistanceManager.java
|
||||
index ef87c37633cee4ab438f1991144188ade1c4e65f..19d3802becd353e130b785f8286e595e08dc5c5f 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/DistanceManager.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/DistanceManager.java
|
||||
@@ -59,8 +59,9 @@ public abstract class DistanceManager {
|
||||
final Executor mainThreadExecutor;
|
||||
private long ticketTickCounter;
|
||||
private int simulationDistance = 10;
|
||||
+ private final ChunkMap chunkMap; // Paper
|
||||
|
||||
- protected DistanceManager(Executor workerExecutor, Executor mainThreadExecutor) {
|
||||
+ protected DistanceManager(Executor workerExecutor, Executor mainThreadExecutor, ChunkMap chunkMap) {
|
||||
Objects.requireNonNull(mainThreadExecutor);
|
||||
ProcessorHandle<Runnable> mailbox = ProcessorHandle.of("player ticket throttler", mainThreadExecutor::execute);
|
||||
ChunkTaskPriorityQueueSorter chunktaskqueuesorter = new ChunkTaskPriorityQueueSorter(ImmutableList.of(mailbox), workerExecutor, 4);
|
||||
@@ -69,6 +70,7 @@ public abstract class DistanceManager {
|
||||
this.ticketThrottlerInput = chunktaskqueuesorter.getProcessor(mailbox, true);
|
||||
this.ticketThrottlerReleaser = chunktaskqueuesorter.getReleaseProcessor(mailbox);
|
||||
this.mainThreadExecutor = mainThreadExecutor;
|
||||
+ this.chunkMap = chunkMap; // Paper
|
||||
}
|
||||
|
||||
protected void purgeStaleTickets() {
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
index bdc774e3fbb949290fbc94c4b0cbc8f2c09f5bd8..8509bf94f64c6b761ee38e39278d12fcedeeff75 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
|
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] ChunkMapDistance CME
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
||||
index 5b999da8c5ad430f9157276857165596d1208f64..26a787864058dccc0365680b0259ddf0dad22b58 100644
|
||||
index 60f6d74b6da4c35f937e171a70a9e78406154f4b..51175994b37e966af8983df1f15a0fc5a638a0b5 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
||||
@@ -70,6 +70,7 @@ public class ChunkHolder {
|
||||
|
@ -17,7 +17,7 @@ index 5b999da8c5ad430f9157276857165596d1208f64..26a787864058dccc0365680b0259ddf0
|
|||
|
||||
public ChunkHolder(ChunkPos pos, int level, LevelHeightAccessor world, LevelLightEngine lightingProvider, ChunkHolder.LevelChangeListener levelUpdateListener, ChunkHolder.PlayerProvider playersWatchingChunkProvider) {
|
||||
diff --git a/src/main/java/net/minecraft/server/level/DistanceManager.java b/src/main/java/net/minecraft/server/level/DistanceManager.java
|
||||
index ef87c37633cee4ab438f1991144188ade1c4e65f..975f1aab48f04a9f3cae04141b3fb65247f0ffaf 100644
|
||||
index 19d3802becd353e130b785f8286e595e08dc5c5f..f0dac1f596911eb2109192ef16a619f8ae71d1f7 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/DistanceManager.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/DistanceManager.java
|
||||
@@ -51,7 +51,16 @@ public abstract class DistanceManager {
|
||||
|
@ -38,7 +38,7 @@ index ef87c37633cee4ab438f1991144188ade1c4e65f..975f1aab48f04a9f3cae04141b3fb652
|
|||
final ChunkTaskPriorityQueueSorter ticketThrottler;
|
||||
final ProcessorHandle<ChunkTaskPriorityQueueSorter.Message<Runnable>> ticketThrottlerInput;
|
||||
final ProcessorHandle<ChunkTaskPriorityQueueSorter.Release> ticketThrottlerReleaser;
|
||||
@@ -124,26 +133,14 @@ public abstract class DistanceManager {
|
||||
@@ -126,26 +135,14 @@ public abstract class DistanceManager {
|
||||
;
|
||||
}
|
||||
|
||||
|
@ -73,7 +73,7 @@ index ef87c37633cee4ab438f1991144188ade1c4e65f..975f1aab48f04a9f3cae04141b3fb652
|
|||
return true;
|
||||
} else {
|
||||
if (!this.ticketsToRelease.isEmpty()) {
|
||||
@@ -432,7 +429,7 @@ public abstract class DistanceManager {
|
||||
@@ -434,7 +431,7 @@ public abstract class DistanceManager {
|
||||
if (k != level) {
|
||||
playerchunk = DistanceManager.this.updateChunkScheduling(id, level, playerchunk, k);
|
||||
if (playerchunk != null) {
|
||||
|
|
|
@ -7,10 +7,10 @@ Subject: [PATCH] Don't crash if player is attempted to be removed from
|
|||
I suspect it deals with teleporting as it uses players current x/y/z
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/DistanceManager.java b/src/main/java/net/minecraft/server/level/DistanceManager.java
|
||||
index 975f1aab48f04a9f3cae04141b3fb65247f0ffaf..1a6c75a33c6dfec63eabef0b8a0a5d8812aeeb4c 100644
|
||||
index f0dac1f596911eb2109192ef16a619f8ae71d1f7..8868ffcda194e8c2300181a2cdda9337dbde6284 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/DistanceManager.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/DistanceManager.java
|
||||
@@ -281,8 +281,8 @@ public abstract class DistanceManager {
|
||||
@@ -283,8 +283,8 @@ public abstract class DistanceManager {
|
||||
ObjectSet<ServerPlayer> objectset = (ObjectSet) this.playersPerChunk.get(i);
|
||||
if (objectset == null) return; // CraftBukkit - SPIGOT-6208
|
||||
|
||||
|
|
|
@ -80,7 +80,7 @@ index 2fe519d4059fac06781c30e140895b604e13104f..35949e9c15eb998aa89842d34d0999cd
|
|||
chunkData.addProperty("queued-for-unload", chunkMap.toDrop.contains(playerChunk.pos.longKey));
|
||||
chunkData.addProperty("status", status == null ? "unloaded" : status.toString());
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
||||
index 26a787864058dccc0365680b0259ddf0dad22b58..d03aeed657fc7e427d847e0b8e2d58c59e6851fa 100644
|
||||
index 51175994b37e966af8983df1f15a0fc5a638a0b5..675c13c629e77ba50ecdad8cae43cc6b8aee5eaa 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
||||
@@ -57,7 +57,7 @@ public class ChunkHolder {
|
||||
|
@ -223,11 +223,11 @@ index 26a787864058dccc0365680b0259ddf0dad22b58..d03aeed657fc7e427d847e0b8e2d58c5
|
|||
});
|
||||
}
|
||||
}).exceptionally((throwable) -> {
|
||||
@@ -643,4 +696,134 @@ public class ChunkHolder {
|
||||
}
|
||||
@@ -644,7 +697,134 @@ public class ChunkHolder {
|
||||
};
|
||||
}
|
||||
+
|
||||
|
||||
- // Paper start
|
||||
+ // Paper start - Chunk gen/load priority system
|
||||
+ volatile int neighborPriority = -1;
|
||||
+ volatile int priorityBoost = 0;
|
||||
|
@ -356,13 +356,14 @@ index 26a787864058dccc0365680b0259ddf0dad22b58..d03aeed657fc7e427d847e0b8e2d58c5
|
|||
+ ", priority=(" + ticketLevel + " - " + priorityBoost +" vs N " + neighborPriority + ") = " + getDemandedPriority() + " A " + queueLevel +
|
||||
+ '}';
|
||||
+ }
|
||||
+ // Paper end
|
||||
}
|
||||
public final boolean isEntityTickingReady() {
|
||||
return this.isEntityTickingReady;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
index 2e127a2eb9b00eabe1f5c9c966e405e280c38756..2964b9c6bcc4de9e0ce7644e15f0b0625a01b810 100644
|
||||
index 7f4b68199b0cd8adb09ef09539b43e62885e19c5..896bca9ac8017ace5bc95d4ab1c2f96a63bd921b 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
@@ -124,6 +124,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -125,6 +125,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
public final ServerLevel level;
|
||||
private final ThreadedLevelLightEngine lightEngine;
|
||||
private final BlockableEventLoop<Runnable> mainThreadExecutor;
|
||||
|
@ -370,7 +371,7 @@ index 2e127a2eb9b00eabe1f5c9c966e405e280c38756..2964b9c6bcc4de9e0ce7644e15f0b062
|
|||
public ChunkGenerator generator;
|
||||
public final Supplier<DimensionDataStorage> overworldDataStorage;
|
||||
private final PoiManager poiManager;
|
||||
@@ -241,6 +242,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -242,6 +243,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
this.level = world;
|
||||
this.generator = chunkGenerator;
|
||||
this.mainThreadExecutor = mainThreadExecutor;
|
||||
|
@ -386,7 +387,7 @@ index 2e127a2eb9b00eabe1f5c9c966e405e280c38756..2964b9c6bcc4de9e0ce7644e15f0b062
|
|||
ProcessorMailbox<Runnable> threadedmailbox = ProcessorMailbox.create(executor, "worldgen");
|
||||
|
||||
Objects.requireNonNull(mainThreadExecutor);
|
||||
@@ -281,6 +291,116 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -282,6 +292,37 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -419,91 +420,12 @@ index 2e127a2eb9b00eabe1f5c9c966e405e280c38756..2964b9c6bcc4de9e0ce7644e15f0b062
|
|||
+ map.put(chunk, level);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ public void checkHighPriorityChunks(ServerPlayer player) {
|
||||
+ int currentTick = MinecraftServer.currentTick;
|
||||
+ if (currentTick - player.lastHighPriorityChecked < 20 || !player.isRealPlayer) { // weed out fake players
|
||||
+ return;
|
||||
+ }
|
||||
+ player.lastHighPriorityChecked = currentTick;
|
||||
+ it.unimi.dsi.fastutil.longs.Long2IntOpenHashMap priorities = new it.unimi.dsi.fastutil.longs.Long2IntOpenHashMap();
|
||||
+
|
||||
+ int viewDistance = getEffectiveNoTickViewDistance();
|
||||
+ net.minecraft.core.BlockPos.MutableBlockPos pos = new net.minecraft.core.BlockPos.MutableBlockPos();
|
||||
+
|
||||
+ // Prioritize circular near
|
||||
+ double playerChunkX = Mth.floor(player.getX()) >> 4;
|
||||
+ double playerChunkZ = Mth.floor(player.getZ()) >> 4;
|
||||
+ pos.set(player.getX(), 0, player.getZ());
|
||||
+ double twoThirdModifier = 2D / 3D;
|
||||
+ MCUtil.getSpiralOutChunks(pos, Math.min(6, viewDistance)).forEach(coord -> {
|
||||
+ if (shouldSkipPrioritization(coord)) return;
|
||||
+
|
||||
+ double dist = MCUtil.distance(playerChunkX, 0, playerChunkZ, coord.x, 0, coord.z);
|
||||
+ // Prioritize immediate
|
||||
+ if (dist <= 4) {
|
||||
+ updateChunkPriorityMap(priorities, coord.toLong(), (int) (27 - dist));
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ // Prioritize nearby chunks
|
||||
+ updateChunkPriorityMap(priorities, coord.toLong(), (int) (20 - dist * twoThirdModifier));
|
||||
+ });
|
||||
+
|
||||
+ // Prioritize Frustum near 3
|
||||
+ ChunkPos front3 = player.getChunkInFront(3);
|
||||
+ pos.set(front3.x << 4, 0, front3.z << 4);
|
||||
+ MCUtil.getSpiralOutChunks(pos, Math.min(5, viewDistance)).forEach(coord -> {
|
||||
+ if (shouldSkipPrioritization(coord)) return;
|
||||
+
|
||||
+ double dist = MCUtil.distance(playerChunkX, 0, playerChunkZ, coord.x, 0, coord.z);
|
||||
+ updateChunkPriorityMap(priorities, coord.toLong(), (int) (25 - dist * twoThirdModifier));
|
||||
+ });
|
||||
+
|
||||
+ // Prioritize Frustum near 5
|
||||
+ if (viewDistance > 4) {
|
||||
+ ChunkPos front5 = player.getChunkInFront(5);
|
||||
+ pos.set(front5.x << 4, 0, front5.z << 4);
|
||||
+ MCUtil.getSpiralOutChunks(pos, 4).forEach(coord -> {
|
||||
+ if (shouldSkipPrioritization(coord)) return;
|
||||
+
|
||||
+ double dist = MCUtil.distance(playerChunkX, 0, playerChunkZ, coord.x, 0, coord.z);
|
||||
+ updateChunkPriorityMap(priorities, coord.toLong(), (int) (25 - dist * twoThirdModifier));
|
||||
+ });
|
||||
+ }
|
||||
+
|
||||
+ // Prioritize Frustum far 7
|
||||
+ if (viewDistance > 6) {
|
||||
+ ChunkPos front7 = player.getChunkInFront(7);
|
||||
+ pos.set(front7.x << 4, 0, front7.z << 4);
|
||||
+ MCUtil.getSpiralOutChunks(pos, 3).forEach(coord -> {
|
||||
+ if (shouldSkipPrioritization(coord)) {
|
||||
+ return;
|
||||
+ }
|
||||
+ double dist = MCUtil.distance(playerChunkX, 0, playerChunkZ, coord.x, 0, coord.z);
|
||||
+ updateChunkPriorityMap(priorities, coord.toLong(), (int) (25 - dist * twoThirdModifier));
|
||||
+ });
|
||||
+ }
|
||||
+
|
||||
+ if (priorities.isEmpty()) return;
|
||||
+ distanceManager.delayDistanceManagerTick = true;
|
||||
+ priorities.long2IntEntrySet().fastForEach(entry -> distanceManager.markHighPriority(new ChunkPos(entry.getLongKey()), entry.getIntValue()));
|
||||
+ distanceManager.delayDistanceManagerTick = false;
|
||||
+ level.getChunkSource().runDistanceManagerUpdates();
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+ private boolean shouldSkipPrioritization(ChunkPos coord) {
|
||||
+ if (playerViewDistanceNoTickMap.getObjectsInRange(coord.toLong()) == null) return true;
|
||||
+ ChunkHolder chunk = getUpdatingChunkIfPresent(coord.toLong());
|
||||
+ return chunk != null && (chunk.isFullChunkReady());
|
||||
+ }
|
||||
+ // Paper end
|
||||
+
|
||||
// Paper start
|
||||
public void updatePlayerMobTypeMap(Entity entity) {
|
||||
if (!this.level.paperConfig.perPlayerMobSpawns) {
|
||||
@@ -422,6 +542,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -423,6 +464,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
List<CompletableFuture<Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>>> list = Lists.newArrayList();
|
||||
int j = centerChunk.x;
|
||||
int k = centerChunk.z;
|
||||
|
@ -511,7 +433,7 @@ index 2e127a2eb9b00eabe1f5c9c966e405e280c38756..2964b9c6bcc4de9e0ce7644e15f0b062
|
|||
|
||||
for (int l = -margin; l <= margin; ++l) {
|
||||
for (int i1 = -margin; i1 <= margin; ++i1) {
|
||||
@@ -440,6 +561,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -441,6 +483,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
|
||||
ChunkStatus chunkstatus = (ChunkStatus) distanceToStatus.apply(j1);
|
||||
CompletableFuture<Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>> completablefuture = playerchunk.getOrScheduleFuture(chunkstatus, this);
|
||||
|
@ -526,7 +448,7 @@ index 2e127a2eb9b00eabe1f5c9c966e405e280c38756..2964b9c6bcc4de9e0ce7644e15f0b062
|
|||
|
||||
list.add(completablefuture);
|
||||
}
|
||||
@@ -710,11 +839,19 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -712,11 +762,19 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
if (requiredStatus == ChunkStatus.EMPTY) {
|
||||
return this.scheduleChunkLoad(chunkcoordintpair);
|
||||
} else {
|
||||
|
@ -547,7 +469,7 @@ index 2e127a2eb9b00eabe1f5c9c966e405e280c38756..2964b9c6bcc4de9e0ce7644e15f0b062
|
|||
|
||||
if (optional.isPresent() && ((ChunkAccess) optional.get()).getStatus().isOrAfter(requiredStatus)) {
|
||||
CompletableFuture<Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>> completablefuture = requiredStatus.load(this.level, this.structureManager, this.lightEngine, (ichunkaccess) -> {
|
||||
@@ -726,6 +863,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -728,6 +786,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
} else {
|
||||
return this.scheduleChunkGeneration(holder, requiredStatus);
|
||||
}
|
||||
|
@ -555,7 +477,7 @@ index 2e127a2eb9b00eabe1f5c9c966e405e280c38756..2964b9c6bcc4de9e0ce7644e15f0b062
|
|||
}
|
||||
}
|
||||
|
||||
@@ -782,14 +920,24 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -784,14 +843,24 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
};
|
||||
|
||||
CompletableFuture<CompoundTag> chunkSaveFuture = this.level.asyncChunkTaskManager.getChunkSaveFuture(pos.x, pos.z);
|
||||
|
@ -585,7 +507,7 @@ index 2e127a2eb9b00eabe1f5c9c966e405e280c38756..2964b9c6bcc4de9e0ce7644e15f0b062
|
|||
return ret;
|
||||
// Paper end
|
||||
}
|
||||
@@ -838,7 +986,10 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -843,7 +912,10 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
this.releaseLightTicket(chunkcoordintpair);
|
||||
return CompletableFuture.completedFuture(Either.right(playerchunk_failure));
|
||||
});
|
||||
|
@ -597,7 +519,7 @@ index 2e127a2eb9b00eabe1f5c9c966e405e280c38756..2964b9c6bcc4de9e0ce7644e15f0b062
|
|||
}
|
||||
|
||||
protected void releaseLightTicket(ChunkPos pos) {
|
||||
@@ -922,7 +1073,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -927,7 +999,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
long i = chunkHolder.getPos().toLong();
|
||||
|
||||
Objects.requireNonNull(chunkHolder);
|
||||
|
@ -607,10 +529,10 @@ index 2e127a2eb9b00eabe1f5c9c966e405e280c38756..2964b9c6bcc4de9e0ce7644e15f0b062
|
|||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/DistanceManager.java b/src/main/java/net/minecraft/server/level/DistanceManager.java
|
||||
index 1a6c75a33c6dfec63eabef0b8a0a5d8812aeeb4c..7f1fc9ab112903ed0f29b82baeba89bbf469c4e9 100644
|
||||
index 8868ffcda194e8c2300181a2cdda9337dbde6284..4ec7fc8081c2c3d2e2d2cfcce336e5b0a35aabda 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/DistanceManager.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/DistanceManager.java
|
||||
@@ -111,6 +111,7 @@ public abstract class DistanceManager {
|
||||
@@ -113,6 +113,7 @@ public abstract class DistanceManager {
|
||||
}
|
||||
|
||||
private static int getTicketLevelAt(SortedArraySet<Ticket<?>> tickets) {
|
||||
|
@ -618,7 +540,7 @@ index 1a6c75a33c6dfec63eabef0b8a0a5d8812aeeb4c..7f1fc9ab112903ed0f29b82baeba89bb
|
|||
return !tickets.isEmpty() ? ((Ticket) tickets.first()).getTicketLevel() : ChunkMap.MAX_CHUNK_DISTANCE + 1;
|
||||
}
|
||||
|
||||
@@ -125,6 +126,7 @@ public abstract class DistanceManager {
|
||||
@@ -127,6 +128,7 @@ public abstract class DistanceManager {
|
||||
public boolean runAllUpdates(ChunkMap chunkStorage) {
|
||||
this.naturalSpawnChunkCounter.runAllUpdates();
|
||||
this.tickingTicketsTracker.runAllUpdates();
|
||||
|
@ -626,7 +548,7 @@ index 1a6c75a33c6dfec63eabef0b8a0a5d8812aeeb4c..7f1fc9ab112903ed0f29b82baeba89bb
|
|||
this.playerTicketManager.runAllUpdates();
|
||||
int i = Integer.MAX_VALUE - this.ticketTracker.runDistanceUpdates(Integer.MAX_VALUE);
|
||||
boolean flag = i != 0;
|
||||
@@ -135,11 +137,13 @@ public abstract class DistanceManager {
|
||||
@@ -137,11 +139,13 @@ public abstract class DistanceManager {
|
||||
|
||||
// Paper start
|
||||
if (!this.pendingChunkUpdates.isEmpty()) {
|
||||
|
@ -640,7 +562,7 @@ index 1a6c75a33c6dfec63eabef0b8a0a5d8812aeeb4c..7f1fc9ab112903ed0f29b82baeba89bb
|
|||
// Paper end
|
||||
return true;
|
||||
} else {
|
||||
@@ -175,8 +179,10 @@ public abstract class DistanceManager {
|
||||
@@ -177,8 +181,10 @@ public abstract class DistanceManager {
|
||||
return flag;
|
||||
}
|
||||
}
|
||||
|
@ -651,7 +573,7 @@ index 1a6c75a33c6dfec63eabef0b8a0a5d8812aeeb4c..7f1fc9ab112903ed0f29b82baeba89bb
|
|||
SortedArraySet<Ticket<?>> arraysetsorted = this.getTickets(i);
|
||||
int j = DistanceManager.getTicketLevelAt(arraysetsorted);
|
||||
Ticket<?> ticket1 = (Ticket) arraysetsorted.addOrGet(ticket);
|
||||
@@ -190,7 +196,9 @@ public abstract class DistanceManager {
|
||||
@@ -192,7 +198,9 @@ public abstract class DistanceManager {
|
||||
}
|
||||
|
||||
boolean removeTicket(long i, Ticket<?> ticket) { // CraftBukkit - void -> boolean
|
||||
|
@ -661,7 +583,7 @@ index 1a6c75a33c6dfec63eabef0b8a0a5d8812aeeb4c..7f1fc9ab112903ed0f29b82baeba89bb
|
|||
|
||||
boolean removed = false; // CraftBukkit
|
||||
if (arraysetsorted.remove(ticket)) {
|
||||
@@ -201,7 +209,12 @@ public abstract class DistanceManager {
|
||||
@@ -203,7 +211,12 @@ public abstract class DistanceManager {
|
||||
this.tickets.remove(i);
|
||||
}
|
||||
|
||||
|
@ -675,7 +597,7 @@ index 1a6c75a33c6dfec63eabef0b8a0a5d8812aeeb4c..7f1fc9ab112903ed0f29b82baeba89bb
|
|||
return removed; // CraftBukkit
|
||||
}
|
||||
|
||||
@@ -249,6 +262,136 @@ public abstract class DistanceManager {
|
||||
@@ -251,6 +264,112 @@ public abstract class DistanceManager {
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -711,36 +633,12 @@ index 1a6c75a33c6dfec63eabef0b8a0a5d8812aeeb4c..7f1fc9ab112903ed0f29b82baeba89bb
|
|||
+ chunkMap.level.getChunkSource().runDistanceManagerUpdates();
|
||||
+ }
|
||||
+
|
||||
+ private boolean hasPlayerTicket(ChunkPos coords, int level) {
|
||||
+ SortedArraySet<Ticket<?>> tickets = this.tickets.get(coords.toLong());
|
||||
+ if (tickets == null || tickets.isEmpty()) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ for (Ticket<?> ticket : tickets) {
|
||||
+ if (ticket.getType() == TicketType.PLAYER && ticket.getTicketLevel() == level) {
|
||||
+ return true;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ private boolean addPriorityTicket(ChunkPos coords, TicketType<ChunkPos> ticketType, int priority) {
|
||||
+ org.spigotmc.AsyncCatcher.catchOp("ChunkMapDistance::addPriorityTicket");
|
||||
+ long pair = coords.toLong();
|
||||
+ ChunkHolder chunk = chunkMap.getUpdatingChunkIfPresent(pair);
|
||||
+ boolean needsTicket = chunkMap.playerViewDistanceNoTickMap.getObjectsInRange(pair) != null && !hasPlayerTicket(coords, 33);
|
||||
+
|
||||
+ if (needsTicket) {
|
||||
+ Ticket<?> ticket = new Ticket<>(TicketType.PLAYER, 33, coords);
|
||||
+ this.ticketsToRelease.add(pair);
|
||||
+ addTicket(pair, ticket);
|
||||
+ }
|
||||
+ if ((chunk != null && chunk.isFullChunkReady())) {
|
||||
+ if (needsTicket) {
|
||||
+ chunkMap.level.getChunkSource().runDistanceManagerUpdates();
|
||||
+ }
|
||||
+ return needsTicket;
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ boolean success;
|
||||
|
@ -812,187 +710,11 @@ index 1a6c75a33c6dfec63eabef0b8a0a5d8812aeeb4c..7f1fc9ab112903ed0f29b82baeba89bb
|
|||
protected void updateChunkForced(ChunkPos pos, boolean forced) {
|
||||
Ticket<ChunkPos> ticket = new Ticket<>(TicketType.FORCED, 31, pos);
|
||||
long i = pos.toLong();
|
||||
@@ -536,41 +679,68 @@ public abstract class DistanceManager {
|
||||
|
||||
public void updateViewDistance(int watchDistance) {
|
||||
ObjectIterator objectiterator = this.chunks.long2ByteEntrySet().iterator();
|
||||
+ // Paper start - set the view distance before scheduling chunk loads/unloads
|
||||
+ int lastViewDistance = this.viewDistance;
|
||||
+ this.viewDistance = watchDistance;
|
||||
+ // Paper end
|
||||
|
||||
while (objectiterator.hasNext()) {
|
||||
it.unimi.dsi.fastutil.longs.Long2ByteMap.Entry it_unimi_dsi_fastutil_longs_long2bytemap_entry = (it.unimi.dsi.fastutil.longs.Long2ByteMap.Entry) objectiterator.next();
|
||||
byte b0 = it_unimi_dsi_fastutil_longs_long2bytemap_entry.getByteValue();
|
||||
long j = it_unimi_dsi_fastutil_longs_long2bytemap_entry.getLongKey();
|
||||
|
||||
- this.onLevelChange(j, b0, this.haveTicketFor(b0), b0 <= watchDistance - 2);
|
||||
+ this.onLevelChange(j, b0, b0 <= lastViewDistance - 2, this.haveTicketFor(b0)); // Paper
|
||||
}
|
||||
|
||||
- this.viewDistance = watchDistance;
|
||||
+ // this.viewDistance = watchDistance; // Paper - view distance is now set further up
|
||||
}
|
||||
|
||||
private void onLevelChange(long pos, int distance, boolean oldWithinViewDistance, boolean withinViewDistance) {
|
||||
if (oldWithinViewDistance != withinViewDistance) {
|
||||
- Ticket<?> ticket = new Ticket<>(TicketType.PLAYER, DistanceManager.PLAYER_TICKET_LEVEL, new ChunkPos(pos));
|
||||
+ ChunkPos coords = new ChunkPos(pos); // Paper - reuse variable
|
||||
+ Ticket<?> ticket = new Ticket<>(TicketType.PLAYER, DistanceManager.PLAYER_TICKET_LEVEL, coords); // Paper - reuse variable
|
||||
|
||||
if (withinViewDistance) {
|
||||
+ scheduleChunkLoad(pos, net.minecraft.server.MinecraftServer.currentTick, distance, (priority) -> { // Paper - smarter ticket delay based on frustum and distance
|
||||
+ // Paper start - recheck its still valid if not cancel
|
||||
+ if (!isChunkInRange(pos)) {
|
||||
+ DistanceManager.this.ticketThrottlerReleaser.tell(ChunkTaskPriorityQueueSorter.release(() -> {
|
||||
+ DistanceManager.this.mainThreadExecutor.execute(() -> {
|
||||
+ DistanceManager.this.removeTicket(pos, ticket);
|
||||
+ DistanceManager.this.clearPriorityTickets(coords);
|
||||
+ });
|
||||
+ }, pos, false));
|
||||
+ return;
|
||||
+ }
|
||||
+ // abort early if we got a ticket already
|
||||
+ if (hasPlayerTicket(coords, 33)) return;
|
||||
+ // skip player ticket throttle for near chunks
|
||||
+ if (priority <= 3) {
|
||||
+ DistanceManager.this.addTicket(pos, ticket);
|
||||
+ DistanceManager.this.ticketsToRelease.add(pos);
|
||||
+ return;
|
||||
+ }
|
||||
+ // Paper end
|
||||
DistanceManager.this.ticketThrottlerInput.tell(ChunkTaskPriorityQueueSorter.message(() -> {
|
||||
DistanceManager.this.mainThreadExecutor.execute(() -> {
|
||||
- if (this.haveTicketFor(this.getLevel(pos))) {
|
||||
+ if (isChunkInRange(pos)) { if (!hasPlayerTicket(coords, 33)) { // Paper - high priority might of already added it
|
||||
DistanceManager.this.addTicket(pos, ticket);
|
||||
DistanceManager.this.ticketsToRelease.add(pos);
|
||||
- } else {
|
||||
+ }} else { // Paper
|
||||
DistanceManager.this.ticketThrottlerReleaser.tell(ChunkTaskPriorityQueueSorter.release(() -> {
|
||||
}, pos, false));
|
||||
}
|
||||
|
||||
});
|
||||
}, pos, () -> {
|
||||
- return distance;
|
||||
+ return Math.min(ChunkMap.MAX_CHUNK_DISTANCE, priority); // Paper - Chunk priority
|
||||
}));
|
||||
+ }); // Paper
|
||||
} else {
|
||||
DistanceManager.this.ticketThrottlerReleaser.tell(ChunkTaskPriorityQueueSorter.release(() -> {
|
||||
DistanceManager.this.mainThreadExecutor.execute(() -> {
|
||||
DistanceManager.this.removeTicket(pos, ticket);
|
||||
+ DistanceManager.this.clearPriorityTickets(coords); // Paper - Chunk priority
|
||||
});
|
||||
}, pos, true));
|
||||
}
|
||||
@@ -612,5 +782,100 @@ public abstract class DistanceManager {
|
||||
private boolean haveTicketFor(int distance) {
|
||||
return distance <= this.viewDistance - 2;
|
||||
}
|
||||
+
|
||||
+ // Paper start - smart scheduling of player tickets
|
||||
+ private boolean isChunkInRange(long i) {
|
||||
+ return this.haveTicketFor(this.getLevel(i));
|
||||
+ }
|
||||
+ public void scheduleChunkLoad(long i, long startTick, int initialDistance, java.util.function.Consumer<Integer> task) {
|
||||
+ long elapsed = net.minecraft.server.MinecraftServer.currentTick - startTick;
|
||||
+ ChunkPos chunkPos = new ChunkPos(i);
|
||||
+ ChunkHolder updatingChunk = chunkMap.getUpdatingChunkIfPresent(i);
|
||||
+ if ((updatingChunk != null && updatingChunk.isFullChunkReady()) || !isChunkInRange(i) || getChunkPriority(chunkPos) > 0) { // Copied from above
|
||||
+ // no longer needed
|
||||
+ task.accept(1);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ int desireDelay = 0;
|
||||
+ double minDist = Double.MAX_VALUE;
|
||||
+ com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<ServerPlayer> players = chunkMap.playerViewDistanceNoTickMap.getObjectsInRange(i);
|
||||
+ if (elapsed == 0 && initialDistance <= 4) {
|
||||
+ // Aim for no delay on initial 6 chunk radius tickets save on performance of the below code to only > 6
|
||||
+ minDist = initialDistance;
|
||||
+ } else if (players != null) {
|
||||
+ Object[] backingSet = players.getBackingSet();
|
||||
+
|
||||
+ net.minecraft.core.BlockPos blockPos = chunkPos.getWorldPosition();
|
||||
+
|
||||
+ boolean isFront = false;
|
||||
+ net.minecraft.core.BlockPos.MutableBlockPos pos = new net.minecraft.core.BlockPos.MutableBlockPos();
|
||||
+ for (int index = 0, len = backingSet.length; index < len; ++index) {
|
||||
+ if (!(backingSet[index] instanceof ServerPlayer)) {
|
||||
+ continue;
|
||||
+ }
|
||||
+ ServerPlayer player = (ServerPlayer) backingSet[index];
|
||||
+
|
||||
+ ChunkPos pointInFront = player.getChunkInFront(5);
|
||||
+ pos.set(pointInFront.x << 4, 0, pointInFront.z << 4);
|
||||
+ double frontDist = net.minecraft.server.MCUtil.distanceSq(pos, blockPos);
|
||||
+
|
||||
+ pos.set(player.getX(), 0, player.getZ());
|
||||
+ double center = net.minecraft.server.MCUtil.distanceSq(pos, blockPos);
|
||||
+
|
||||
+ double dist = Math.min(frontDist, center);
|
||||
+ if (!isFront) {
|
||||
+ ChunkPos pointInBack = player.getChunkInFront(-7);
|
||||
+ pos.set(pointInBack.x << 4, 0, pointInBack.z << 4);
|
||||
+ double backDist = net.minecraft.server.MCUtil.distanceSq(pos, blockPos);
|
||||
+ if (frontDist < backDist) {
|
||||
+ isFront = true;
|
||||
+ }
|
||||
+ }
|
||||
+ if (dist < minDist) {
|
||||
+ minDist = dist;
|
||||
+ }
|
||||
+ }
|
||||
+ if (minDist == Double.MAX_VALUE) {
|
||||
+ minDist = 15;
|
||||
+ } else {
|
||||
+ minDist = Math.sqrt(minDist) / 16;
|
||||
+ }
|
||||
+ if (minDist > 4) {
|
||||
+ int desiredTimeDelayMax = isFront ?
|
||||
+ (minDist < 10 ? 7 : 15) : // Front
|
||||
+ (minDist < 10 ? 15 : 45); // Back
|
||||
+ desireDelay += (desiredTimeDelayMax * 20) * (minDist / 32);
|
||||
+ }
|
||||
+ } else {
|
||||
+ minDist = initialDistance;
|
||||
+ desireDelay = 1;
|
||||
+ }
|
||||
+ long delay = desireDelay - elapsed;
|
||||
+ if (delay <= 0 && minDist > 4 && minDist < Double.MAX_VALUE) {
|
||||
+ boolean hasAnyNeighbor = false;
|
||||
+ for (int x = -1; x <= 1; x++) {
|
||||
+ for (int z = -1; z <= 1; z++) {
|
||||
+ if (x == 0 && z == 0) continue;
|
||||
+ long pair = ChunkPos.asLong(chunkPos.x + x, chunkPos.z + z);
|
||||
+ ChunkHolder neighbor = chunkMap.getUpdatingChunkIfPresent(pair);
|
||||
+ ChunkStatus current = neighbor != null ? neighbor.getChunkHolderStatus() : null;
|
||||
+ if (current != null && current.isOrAfter(ChunkStatus.LIGHT)) {
|
||||
+ hasAnyNeighbor = true;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ if (!hasAnyNeighbor) {
|
||||
+ delay += 20;
|
||||
+ }
|
||||
+ }
|
||||
+ if (delay <= 0) {
|
||||
+ task.accept((int) minDist);
|
||||
+ } else {
|
||||
+ int taskDelay = (int) Math.min(delay, minDist >= 10 ? 40 : (minDist < 6 ? 5 : 20));
|
||||
+ net.minecraft.server.MCUtil.scheduleTask(taskDelay, () -> scheduleChunkLoad(i, startTick, initialDistance, task), "Player Ticket Delayer");
|
||||
+ }
|
||||
+ }
|
||||
+ // Paper end
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
index d56eb5071ed3ae2b9d5636cafb3aca9b2cd71d15..1e7dce9d6d665c5c72cc929084ad3bfa3c790ca5 100644
|
||||
index a66d9d6df1fc0ad68f51ea96d4e1a2d725c73b05..add33f9f0c568bbae2eb32a1b87fa8c20aaf1415 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
@@ -599,6 +599,26 @@ public class ServerChunkCache extends ChunkSource {
|
||||
@@ -601,6 +601,26 @@ public class ServerChunkCache extends ChunkSource {
|
||||
return CompletableFuture.completedFuture(either);
|
||||
}, this.mainThreadProcessor);
|
||||
}
|
||||
|
@ -1019,7 +741,7 @@ index d56eb5071ed3ae2b9d5636cafb3aca9b2cd71d15..1e7dce9d6d665c5c72cc929084ad3bfa
|
|||
// Paper end - async chunk io
|
||||
|
||||
@Nullable
|
||||
@@ -639,6 +659,8 @@ public class ServerChunkCache extends ChunkSource {
|
||||
@@ -641,6 +661,8 @@ public class ServerChunkCache extends ChunkSource {
|
||||
Objects.requireNonNull(completablefuture);
|
||||
if (!completablefuture.isDone()) { // Paper
|
||||
// Paper start - async chunk io/loading
|
||||
|
@ -1028,7 +750,7 @@ index d56eb5071ed3ae2b9d5636cafb3aca9b2cd71d15..1e7dce9d6d665c5c72cc929084ad3bfa
|
|||
this.level.asyncChunkTaskManager.raisePriority(x1, z1, com.destroystokyo.paper.io.PrioritizedTaskQueue.HIGHEST_PRIORITY);
|
||||
com.destroystokyo.paper.io.chunk.ChunkTaskManager.pushChunkWait(this.level, x1, z1);
|
||||
// Paper end
|
||||
@@ -647,6 +669,8 @@ public class ServerChunkCache extends ChunkSource {
|
||||
@@ -649,6 +671,8 @@ public class ServerChunkCache extends ChunkSource {
|
||||
chunkproviderserver_b.managedBlock(completablefuture::isDone);
|
||||
com.destroystokyo.paper.io.chunk.ChunkTaskManager.popChunkWait(); // Paper - async chunk debug
|
||||
this.level.timings.syncChunkLoad.stopTiming(); // Paper
|
||||
|
@ -1037,7 +759,7 @@ index d56eb5071ed3ae2b9d5636cafb3aca9b2cd71d15..1e7dce9d6d665c5c72cc929084ad3bfa
|
|||
} // Paper
|
||||
ichunkaccess = (ChunkAccess) ((Either) completablefuture.join()).map((ichunkaccess1) -> {
|
||||
return ichunkaccess1;
|
||||
@@ -720,10 +744,12 @@ public class ServerChunkCache extends ChunkSource {
|
||||
@@ -722,10 +746,12 @@ public class ServerChunkCache extends ChunkSource {
|
||||
if (create && !currentlyUnloading) {
|
||||
// CraftBukkit end
|
||||
this.distanceManager.addTicket(TicketType.UNKNOWN, chunkcoordintpair, l, chunkcoordintpair);
|
||||
|
@ -1050,7 +772,7 @@ index d56eb5071ed3ae2b9d5636cafb3aca9b2cd71d15..1e7dce9d6d665c5c72cc929084ad3bfa
|
|||
this.runDistanceManagerUpdates();
|
||||
playerchunk = this.getVisibleChunkIfPresent(k);
|
||||
gameprofilerfiller.pop();
|
||||
@@ -733,7 +759,13 @@ public class ServerChunkCache extends ChunkSource {
|
||||
@@ -735,7 +761,13 @@ public class ServerChunkCache extends ChunkSource {
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1065,7 +787,7 @@ index d56eb5071ed3ae2b9d5636cafb3aca9b2cd71d15..1e7dce9d6d665c5c72cc929084ad3bfa
|
|||
}
|
||||
|
||||
private boolean chunkAbsent(@Nullable ChunkHolder holder, int maxLevel) {
|
||||
@@ -785,6 +817,7 @@ public class ServerChunkCache extends ChunkSource {
|
||||
@@ -787,6 +819,7 @@ public class ServerChunkCache extends ChunkSource {
|
||||
}
|
||||
|
||||
public boolean runDistanceManagerUpdates() {
|
||||
|
@ -1074,25 +796,18 @@ index d56eb5071ed3ae2b9d5636cafb3aca9b2cd71d15..1e7dce9d6d665c5c72cc929084ad3bfa
|
|||
boolean flag1 = this.chunkMap.promoteChunkMap();
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
index beebb7a0e6b8b1fa4e7d2f9fdf1962357cc2ebc3..3e31260a3206ffe16db2e3cbc925261f78851598 100644
|
||||
index beebb7a0e6b8b1fa4e7d2f9fdf1962357cc2ebc3..42d0e3bce81b1f0ea6cb65191a87fed4054cadb4 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -185,6 +185,14 @@ public class ServerPlayer extends Player {
|
||||
@@ -185,6 +185,7 @@ public class ServerPlayer extends Player {
|
||||
private int lastRecordedArmor = Integer.MIN_VALUE;
|
||||
private int lastRecordedLevel = Integer.MIN_VALUE;
|
||||
private int lastRecordedExperience = Integer.MIN_VALUE;
|
||||
+ // Paper start - Chunk priority
|
||||
+ public long lastHighPriorityChecked;
|
||||
+ public void forceCheckHighPriority() {
|
||||
+ lastHighPriorityChecked = -1;
|
||||
+ getLevel().getChunkSource().chunkMap.checkHighPriorityChunks(this);
|
||||
+ }
|
||||
+ public boolean isRealPlayer;
|
||||
+ // Paper end
|
||||
+ public boolean isRealPlayer; // Paper - chunk priority
|
||||
private float lastSentHealth = -1.0E8F;
|
||||
private int lastSentFood = -99999999;
|
||||
private boolean lastFoodSaturationZero = true;
|
||||
@@ -327,6 +335,21 @@ public class ServerPlayer extends Player {
|
||||
@@ -327,6 +328,21 @@ public class ServerPlayer extends Player {
|
||||
this.maxHealthCache = this.getMaxHealth();
|
||||
this.cachedSingleMobDistanceMap = new com.destroystokyo.paper.util.PooledHashSets.PooledObjectLinkedOpenHashSet<>(this); // Paper
|
||||
}
|
||||
|
@ -1114,16 +829,8 @@ index beebb7a0e6b8b1fa4e7d2f9fdf1962357cc2ebc3..3e31260a3206ffe16db2e3cbc925261f
|
|||
|
||||
// Yes, this doesn't match Vanilla, but it's the best we can do for now.
|
||||
// If this is an issue, PRs are welcome
|
||||
@@ -649,6 +672,7 @@ public class ServerPlayer extends Player {
|
||||
if (valid && !this.isSpectator() || !this.touchingUnloadedChunk()) { // Paper - don't tick dead players that are not in the world currently (pending respawn)
|
||||
super.tick();
|
||||
}
|
||||
+ if (valid && isAlive() && connection != null) ((ServerLevel)level).getChunkSource().chunkMap.checkHighPriorityChunks(this); // Paper - Chunk priority
|
||||
|
||||
for (int i = 0; i < this.getInventory().getContainerSize(); ++i) {
|
||||
ItemStack itemstack = this.getInventory().getItem(i);
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ThreadedLevelLightEngine.java b/src/main/java/net/minecraft/server/level/ThreadedLevelLightEngine.java
|
||||
index 55ac6421e43a488ebb5b070babdd1071ad3950a6..bc2ac01fb4617aa6abfd6db31980d56b53a660b5 100644
|
||||
index c0ef95f83f2d13025bedd4bcc7e177cee66b5470..fec2a2a9f958492eefbbffcaf8179a2fac5a4d99 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ThreadedLevelLightEngine.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ThreadedLevelLightEngine.java
|
||||
@@ -1,6 +1,7 @@
|
||||
|
@ -1421,19 +1128,20 @@ index 78fbb4c3e52e900956ae0811aaf934c81ee5ea48..23d13600d6925f6746dfde08e17ba578
|
|||
private final String name;
|
||||
private final Comparator<T> comparator;
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 0bcafeb8008bd2556bcdc556b17d00ff936d7aa9..935bdd3ece5b684cbaa14ef3211239fe9722ad2f 100644
|
||||
index 0bcafeb8008bd2556bcdc556b17d00ff936d7aa9..f9733ec478fe5aa0fa678a5f4482ab6e7045c033 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -1551,6 +1551,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||
@@ -1550,7 +1550,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||
// CraftBukkit end
|
||||
|
||||
this.awaitingTeleportTime = this.tickCount;
|
||||
this.player.absMoveTo(d0, d1, d2, f, f1);
|
||||
+ this.player.forceCheckHighPriority(); // Paper
|
||||
- this.player.absMoveTo(d0, d1, d2, f, f1);
|
||||
+ this.player.moveTo(d0, d1, d2, f, f1); // Paper - use proper setPositionRotation for teleportation
|
||||
this.player.connection.send(new ClientboundPlayerPositionPacket(d0 - d3, d1 - d4, d2 - d5, f - f2, f1 - f3, set, this.awaitingTeleport, flag));
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index 0ac5ba6bc7b582d1ab02a90c9418c9b899175d93..8dd698a9b0cc7b6143996c90197ebc2d4fc9951d 100644
|
||||
index 4710c9d12feb12b75c497373c172ce0d4f4ab96e..338e89a2951f6f79d4dd7abf0b378b6e2ddf1f58 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -175,6 +175,7 @@ public abstract class PlayerList {
|
||||
|
@ -1455,16 +1163,8 @@ index 0ac5ba6bc7b582d1ab02a90c9418c9b899175d93..8dd698a9b0cc7b6143996c90197ebc2d
|
|||
net.minecraft.server.level.ChunkHolder updatingChunk = playerChunkMap.getUpdatingChunkIfPresent(pos.toLong());
|
||||
if (updatingChunk != null) {
|
||||
return updatingChunk.getEntityTickingChunkFuture();
|
||||
@@ -892,6 +893,7 @@ public abstract class PlayerList {
|
||||
entityplayer1.forceSetPositionRotation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
|
||||
// CraftBukkit end
|
||||
|
||||
+ entityplayer1.forceCheckHighPriority(); // Player - Chunk priority
|
||||
while (avoidSuffocation && !worldserver1.noCollision(entityplayer1) && entityplayer1.getY() < (double) worldserver1.getMaxBuildHeight()) {
|
||||
entityplayer1.setPos(entityplayer1.getX(), entityplayer1.getY() + 1.0D, entityplayer1.getZ());
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 91e034f54deb2aa084527aaa001e48ddcc2e9cd1..b8db2dad1ccd1afce01fd770650fe5f0afc40bce 100644
|
||||
index b61f728c83e006197fdb158e83d04b5498133cc3..a6e732274018cf4864a0a3e3258bf0381f3a0c79 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -222,7 +222,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
|
||||
|
@ -1477,7 +1177,7 @@ index 91e034f54deb2aa084527aaa001e48ddcc2e9cd1..b8db2dad1ccd1afce01fd770650fe5f0
|
|||
public float yRotO;
|
||||
public float xRotO;
|
||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
index c76e46afa685fbaa5c83aff4ef72b5fe32bc6d10..ccd12f130d32c95b191073bfd59e60223394c30b 100644
|
||||
index b92da719a5d35a60a2e13ccb0f55c41b242f9b50..875977f11678b34465abac30463675f57cf9fc4e 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
@@ -137,7 +137,7 @@ public class LevelChunk extends ChunkAccess {
|
||||
|
@ -1489,7 +1189,7 @@ index c76e46afa685fbaa5c83aff4ef72b5fe32bc6d10..ccd12f130d32c95b191073bfd59e6022
|
|||
private long neighbourChunksLoadedBitset;
|
||||
private final LevelChunk[] loadedNeighbourChunks = new LevelChunk[(NEIGHBOUR_CACHE_RADIUS * 2 + 1) * (NEIGHBOUR_CACHE_RADIUS * 2 + 1)];
|
||||
|
||||
@@ -674,6 +674,7 @@ public class LevelChunk extends ChunkAccess {
|
||||
@@ -675,6 +675,7 @@ public class LevelChunk extends ChunkAccess {
|
||||
|
||||
// CraftBukkit start
|
||||
public void loadCallback() {
|
||||
|
@ -1497,7 +1197,7 @@ index c76e46afa685fbaa5c83aff4ef72b5fe32bc6d10..ccd12f130d32c95b191073bfd59e6022
|
|||
// Paper start - neighbour cache
|
||||
int chunkX = this.chunkPos.x;
|
||||
int chunkZ = this.chunkPos.z;
|
||||
@@ -728,6 +729,7 @@ public class LevelChunk extends ChunkAccess {
|
||||
@@ -729,6 +730,7 @@ public class LevelChunk extends ChunkAccess {
|
||||
}
|
||||
|
||||
public void unloadCallback() {
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Move range check for block placing up
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 0bcafeb8008bd2556bcdc556b17d00ff936d7aa9..26bd27d3dd6e99488fd0a77257866b1eb1b191b8 100644
|
||||
index f9733ec478fe5aa0fa678a5f4482ab6e7045c033..851bbe0bab26f39f19aa85cb2779fb06c77f7e46 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -1666,6 +1666,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
|
@ -10,7 +10,7 @@ This fixes that by checking if the modified spawn location is
|
|||
still at a respawn anchor.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index 4710c9d12feb12b75c497373c172ce0d4f4ab96e..724c503da333ac4dd8ed865ba48cac9dcb1a0da8 100644
|
||||
index 338e89a2951f6f79d4dd7abf0b378b6e2ddf1f58..2320731041fdef4eb29888a55e11126fb345d9ea 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -78,6 +78,7 @@ import net.minecraft.world.level.GameRules;
|
||||
|
@ -21,7 +21,7 @@ index 4710c9d12feb12b75c497373c172ce0d4f4ab96e..724c503da333ac4dd8ed865ba48cac9d
|
|||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.border.BorderChangeListener;
|
||||
import net.minecraft.world.level.border.WorldBorder;
|
||||
@@ -828,6 +829,7 @@ public abstract class PlayerList {
|
||||
@@ -829,6 +830,7 @@ public abstract class PlayerList {
|
||||
// Paper start
|
||||
boolean isBedSpawn = false;
|
||||
boolean isRespawn = false;
|
||||
|
@ -29,7 +29,7 @@ index 4710c9d12feb12b75c497373c172ce0d4f4ab96e..724c503da333ac4dd8ed865ba48cac9d
|
|||
// Paper end
|
||||
|
||||
// CraftBukkit start - fire PlayerRespawnEvent
|
||||
@@ -838,7 +840,7 @@ public abstract class PlayerList {
|
||||
@@ -839,7 +841,7 @@ public abstract class PlayerList {
|
||||
Optional optional;
|
||||
|
||||
if (blockposition != null) {
|
||||
|
@ -38,7 +38,7 @@ index 4710c9d12feb12b75c497373c172ce0d4f4ab96e..724c503da333ac4dd8ed865ba48cac9d
|
|||
} else {
|
||||
optional = Optional.empty();
|
||||
}
|
||||
@@ -882,7 +884,12 @@ public abstract class PlayerList {
|
||||
@@ -883,7 +885,12 @@ public abstract class PlayerList {
|
||||
}
|
||||
// Spigot End
|
||||
|
||||
|
@ -52,7 +52,7 @@ index 4710c9d12feb12b75c497373c172ce0d4f4ab96e..724c503da333ac4dd8ed865ba48cac9d
|
|||
if (!flag) entityplayer.reset(); // SPIGOT-4785
|
||||
isRespawn = true; // Paper
|
||||
} else {
|
||||
@@ -920,8 +927,12 @@ public abstract class PlayerList {
|
||||
@@ -921,8 +928,12 @@ public abstract class PlayerList {
|
||||
}
|
||||
// entityplayer1.initInventoryMenu();
|
||||
entityplayer1.setHealth(entityplayer1.getHealth());
|
|
@ -6,10 +6,10 @@ Subject: [PATCH] Add missing strikeLighting call to
|
|||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index 3bc98586792960f50ca25929f1d91fc60a8577ce..5bf060d5b4a22d0fea0c70513d9b0914614e5bbb 100644
|
||||
index ea4e897e04de9474abec5f6d0819bff4471b51ee..3ed68022c06a6b0d9b1d98fcdf64c2c4ba42480e 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -1994,6 +1994,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@@ -2000,6 +2000,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
lightning.moveTo( loc.getX(), loc.getY(), loc.getZ() );
|
||||
lightning.visualOnly = true;
|
||||
lightning.isSilent = isSilent;
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Brand support
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 26bd27d3dd6e99488fd0a77257866b1eb1b191b8..c5fc4a2470093202f38472df84355ba0404645c5 100644
|
||||
index 851bbe0bab26f39f19aa85cb2779fb06c77f7e46..77c98907372faa4b9dc0cfb11ceed82e03d7b6eb 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -4,6 +4,7 @@ import com.google.common.collect.Lists;
|
||||
|
@ -72,10 +72,10 @@ index 26bd27d3dd6e99488fd0a77257866b1eb1b191b8..c5fc4a2470093202f38472df84355ba0
|
|||
return (!this.player.joining && !this.connection.isConnected()) || this.processedDisconnect; // Paper
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index ac535aef823ebe286847dafb8b0678de5d3128a1..465961e0e21fe15c366a492a1de94c6da7bbc51c 100644
|
||||
index e8f487d8338f1ef0b68150c30dcab5f9b3140e7d..d99000543d880c3d9904e84059cf9ecf89fb8ac8 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -2482,6 +2482,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -2492,6 +2492,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
// Paper end
|
||||
};
|
||||
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Add #setMaxPlayers API
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index 724c503da333ac4dd8ed865ba48cac9dcb1a0da8..b797b41c55d4a96fecd50b4bd0cde47b0a2b29a7 100644
|
||||
index 2320731041fdef4eb29888a55e11126fb345d9ea..310bed27c04ef812aa8607c9dca789db13341d25 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -144,7 +144,7 @@ public abstract class PlayerList {
|
|
@ -17,7 +17,7 @@ index cda574e825164587bd126029d5b556c049c18015..01b4bd2176b751f895e39002f105a171
|
|||
// if this keepSpawnInMemory is false a plugin has already removed our tickets, do not re-add
|
||||
this.removeTicketsForSpawn(this.paperConfig.keepLoadedRange, prevSpawn);
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index 5bf060d5b4a22d0fea0c70513d9b0914614e5bbb..9e155f0a76014e84106d9e322016d36a2254f62a 100644
|
||||
index 3ed68022c06a6b0d9b1d98fcdf64c2c4ba42480e..85b688ee046c160f689495d97e2c48bef4ad6cdb 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -245,11 +245,13 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Add moon phase API
|
|||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index 9e155f0a76014e84106d9e322016d36a2254f62a..1f12da32b5bc10f77a5b8f4a9b32cbb89d7f2968 100644
|
||||
index 85b688ee046c160f689495d97e2c48bef4ad6cdb..b2efce98e8d6f5297646e4f270bc2d5cc7e182f0 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -183,6 +183,11 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
|
@ -42,7 +42,7 @@ index eb99e0c2462a2d1ab4508a5c3f1580b6e31d7465..c536eceef3365a7b726cd970df345ba1
|
|||
|
||||
public net.minecraft.world.item.enchantment.Enchantment getHandle() {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
index 0bb3290f3ff23d7f653ce87943d7c6d156770926..b3afb10f96e0662714ff89244132a6df8bbd3769 100644
|
||||
index a849724a9fb642bcd4de3c6438937adc882c610e..1380df5f70f9284b47b9e6426672d82df384b2c0 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
@@ -442,6 +442,30 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
|
@ -9,7 +9,7 @@ as this is how Vanilla teleports entities.
|
|||
Cancel any pending motion when teleported.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index c5fc4a2470093202f38472df84355ba0404645c5..2074760beee6fdc2e94bb0f5dcfbae7b5813e8c9 100644
|
||||
index 77c98907372faa4b9dc0cfb11ceed82e03d7b6eb..2074760beee6fdc2e94bb0f5dcfbae7b5813e8c9 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -680,7 +680,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||
|
@ -21,17 +21,8 @@ index c5fc4a2470093202f38472df84355ba0404645c5..2074760beee6fdc2e94bb0f5dcfbae7b
|
|||
this.lastGoodX = this.awaitingPositionFromClient.x;
|
||||
this.lastGoodY = this.awaitingPositionFromClient.y;
|
||||
this.lastGoodZ = this.awaitingPositionFromClient.z;
|
||||
@@ -1554,7 +1554,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||
// CraftBukkit end
|
||||
|
||||
this.awaitingTeleportTime = this.tickCount;
|
||||
- this.player.absMoveTo(d0, d1, d2, f, f1);
|
||||
+ this.player.moveTo(d0, d1, d2, f, f1); // Paper - use proper setPositionRotation for teleportation
|
||||
this.player.connection.send(new ClientboundPlayerPositionPacket(d0 - d3, d1 - d4, d2 - d5, f - f2, f1 - f3, set, this.awaitingTeleport, flag));
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index b61f728c83e006197fdb158e83d04b5498133cc3..a7dfb3e53b3618b7071ee9840906debade1c5f83 100644
|
||||
index a6e732274018cf4864a0a3e3258bf0381f3a0c79..dc34a9140811858ac6fc6d03b7c63aac81e67ab9 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -150,6 +150,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
|
|
@ -6,7 +6,7 @@ Subject: [PATCH] Extend block drop capture to capture all items added to the
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index f9daa7183e29d203e73b242c285d10cda44aab11..bc57099ffc447a713b92896a1348728702ef51b2 100644
|
||||
index 01b4bd2176b751f895e39002f105a171a32d65af..5c236b0330b298bcae61112409a4a6c7f51d0530 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -1226,6 +1226,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
|
@ -5,10 +5,10 @@ Subject: [PATCH] Don't mark dirty in invalid locations (SPIGOT-6086)
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
||||
index 26a787864058dccc0365680b0259ddf0dad22b58..292a26a2e13d97e4796bfe00c4d5789f94e67cc1 100644
|
||||
index d03aeed657fc7e427d847e0b8e2d58c59e6851fa..3d38a5cd7db0436b4d3fe6b3476025b30d5186dc 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
||||
@@ -206,6 +206,7 @@ public class ChunkHolder {
|
||||
@@ -207,6 +207,7 @@ public class ChunkHolder {
|
||||
}
|
||||
|
||||
public void blockChanged(BlockPos pos) {
|
|
@ -6,7 +6,7 @@ Subject: [PATCH] Expose the Entity Counter to allow plugins to use valid and
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index a7dfb3e53b3618b7071ee9840906debade1c5f83..b5d3032ce9f711ff2843b2c22ad2b4aa2c147504 100644
|
||||
index dc34a9140811858ac6fc6d03b7c63aac81e67ab9..f8c268fc2986eb5de7b4ffed39cbde0eb1c2ca5d 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -3927,4 +3927,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Entity#isTicking
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index b5d3032ce9f711ff2843b2c22ad2b4aa2c147504..a6ca13b92b81f5fe7a8d9d65476b0e032a8a029b 100644
|
||||
index f8c268fc2986eb5de7b4ffed39cbde0eb1c2ca5d..8e3c69e53af1e79da5fd96d722fe08e49923113f 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -52,6 +52,7 @@ import net.minecraft.network.syncher.SynchedEntityData;
|
|
@ -7,7 +7,7 @@ if multiple threads from worldgen sort at same time, it will crash.
|
|||
So make a copy of the list for sorting purposes.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/GateBehavior.java b/src/main/java/net/minecraft/world/entity/ai/behavior/GateBehavior.java
|
||||
index 893c37cc7e33f4baa98131afca45a258600ddc75..09998d160a6d79fdb5a5041a5d572649a1532e6a 100644
|
||||
index c1f22c5e17418f91736237af1495a8a9910a61d5..e644bdd3a6f7c09a44149da03587b796674fa568 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/GateBehavior.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/GateBehavior.java
|
||||
@@ -16,7 +16,7 @@ public class GateBehavior<E extends LivingEntity> extends Behavior<E> {
|
|
@ -10,7 +10,7 @@ In general, look at making this logic more robust (i.e properly handling
|
|||
cases where a captured entry is overriden) - but for now this will do.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index 4f97f11c248cbb06dbd604da0e88d9570e641af7..c68cb2ee352325d3f0ef98827df04b0c7bf1b293 100644
|
||||
index 0bcb14f1377d603c93c471ce206d2e38d0278b60..5ca6254d104fbd407a98daf732dd6ac119914ee3 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -149,7 +149,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Reduce blockpos allocation from pathfinding
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java b/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java
|
||||
index c33fda773ec071d27e924461a30a2938db35c231..46d3640b6556a104889f1d57e61d60b5094c28f2 100644
|
||||
index 16b3b4a168e37f0b4c8d6c41a4e3a4095f26115e..5e28c09d782166be6d0fbc6778ef9f6c4d7af409 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java
|
||||
@@ -471,7 +471,7 @@ public class WalkNodeEvaluator extends NodeEvaluator {
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Player elytra boost API
|
|||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 465961e0e21fe15c366a492a1de94c6da7bbc51c..bb3e706aae719c8cff904425c09cc3b0f82534f1 100644
|
||||
index d99000543d880c3d9904e84059cf9ecf89fb8ac8..26fe2e651d7432591bd5ef910e6db06ba214fd4f 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -562,6 +562,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|
@ -15,7 +15,7 @@ manually reload the advancement data for all players, which
|
|||
normally takes place as a part of the datapack reloading.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
index e28bb9f0f27d2d7347f48891256ac8225e1e1459..29d079927ac5f48f14e6f41a32b03174cc622dda 100644
|
||||
index 33b85d2cd6be32d70a9621c02666e297fc78ff97..463cabee7f4f40f2f8d4f4502296d1abfff18229 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
@@ -323,7 +323,13 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
|
@ -25,10 +25,10 @@ index d30bc3f1da336b421d9a42070184e07169dd14e4..a6eadf71957b37e2acc5d09f0ce4ee96
|
|||
Connection.LOGGER.debug("Failed to sent packet", throwable);
|
||||
ConnectionProtocol enumprotocol = this.getCurrentProtocol();
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
index beebb7a0e6b8b1fa4e7d2f9fdf1962357cc2ebc3..207c566603671685f7d0abbb11274d2027568a05 100644
|
||||
index 42d0e3bce81b1f0ea6cb65191a87fed4054cadb4..8932fb6ab89e4de71661c0eec8397350ea4ce6f6 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -254,6 +254,7 @@ public class ServerPlayer extends Player {
|
||||
@@ -255,6 +255,7 @@ public class ServerPlayer extends Player {
|
||||
public PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper
|
||||
|
||||
public final com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<ServerPlayer> cachedSingleHashSet; // Paper
|
||||
|
@ -49,10 +49,10 @@ index 2dd47eab63cf9322a5844e748709e220272a8cfe..c0a685cfe62aeda3583763ecc1e4fa12
|
|||
this.connection.disconnect(ichatbasecomponent);
|
||||
});
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index b797b41c55d4a96fecd50b4bd0cde47b0a2b29a7..d637f092f6e615bedf8fb206e172302052547566 100644
|
||||
index 310bed27c04ef812aa8607c9dca789db13341d25..6aaa5174bb0eff3216667b4c8d3912d02e1c66e2 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -594,7 +594,7 @@ public abstract class PlayerList {
|
||||
@@ -595,7 +595,7 @@ public abstract class PlayerList {
|
||||
entityplayer.closeContainer(org.bukkit.event.inventory.InventoryCloseEvent.Reason.DISCONNECT); // Paper
|
||||
}
|
||||
|
|
@ -5,10 +5,10 @@ Subject: [PATCH] Expose world spawn angle
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index d637f092f6e615bedf8fb206e172302052547566..d0c90c15a068a17dcafd5df9962e84ef27e021b5 100644
|
||||
index 6aaa5174bb0eff3216667b4c8d3912d02e1c66e2..388e02966660b42d812a89ad290a4b94b450b5fe 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -872,7 +872,7 @@ public abstract class PlayerList {
|
||||
@@ -873,7 +873,7 @@ public abstract class PlayerList {
|
||||
if (location == null) {
|
||||
worldserver1 = this.server.getLevel(Level.OVERWORLD);
|
||||
blockposition = entityplayer1.getSpawnPoint(worldserver1);
|
||||
|
@ -18,7 +18,7 @@ index d637f092f6e615bedf8fb206e172302052547566..d0c90c15a068a17dcafd5df9962e84ef
|
|||
|
||||
Player respawnPlayer = entityplayer1.getBukkitEntity();
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index 1f12da32b5bc10f77a5b8f4a9b32cbb89d7f2968..48557c6fdf9ffcce52713fc47ccf0ac9a9f73d0d 100644
|
||||
index b2efce98e8d6f5297646e4f270bc2d5cc7e182f0..4e6d24ce3e14ad56b2e926d6b4aea36f882f5bf3 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -236,7 +236,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
|
@ -5,10 +5,10 @@ Subject: [PATCH] Fix Player spawnParticle x/y/z precision loss
|
|||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index bb3e706aae719c8cff904425c09cc3b0f82534f1..f4a94bc00a8318af810c3c859decbf88decfa98d 100644
|
||||
index 26fe2e651d7432591bd5ef910e6db06ba214fd4f..f4e5e1029eefd4a951b8e8ab291a2b94e4c96936 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -2069,7 +2069,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -2079,7 +2079,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
if (data != null && !particle.getDataType().isInstance(data)) {
|
||||
throw new IllegalArgumentException("data should be " + particle.getDataType() + " got " + data.getClass());
|
||||
}
|
|
@ -21,7 +21,7 @@ index 5c22b8993385c1e6c72fe1fbd5f14c76253eec74..0759b9dbd37ca640b7fe410e0ecb6519
|
|||
private void keepLoadedRange() {
|
||||
keepLoadedRange = (short) (getInt("keep-spawn-loaded-range", Math.min(spigotConfig.viewDistance, 10)) * 16);
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index a6ca13b92b81f5fe7a8d9d65476b0e032a8a029b..e12eb951d52d4bfa30e1d25139444d7663d3b946 100644
|
||||
index 8e3c69e53af1e79da5fd96d722fe08e49923113f..3a3f756ad620763ac63490e76200635b88df24df 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -1698,6 +1698,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
|
|
@ -43,7 +43,7 @@ index b30c08bfb8c55161543a4ef09f2e462e0a1fe4ae..ec93f5300cc7d423ec0d292f0f8443f9
|
|||
|
||||
public Vec3 updateEntityPosition(Vec3 orig) {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index e12eb951d52d4bfa30e1d25139444d7663d3b946..b3ba775d4c4674dc8cd85145cacf9ca93737fe04 100644
|
||||
index 3a3f756ad620763ac63490e76200635b88df24df..4fb76a37e73f8186341629a77ad0bbf12bec133d 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -3746,6 +3746,16 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
|
|
@ -5,10 +5,10 @@ Subject: [PATCH] Player Chunk Load/Unload Events
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
index 207c566603671685f7d0abbb11274d2027568a05..6166d1ce68742fbcb365c59cd44a611addbe2f8c 100644
|
||||
index 8932fb6ab89e4de71661c0eec8397350ea4ce6f6..820e634abadca014baf11387865118e834859f7a 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -2091,11 +2091,21 @@ public class ServerPlayer extends Player {
|
||||
@@ -2107,11 +2107,21 @@ public class ServerPlayer extends Player {
|
||||
|
||||
public void trackChunk(ChunkPos chunkPos, Packet<?> chunkDataPacket) {
|
||||
this.connection.send(chunkDataPacket);
|
|
@ -64,7 +64,7 @@ index 888d812118c15c212284687ae5842a94f5715d52..e7ca5d6fb8922e7e8065864f736b0605
|
|||
|
||||
public int get() {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index 48557c6fdf9ffcce52713fc47ccf0ac9a9f73d0d..6835fc0fa6aba42edb5b78bcbe46fdc20af5f288 100644
|
||||
index 4e6d24ce3e14ad56b2e926d6b4aea36f882f5bf3..77bbac3a5d98083589a54d03964d14be2d15df95 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -1733,8 +1733,13 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue