@@ -297,7 +297,7 @@ index 0000000000000000000000000000000000000000..fff7a796a61542213bdaa417d44e25cd
297297+ }
298298+}
299299diff --git a/ca/spottedleaf/moonrise/paper/PaperHooks.java b/ca/spottedleaf/moonrise/paper/PaperHooks.java
300- index 4a62c50d0b4fe82c3aacaa56b303b9699120c778..92238518c25dd765b356ff628fd373997464ea82 100644
300+ index aa14dd369d5d2c5c843839f289afdc39c200f0c3..76f990f150f040b1ad6d7d5b91cfb34ebd6f436a 100644
301301--- a/ca/spottedleaf/moonrise/paper/PaperHooks.java
302302+++ b/ca/spottedleaf/moonrise/paper/PaperHooks.java
303303@@ -13,6 +13,7 @@ import net.minecraft.server.level.ChunkHolder;
@@ -25232,10 +25232,10 @@ index e3df851be4b31950018406dfa74f06635d636f51..cd5a325d37f617431ceb568a65570160
2523225232
2523325233 @FunctionalInterface
2523425234diff --git a/net/minecraft/server/level/ChunkMap.java b/net/minecraft/server/level/ChunkMap.java
25235- index a71bb2cb640b9e94386643a439e3d731417fc24c..0a60283625536515bfcf6c2a09ca0f4771d6b142 100644
25235+ index a8e52743529e26949dcb855a7c639c7c7185f8a1..4b9f128c3a3938ae3b0468b67367d2cacf5ce648 100644
2523625236--- a/net/minecraft/server/level/ChunkMap.java
2523725237+++ b/net/minecraft/server/level/ChunkMap.java
25238- @@ -124 ,10 +124 ,7 @@ public class ChunkMap extends SimpleRegionStorage implements ChunkHolder.PlayerP
25238+ @@ -126 ,10 +126 ,7 @@ public class ChunkMap extends SimpleRegionStorage implements ChunkHolder.PlayerP
2523925239 public static final int MIN_VIEW_DISTANCE = 2;
2524025240 public static final int MAX_VIEW_DISTANCE = 32;
2524125241 public static final int FORCED_TICKET_LEVEL = ChunkLevel.byStatus(FullChunkStatus.ENTITY_TICKING);
@@ -25247,7 +25247,7 @@ index a71bb2cb640b9e94386643a439e3d731417fc24c..0a60283625536515bfcf6c2a09ca0f47
2524725247 public final ServerLevel level;
2524825248 private final ThreadedLevelLightEngine lightEngine;
2524925249 private final BlockableEventLoop<Runnable> mainThreadExecutor;
25250- @@ -137 ,19 +134 ,15 @@ public class ChunkMap extends SimpleRegionStorage implements ChunkHolder.PlayerP
25250+ @@ -139 ,19 +136 ,15 @@ public class ChunkMap extends SimpleRegionStorage implements ChunkHolder.PlayerP
2525125251 private final PoiManager poiManager;
2525225252 public final LongSet toDrop = new LongOpenHashSet();
2525325253 private boolean modified;
@@ -25270,7 +25270,7 @@ index a71bb2cb640b9e94386643a439e3d731417fc24c..0a60283625536515bfcf6c2a09ca0f47
2527025270
2527125271 // CraftBukkit start - recursion-safe executor for Chunk loadCallback() and unloadCallback()
2527225272 public final CallbackExecutor callbackExecutor = new CallbackExecutor();
25273- @@ -174 ,7 +167 ,7 @@ public class ChunkMap extends SimpleRegionStorage implements ChunkHolder.PlayerP
25273+ @@ -176 ,7 +169 ,7 @@ public class ChunkMap extends SimpleRegionStorage implements ChunkHolder.PlayerP
2527425274
2527525275 // Paper start
2527625276 public final ChunkHolder getUnloadingChunkHolder(int chunkX, int chunkZ) {
@@ -25279,7 +25279,7 @@ index a71bb2cb640b9e94386643a439e3d731417fc24c..0a60283625536515bfcf6c2a09ca0f47
2527925279 }
2528025280 // Paper end
2528125281
25282- @@ -222 ,9 +215 ,9 @@ public class ChunkMap extends SimpleRegionStorage implements ChunkHolder.PlayerP
25282+ @@ -224 ,9 +217 ,9 @@ public class ChunkMap extends SimpleRegionStorage implements ChunkHolder.PlayerP
2528325283 ConsecutiveExecutor worldgen = new ConsecutiveExecutor(executor, "worldgen");
2528425284 this.chunkStatusListener = chunkStatusListener;
2528525285 ConsecutiveExecutor light = new ConsecutiveExecutor(executor, "light");
@@ -25292,7 +25292,7 @@ index a71bb2cb640b9e94386643a439e3d731417fc24c..0a60283625536515bfcf6c2a09ca0f47
2529225292 this.distanceManager = new ChunkMap.DistanceManager(ticketStorage, executor, mainThreadExecutor);
2529325293 this.ticketStorage = ticketStorage;
2529425294 this.poiManager = new PoiManager(
25295- @@ -237 ,11 +230 ,11 @@ public class ChunkMap extends SimpleRegionStorage implements ChunkHolder.PlayerP
25295+ @@ -239 ,11 +232 ,11 @@ public class ChunkMap extends SimpleRegionStorage implements ChunkHolder.PlayerP
2529625296 level
2529725297 );
2529825298 this.setServerViewDistance(serverViewDistance);
@@ -25306,7 +25306,7 @@ index a71bb2cb640b9e94386643a439e3d731417fc24c..0a60283625536515bfcf6c2a09ca0f47
2530625306 }
2530725307
2530825308 // Paper start
25309- @@ -263 ,23 +256 ,11 @@ public class ChunkMap extends SimpleRegionStorage implements ChunkHolder.PlayerP
25309+ @@ -265 ,23 +258 ,11 @@ public class ChunkMap extends SimpleRegionStorage implements ChunkHolder.PlayerP
2531025310 }
2531125311
2531225312 public boolean isChunkTracked(final ServerPlayer player, final int chunkX, final int chunkZ) {
@@ -25332,7 +25332,7 @@ index a71bb2cb640b9e94386643a439e3d731417fc24c..0a60283625536515bfcf6c2a09ca0f47
2533225332 }
2533325333
2533425334 protected ThreadedLevelLightEngine getLightEngine() {
25335- @@ -287 ,11 +268 ,17 @@ public class ChunkMap extends SimpleRegionStorage implements ChunkHolder.PlayerP
25335+ @@ -289 ,11 +270 ,17 @@ public class ChunkMap extends SimpleRegionStorage implements ChunkHolder.PlayerP
2533625336 }
2533725337
2533825338 public @Nullable ChunkHolder getUpdatingChunkIfPresent(final long key) {
@@ -25352,7 +25352,7 @@ index a71bb2cb640b9e94386643a439e3d731417fc24c..0a60283625536515bfcf6c2a09ca0f47
2535225352 }
2535325353
2535425354 public @Nullable ChunkStatus getLatestStatus(final long key) {
25355- @@ -300 ,12 +287 ,7 @@ public class ChunkMap extends SimpleRegionStorage implements ChunkHolder.PlayerP
25355+ @@ -302 ,12 +289 ,7 @@ public class ChunkMap extends SimpleRegionStorage implements ChunkHolder.PlayerP
2535625356 }
2535725357
2535825358 protected IntSupplier getChunkQueueLevel(final long pos) {
@@ -25366,7 +25366,7 @@ index a71bb2cb640b9e94386643a439e3d731417fc24c..0a60283625536515bfcf6c2a09ca0f47
2536625366 }
2536725367
2536825368 public String getChunkDebugData(final ChunkPos pos) {
25369- @@ -333 ,47 +315 ,7 @@ public class ChunkMap extends SimpleRegionStorage implements ChunkHolder.PlayerP
25369+ @@ -335 ,47 +317 ,7 @@ public class ChunkMap extends SimpleRegionStorage implements ChunkHolder.PlayerP
2537025370 CompletableFuture<ChunkResult<List<ChunkAccess>>> getChunkRangeFuture(
2537125371 final ChunkHolder centerChunk, final int range, final IntFunction<ChunkStatus> distanceToStatus
2537225372 ) {
@@ -25415,7 +25415,7 @@ index a71bb2cb640b9e94386643a439e3d731417fc24c..0a60283625536515bfcf6c2a09ca0f47
2541525415 }
2541625416
2541725417 public ReportedException debugFuturesAndCreateReportedException(final IllegalStateException exception, final String details) {
25418- @@ -397 ,92 +339 ,28 @@ public class ChunkMap extends SimpleRegionStorage implements ChunkHolder.PlayerP
25418+ @@ -399 ,92 +341 ,28 @@ public class ChunkMap extends SimpleRegionStorage implements ChunkHolder.PlayerP
2541925419 }
2542025420
2542125421 public CompletableFuture<ChunkResult<LevelChunk>> prepareEntityTickingChunk(final ChunkHolder chunk) {
@@ -25517,7 +25517,7 @@ index a71bb2cb640b9e94386643a439e3d731417fc24c..0a60283625536515bfcf6c2a09ca0f47
2551725517 }
2551825518
2551925519 protected void tick(final BooleanSupplier haveTime) {
25520- @@ -498 ,129 +376 ,28 @@ public class ChunkMap extends SimpleRegionStorage implements ChunkHolder.PlayerP
25520+ @@ -500 ,129 +378 ,28 @@ public class ChunkMap extends SimpleRegionStorage implements ChunkHolder.PlayerP
2552125521 }
2552225522
2552325523 public boolean hasWork() {
@@ -25654,7 +25654,7 @@ index a71bb2cb640b9e94386643a439e3d731417fc24c..0a60283625536515bfcf6c2a09ca0f47
2565425654 }
2565525655
2565625656 private ChunkAccess handleChunkLoadFailure(final Throwable throwable, final ChunkPos pos) {
25657- @@ -658 ,231 +435 ,139 @@ public class ChunkMap extends SimpleRegionStorage implements ChunkHolder.PlayerP
25657+ @@ -660 ,231 +437 ,139 @@ public class ChunkMap extends SimpleRegionStorage implements ChunkHolder.PlayerP
2565825658
2565925659 @Override
2566025660 public GenerationChunkHolder acquireGeneration(final long chunkNode) {
@@ -25959,7 +25959,7 @@ index a71bb2cb640b9e94386643a439e3d731417fc24c..0a60283625536515bfcf6c2a09ca0f47
2595925959 public @Nullable LevelChunk getChunkToSend(final long key) {
2596025960 ChunkHolder chunkHolder = this.getVisibleChunkIfPresent(key);
2596125961 return chunkHolder == null ? null : chunkHolder.getChunkToSend();
25962- @@ -964 ,7 +649 ,7 @@ public class ChunkMap extends SimpleRegionStorage implements ChunkHolder.PlayerP
25962+ @@ -966 ,7 +651 ,7 @@ public class ChunkMap extends SimpleRegionStorage implements ChunkHolder.PlayerP
2596325963 return this.read(pos).thenApplyAsync(chunkTag -> chunkTag.map(this::upgradeChunkTag), Util.backgroundExecutor().forName("upgradeChunk"));
2596425964 }
2596525965
@@ -25968,7 +25968,7 @@ index a71bb2cb640b9e94386643a439e3d731417fc24c..0a60283625536515bfcf6c2a09ca0f47
2596825968 return this.upgradeChunkTag(
2596925969 tag,
2597025970 -1,
25971- @@ -981 ,23 +666 ,66 @@ public class ChunkMap extends SimpleRegionStorage implements ChunkHolder.PlayerP
25971+ @@ -983 ,23 +668 ,66 @@ public class ChunkMap extends SimpleRegionStorage implements ChunkHolder.PlayerP
2597225972 return contextTag;
2597325973 }
2597425974
@@ -26044,7 +26044,7 @@ index a71bb2cb640b9e94386643a439e3d731417fc24c..0a60283625536515bfcf6c2a09ca0f47
2604426044 if (holder != null) {
2604526045 LevelChunk chunk = holder.getTickingChunk();
2604626046 if (chunk != null) {
26047- @@ -1013 ,8 +741 ,8 @@ public class ChunkMap extends SimpleRegionStorage implements ChunkHolder.PlayerP
26047+ @@ -1015 ,8 +743 ,8 @@ public class ChunkMap extends SimpleRegionStorage implements ChunkHolder.PlayerP
2604826048 }
2604926049
2605026050 boolean anyPlayerCloseEnoughForSpawning(final ChunkPos pos, boolean reducedRange) {
@@ -26055,7 +26055,7 @@ index a71bb2cb640b9e94386643a439e3d731417fc24c..0a60283625536515bfcf6c2a09ca0f47
2605526055 // Spigot end
2605626056 }
2605726057
26058- @@ -1038 ,7 +766 ,20 @@ public class ChunkMap extends SimpleRegionStorage implements ChunkHolder.PlayerP
26058+ @@ -1040 ,7 +768 ,20 @@ public class ChunkMap extends SimpleRegionStorage implements ChunkHolder.PlayerP
2605926059 private boolean anyPlayerCloseEnoughForSpawningInternal(final ChunkPos pos, final boolean reducedRange) {
2606026060 double blockRange; // Paper - use from event
2606126061 // Spigot end
@@ -26077,7 +26077,7 @@ index a71bb2cb640b9e94386643a439e3d731417fc24c..0a60283625536515bfcf6c2a09ca0f47
2607726077 // Paper start - PlayerNaturallySpawnCreaturesEvent
2607826078 com.destroystokyo.paper.event.entity.PlayerNaturallySpawnCreaturesEvent event;
2607926079 blockRange = 16384.0;
26080- @@ -1054 ,26 +795 ,41 @@ public class ChunkMap extends SimpleRegionStorage implements ChunkHolder.PlayerP
26080+ @@ -1056 ,26 +797 ,41 @@ public class ChunkMap extends SimpleRegionStorage implements ChunkHolder.PlayerP
2608126081 }
2608226082
2608326083 return false;
@@ -26128,7 +26128,7 @@ index a71bb2cb640b9e94386643a439e3d731417fc24c..0a60283625536515bfcf6c2a09ca0f47
2612826128 if (player.isSpectator()) {
2612926129 return false;
2613026130 }
26131- @@ -1111 ,18 +867 ,20 @@ public class ChunkMap extends SimpleRegionStorage implements ChunkHolder.PlayerP
26131+ @@ -1113 ,18 +869 ,20 @@ public class ChunkMap extends SimpleRegionStorage implements ChunkHolder.PlayerP
2613226132 this.updatePlayerPos(player);
2613326133 if (!ignored) {
2613426134 this.distanceManager.addPlayer(SectionPos.of(player), player);
@@ -26151,7 +26151,7 @@ index a71bb2cb640b9e94386643a439e3d731417fc24c..0a60283625536515bfcf6c2a09ca0f47
2615126151 }
2615226152 }
2615326153
26154- @@ -1132 ,13 +890 ,7 @@ public class ChunkMap extends SimpleRegionStorage implements ChunkHolder.PlayerP
26154+ @@ -1134 ,13 +892 ,7 @@ public class ChunkMap extends SimpleRegionStorage implements ChunkHolder.PlayerP
2615526155 }
2615626156
2615726157 public void move(final ServerPlayer player) {
@@ -26166,15 +26166,15 @@ index a71bb2cb640b9e94386643a439e3d731417fc24c..0a60283625536515bfcf6c2a09ca0f47
2616626166
2616726167 SectionPos oldSection = player.getLastSectionPos();
2616826168 SectionPos newSection = SectionPos.of(player);
26169- @@ -1147 ,6 +899 ,7 @@ public class ChunkMap extends SimpleRegionStorage implements ChunkHolder.PlayerP
26169+ @@ -1149 ,6 +901 ,7 @@ public class ChunkMap extends SimpleRegionStorage implements ChunkHolder.PlayerP
2617026170 boolean positionChanged = oldSection.asLong() != newSection.asLong();
2617126171 if (positionChanged || wasIgnored != ignored) {
2617226172 this.updatePlayerPos(player);
2617326173+ ((ca.spottedleaf.moonrise.patches.chunk_tick_iteration.ChunkTickDistanceManager)this.distanceManager).moonrise$updatePlayer(player, oldSection, newSection, wasIgnored, ignored); // Paper - chunk tick iteration optimisation
2617426174 if (!wasIgnored) {
2617526175 this.distanceManager.removePlayer(oldSection, player);
2617626176 }
26177- @@ -1163 ,47 +916 ,29 @@ public class ChunkMap extends SimpleRegionStorage implements ChunkHolder.PlayerP
26177+ @@ -1165 ,47 +918 ,29 @@ public class ChunkMap extends SimpleRegionStorage implements ChunkHolder.PlayerP
2617826178 this.playerMap.unIgnorePlayer(player);
2617926179 }
2618026180
@@ -26233,7 +26233,7 @@ index a71bb2cb640b9e94386643a439e3d731417fc24c..0a60283625536515bfcf6c2a09ca0f47
2623326233 }
2623426234
2623526235 public boolean hasEntityWithId(final int id) {
26236- @@ -1232 ,6 +967 ,14 @@ public class ChunkMap extends SimpleRegionStorage implements ChunkHolder.PlayerP
26236+ @@ -1234 ,6 +969 ,14 @@ public class ChunkMap extends SimpleRegionStorage implements ChunkHolder.PlayerP
2623726237 UpdateInterval updateInterval = type.hasUpdateInterval() ? UpdateInterval.periodic(type.updateInterval()) : UpdateInterval.NEVER;
2623826238 ChunkMap.TrackedEntity trackedEntity = new ChunkMap.TrackedEntity(entity, range, updateInterval, type.trackDeltas());
2623926239 this.entityMap.put(entity.getId(), trackedEntity);
@@ -26248,7 +26248,7 @@ index a71bb2cb640b9e94386643a439e3d731417fc24c..0a60283625536515bfcf6c2a09ca0f47
2624826248 trackedEntity.updatePlayers(this.level.players());
2624926249 if (entity instanceof ServerPlayer player) {
2625026250 this.updatePlayerStatus(player, true);
26251- @@ -1260 ,12 +1003 ,92 @@ public class ChunkMap extends SimpleRegionStorage implements ChunkHolder.PlayerP
26251+ @@ -1262 ,12 +1005 ,92 @@ public class ChunkMap extends SimpleRegionStorage implements ChunkHolder.PlayerP
2625226252 if (trackedEntity != null) {
2625326253 trackedEntity.broadcastRemoved();
2625426254 }
@@ -26343,7 +26343,7 @@ index a71bb2cb640b9e94386643a439e3d731417fc24c..0a60283625536515bfcf6c2a09ca0f47
2634326343
2634426344 List<ServerPlayer> movedPlayers = Lists.newArrayList();
2634526345 List<ServerPlayer> players = this.level.players();
26346- @@ -1360 ,17 +1183 ,11 @@ public class ChunkMap extends SimpleRegionStorage implements ChunkHolder.PlayerP
26346+ @@ -1362 ,17 +1185 ,11 @@ public class ChunkMap extends SimpleRegionStorage implements ChunkHolder.PlayerP
2634726347 }
2634826348
2634926349 public void waitForLightBeforeSending(final ChunkPos centerChunk, final int chunkRadius) {
@@ -26363,7 +26363,7 @@ index a71bb2cb640b9e94386643a439e3d731417fc24c..0a60283625536515bfcf6c2a09ca0f47
2636326363 LevelChunk chunk = chunkHolder.getChunkToSend();
2636426364 if (chunk != null) {
2636526365 consumer.accept(chunk);
26366- @@ -1378 ,14 +1195 ,21 @@ public class ChunkMap extends SimpleRegionStorage implements ChunkHolder.PlayerP
26366+ @@ -1380 ,14 +1197 ,21 @@ public class ChunkMap extends SimpleRegionStorage implements ChunkHolder.PlayerP
2636726367 }
2636826368 }
2636926369
@@ -26387,7 +26387,7 @@ index a71bb2cb640b9e94386643a439e3d731417fc24c..0a60283625536515bfcf6c2a09ca0f47
2638726387 }
2638826388
2638926389 @Override
26390- @@ -1399 ,13 +1223 ,96 @@ public class ChunkMap extends SimpleRegionStorage implements ChunkHolder.PlayerP
26390+ @@ -1401 ,13 +1225 ,96 @@ public class ChunkMap extends SimpleRegionStorage implements ChunkHolder.PlayerP
2639126391 }
2639226392 }
2639326393
@@ -26485,7 +26485,7 @@ index a71bb2cb640b9e94386643a439e3d731417fc24c..0a60283625536515bfcf6c2a09ca0f47
2648526485 public TrackedEntity(final Entity entity, final int range, final UpdateInterval updateInterval, final boolean trackDelta) {
2648626486 this.serverEntity = new ServerEntity(ChunkMap.this.level, entity, updateInterval, trackDelta, this, this.seenBy); // Paper
2648726487 this.entity = entity;
26488- @@ -1517 ,17 +1424 ,24 @@ public class ChunkMap extends SimpleRegionStorage implements ChunkHolder.PlayerP
26488+ @@ -1524 ,17 +1431 ,24 @@ public class ChunkMap extends SimpleRegionStorage implements ChunkHolder.PlayerP
2648926489 }
2649026490
2649126491 private int getEffectiveRange() {
@@ -28511,7 +28511,7 @@ index 47a0e17e4fed94828e02c7f4159d32195158f6cc..46e7478bd96e42487cf0fc467b6b9b83
2851128511 "Server weather",
2851228512 () -> String.format(
2851328513diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
28514- index bae5ed2cdd6627a0934f0a7bbf85621db5bed2d8..b3b00964d91804f108b7bc5b5ffc853a2ac62f16 100644
28514+ index 3272f89607e6fd4f2fee223ecefde0774f0a0c1f..b3132c6dde9b371e9580458cd7602ceaeca29945 100644
2851528515--- a/net/minecraft/server/level/ServerPlayer.java
2851628516+++ b/net/minecraft/server/level/ServerPlayer.java
2851728517@@ -210,7 +210,7 @@ import net.minecraft.world.scores.criteria.ObjectiveCriteria;
0 commit comments