Updated Upstream (Paper)

Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@b561a12 Fix SuspiciousStewMeta
PaperMC/Paper@9624451 Add missing kick event cause
PaperMC/Paper@6be4395 Migrate paper log ips option to new server.properties option
PaperMC/Paper@2ec643a Readd anti xray and oversized block entity patches
PaperMC/Paper@8d92274 Drop no longer needed patch
PaperMC/Paper@38dc3b2 Optimise chunk tick iteration
PaperMC/Paper@84556f3 Add lag compensation for breaking blocks
PaperMC/Paper@5dca26c Fix race condition on UpgradeData.BlockFixers class init
PaperMC/Paper@ea56138 Fix some issues
PaperMC/Paper@025c5d7 rebuild patches
PaperMC/Paper@866d2d9 Use correct ClientboundLevelChunkWithLightPacket constructor in later patch
PaperMC/Paper@8b9e3dc Optimise nearby player retrieval
PaperMC/Paper@11138a7 Re-add remove streams for Brain AI patch
PaperMC/Paper@7a00758 Rebuild patches
PaperMC/Paper@e284bb1 Updated Upstream (Bukkit/CraftBukkit)
This commit is contained in:
granny
2023-09-24 03:23:36 -07:00
parent 8a46226fdd
commit 01e013b173
46 changed files with 269 additions and 268 deletions

View File

@@ -39,10 +39,10 @@ index af712f089e7919fa0bd3946866fd3486fab19f76..9caab6541a224dc8f729a7d720eccda7
return b0;
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index d4aad1e62e2473c48c35b2e4238c4f5709b2352a..94b9a2f72dbdf85a95a9b99c45a66e7044f69f2a 100644
index 66b528364bbd5baea08511eb8d10fbd37bd1cef7..189c904a3b0ac2d2b889e118bfd7c75e6ec5da3e 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -333,13 +333,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -336,13 +336,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public MinecraftServer(OptionSet options, WorldLoader.DataLoadContext worldLoader, Thread thread, LevelStorageSource.LevelStorageAccess convertable_conversionsession, PackRepository resourcepackrepository, WorldStem worldstem, Proxy proxy, DataFixer datafixer, Services services, ChunkProgressListenerFactory worldloadlistenerfactory) {
super("Server");
SERVER = this; // Paper - better singleton
@@ -62,7 +62,7 @@ index d4aad1e62e2473c48c35b2e4238c4f5709b2352a..94b9a2f72dbdf85a95a9b99c45a66e70
this.random = RandomSource.create();
this.port = -1;
this.levels = Maps.newLinkedHashMap();
@@ -918,9 +918,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -921,9 +921,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
// Paper end
// CraftBukkit end
@@ -74,7 +74,7 @@ index d4aad1e62e2473c48c35b2e4238c4f5709b2352a..94b9a2f72dbdf85a95a9b99c45a66e70
MinecraftServer.LOGGER.info("Stopping server");
Commands.COMMAND_SENDING_POOL.shutdownNow(); // Paper - Shutdown and don't bother finishing
@@ -1159,18 +1159,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1162,18 +1162,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
// Spigot end
@@ -98,7 +98,7 @@ index d4aad1e62e2473c48c35b2e4238c4f5709b2352a..94b9a2f72dbdf85a95a9b99c45a66e70
this.mayHaveDelayedTasks = true;
// Purpur start - tps catchup
if (org.purpurmc.purpur.PurpurConfig.tpsCatchup) {
@@ -1180,8 +1180,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1183,8 +1183,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
// Purpur end - tps catchup
this.waitUntilNextTick();
@@ -109,7 +109,7 @@ index d4aad1e62e2473c48c35b2e4238c4f5709b2352a..94b9a2f72dbdf85a95a9b99c45a66e70
this.isReady = true;
JvmProfiler.INSTANCE.onServerTick(this.averageTickTime);
}
@@ -1342,7 +1342,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1345,7 +1345,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
public void doRunTask(TickTask ticktask) { // CraftBukkit - decompile error
@@ -118,7 +118,7 @@ index d4aad1e62e2473c48c35b2e4238c4f5709b2352a..94b9a2f72dbdf85a95a9b99c45a66e70
super.doRunTask(ticktask);
}
@@ -1409,7 +1409,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1412,7 +1412,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
if (playerSaveInterval < 0) {
playerSaveInterval = autosavePeriod;
}
@@ -127,7 +127,7 @@ index d4aad1e62e2473c48c35b2e4238c4f5709b2352a..94b9a2f72dbdf85a95a9b99c45a66e70
final boolean fullSave = autosavePeriod > 0 && this.tickCount % autosavePeriod == 0;
try {
this.isSaving = true;
@@ -1424,7 +1424,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1427,7 +1427,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} finally {
this.isSaving = false;
}
@@ -136,7 +136,7 @@ index d4aad1e62e2473c48c35b2e4238c4f5709b2352a..94b9a2f72dbdf85a95a9b99c45a66e70
// Paper end
io.papermc.paper.util.CachedLists.reset(); // Paper
// Paper start - move executeAll() into full server tick timing
@@ -1437,7 +1437,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1440,7 +1440,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
long remaining = (TICK_TIME - (endTime - lastTick)) - catchupTime;
new com.destroystokyo.paper.event.server.ServerTickEndEvent(this.tickCount, ((double)(endTime - lastTick) / 1000000D), remaining).callEvent();
// Paper end
@@ -145,7 +145,7 @@ index d4aad1e62e2473c48c35b2e4238c4f5709b2352a..94b9a2f72dbdf85a95a9b99c45a66e70
long j = this.tickTimes[this.tickCount % 100] = Util.getNanos() - i;
this.averageTickTime = this.averageTickTime * 0.8F + (float) j / 1000000.0F * 0.19999999F;
@@ -1449,7 +1449,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1452,7 +1452,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
tickTimes60s.add(this.tickCount, j);
// Paper end
this.logTickTime(k - i);
@@ -154,7 +154,7 @@ index d4aad1e62e2473c48c35b2e4238c4f5709b2352a..94b9a2f72dbdf85a95a9b99c45a66e70
org.spigotmc.WatchdogThread.tick(); // Spigot
//co.aikar.timings.TimingsManager.FULL_SERVER_TICK.stopTiming(); // Paper // Purpur
}
@@ -1506,11 +1506,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1509,11 +1509,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
});
// Paper end - Folia scheduler API
io.papermc.paper.adventure.providers.ClickCallbackProviderImpl.CALLBACK_MANAGER.handleQueue(this.tickCount); // Paper
@@ -168,7 +168,7 @@ index d4aad1e62e2473c48c35b2e4238c4f5709b2352a..94b9a2f72dbdf85a95a9b99c45a66e70
//Iterator iterator = this.getAllLevels().iterator(); // Paper - moved down
// CraftBukkit start
@@ -1552,18 +1552,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1556,18 +1556,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
worldserver.hasEntityMoveEvent = io.papermc.paper.event.entity.EntityMoveEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper
worldserver.hasRidableMoveEvent = org.purpurmc.purpur.event.entity.RidableMoveEvent.getHandlerList().getRegisteredListeners().length > 0; // Purpur
@@ -192,7 +192,7 @@ index d4aad1e62e2473c48c35b2e4238c4f5709b2352a..94b9a2f72dbdf85a95a9b99c45a66e70
try {
//worldserver.timings.doTick.startTiming(); // Spigot // Purpur
@@ -1589,17 +1589,17 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1593,17 +1593,17 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
throw new ReportedException(crashreport);
}
@@ -214,7 +214,7 @@ index d4aad1e62e2473c48c35b2e4238c4f5709b2352a..94b9a2f72dbdf85a95a9b99c45a66e70
//MinecraftTimings.playerListTimer.startTiming(); // Spigot // Paper // Purpur
this.playerList.tick();
//MinecraftTimings.playerListTimer.stopTiming(); // Spigot // Paper // Purpur
@@ -1607,7 +1607,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1611,7 +1611,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
GameTestTicker.SINGLETON.tick();
}
@@ -223,7 +223,7 @@ index d4aad1e62e2473c48c35b2e4238c4f5709b2352a..94b9a2f72dbdf85a95a9b99c45a66e70
//MinecraftTimings.tickablesTimer.startTiming(); // Spigot // Paper // Purpur
for (int i = 0; i < this.tickables.size(); ++i) {
@@ -1615,7 +1615,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1619,7 +1619,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
//MinecraftTimings.tickablesTimer.stopTiming(); // Spigot // Paper // Purpur
@@ -232,7 +232,7 @@ index d4aad1e62e2473c48c35b2e4238c4f5709b2352a..94b9a2f72dbdf85a95a9b99c45a66e70
iterator = this.playerList.getPlayers().iterator();
while (iterator.hasNext()) {
@@ -1625,7 +1625,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1629,7 +1629,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
entityplayer.connection.resumeFlushing();
}
@@ -241,7 +241,7 @@ index d4aad1e62e2473c48c35b2e4238c4f5709b2352a..94b9a2f72dbdf85a95a9b99c45a66e70
}
private void synchronizeTime(ServerLevel world) {
@@ -1633,7 +1633,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1637,7 +1637,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
public void forceTimeSynchronization() {
@@ -250,7 +250,7 @@ index d4aad1e62e2473c48c35b2e4238c4f5709b2352a..94b9a2f72dbdf85a95a9b99c45a66e70
Iterator iterator = this.getAllLevels().iterator();
while (iterator.hasNext()) {
@@ -1642,7 +1642,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1646,7 +1646,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.synchronizeTime(worldserver);
}
@@ -259,7 +259,7 @@ index d4aad1e62e2473c48c35b2e4238c4f5709b2352a..94b9a2f72dbdf85a95a9b99c45a66e70
}
public boolean isNetherEnabled() {
@@ -2294,6 +2294,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -2298,6 +2298,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
public ProfilerFiller getProfiler() {
@@ -267,7 +267,7 @@ index d4aad1e62e2473c48c35b2e4238c4f5709b2352a..94b9a2f72dbdf85a95a9b99c45a66e70
return this.profiler;
}
@@ -2533,7 +2534,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -2537,7 +2538,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// CraftBukkit end
private void startMetricsRecordingTick() {
@@ -276,7 +276,7 @@ index d4aad1e62e2473c48c35b2e4238c4f5709b2352a..94b9a2f72dbdf85a95a9b99c45a66e70
this.metricsRecorder = ActiveMetricsRecorder.createStarted(new ServerMetricsSamplersProvider(Util.timeSource, this.isDedicatedServer()), Util.timeSource, Util.ioPool(), new MetricsPersister("server"), this.onMetricsRecordingStopped, (path) -> {
this.executeBlocking(() -> {
this.saveDebugReport(path.resolve("server"));
@@ -2543,40 +2544,40 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -2547,40 +2548,40 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.willStartRecordingMetrics = false;
}
@@ -329,7 +329,7 @@ index d4aad1e62e2473c48c35b2e4238c4f5709b2352a..94b9a2f72dbdf85a95a9b99c45a66e70
}
public Path getWorldPath(LevelResource worldSavePath) {
@@ -2625,15 +2626,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -2629,15 +2630,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
public boolean isTimeProfilerRunning() {
@@ -397,10 +397,10 @@ index a6a1b57b4327f5710e9ec5ebca35a47c11751d11..097ac55028d66ef9ab430ff5dd103db6
++j;
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 3f0799cf3d9c5b9bfe3f29b1bf6cbdc9ca0fd38e..d9f92ee89bc9d91a3889f24745e593ff282843f4 100644
index 621a2627e066cbc1d68ece9c85ef1e8f3b512960..28fbcd84146445dd0630aeea7c753da2f1a97c49 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -468,20 +468,20 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -466,20 +466,20 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
protected void tick(BooleanSupplier shouldKeepTicking) {
@@ -426,7 +426,7 @@ index 3f0799cf3d9c5b9bfe3f29b1bf6cbdc9ca0fd38e..d9f92ee89bc9d91a3889f24745e593ff
public boolean hasWork() {
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
index ead4d70df7f33ff984d288d14d774a4156abb4fd..d082b45777426b3737cb928f039364461658ef67 100644
index 9dc3dec2bdf2e503fe10364dd4bb5cf662288260..4ab448842dcbf7f0f45d4443d0bb007e2e286a20 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -276,16 +276,16 @@ public class ServerChunkCache extends ChunkSource {
@@ -509,27 +509,26 @@ index ead4d70df7f33ff984d288d14d774a4156abb4fd..d082b45777426b3737cb928f03936446
//this.level.timings.countNaturalMobs.startTiming(); // Paper - timings // Purpur
int l = this.distanceManager.getNaturalSpawnChunkCount();
// Paper start - per player mob spawning
@@ -552,7 +552,7 @@ public class ServerChunkCache extends ChunkSource {
@@ -552,14 +552,14 @@ public class ServerChunkCache extends ChunkSource {
//this.level.timings.countNaturalMobs.stopTiming(); // Paper - timings // Purpur
this.lastSpawnState = spawnercreature_d;
- gameprofilerfiller.popPush("filteringLoadedChunks");
+ //gameprofilerfiller.popPush("filteringLoadedChunks"); // Purpur
List<ServerChunkCache.ChunkAndHolder> list = Lists.newArrayListWithCapacity(l);
Iterator iterator = this.chunkMap.getChunks().iterator();
// Paper - optimise chunk tick iteration
// Paper - optimise chunk tick iteration
//this.level.timings.chunkTicks.startTiming(); // Paper // Purpur
@@ -566,7 +566,7 @@ public class ServerChunkCache extends ChunkSource {
}
}
// Paper - optimise chunk tick iteration
- gameprofilerfiller.popPush("spawnAndTick");
+ //gameprofilerfiller.popPush("spawnAndTick"); // Purpur
boolean flag2 = this.level.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && !this.level.players().isEmpty(); // CraftBukkit
Collections.shuffle(list);
@@ -600,21 +600,21 @@ public class ServerChunkCache extends ChunkSource {
}
// Paper start - optimise chunk tick iteration
@@ -662,14 +662,14 @@ public class ServerChunkCache extends ChunkSource {
}
// Paper end - optimise chunk tick iteration
//this.level.timings.chunkTicks.stopTiming(); // Paper // Purpur
- gameprofilerfiller.popPush("customSpawners");
+ //gameprofilerfiller.popPush("customSpawners"); // Purpur
@@ -541,11 +540,13 @@ index ead4d70df7f33ff984d288d14d774a4156abb4fd..d082b45777426b3737cb928f03936446
- gameprofilerfiller.popPush("broadcast");
+ //gameprofilerfiller.popPush("broadcast"); // Purpur
list.forEach((chunkproviderserver_a1) -> {
// Paper - optimise chunk tick iteration
//this.level.timings.broadcastChunkUpdates.startTiming(); // Paper - timing // Purpur
chunkproviderserver_a1.holder.broadcastChanges(chunkproviderserver_a1.chunk);
// Paper start - optimise chunk tick iteration
@@ -687,8 +687,8 @@ public class ServerChunkCache extends ChunkSource {
// Paper end - optimise chunk tick iteration
//this.level.timings.broadcastChunkUpdates.stopTiming(); // Paper - timing // Purpur
});
// Paper - optimise chunk tick iteration
- gameprofilerfiller.pop();
- gameprofilerfiller.pop();
+ //gameprofilerfiller.pop(); // Purpur
@@ -553,7 +554,7 @@ index ead4d70df7f33ff984d288d14d774a4156abb4fd..d082b45777426b3737cb928f03936446
this.chunkMap.tick();
}
}
@@ -787,7 +787,7 @@ public class ServerChunkCache extends ChunkSource {
@@ -861,7 +861,7 @@ public class ServerChunkCache extends ChunkSource {
@Override
protected void doRunTask(Runnable task) {
@@ -563,10 +564,10 @@ index ead4d70df7f33ff984d288d14d774a4156abb4fd..d082b45777426b3737cb928f03936446
}
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 4cc1f2fa4453e2ba160bfd42717bd7c8c68541fe..b55517984b3c0ed225a869ae44eceb6c3bb64ffe 100644
index 1688fdea27342783f91b5cd0a09343ddac77dc6d..ac85cbd677a3833924d3eb393a0c0f5e51ed524e 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -703,12 +703,12 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -823,12 +823,12 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
public void tick(BooleanSupplier shouldKeepTicking) {
@@ -582,7 +583,7 @@ index 4cc1f2fa4453e2ba160bfd42717bd7c8c68541fe..b55517984b3c0ed225a869ae44eceb6c
this.advanceWeatherCycle();
int i = this.getGameRules().getInt(GameRules.RULE_PLAYERS_SLEEPING_PERCENTAGE);
long j;
@@ -735,32 +735,32 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -855,32 +855,32 @@ public class ServerLevel extends Level implements WorldGenLevel {
this.updateSkyBrightness();
this.tickTime();
@@ -623,7 +624,7 @@ index 4cc1f2fa4453e2ba160bfd42717bd7c8c68541fe..b55517984b3c0ed225a869ae44eceb6c
boolean flag = true || !this.players.isEmpty() || !this.getForcedChunks().isEmpty(); // CraftBukkit - this prevents entity cleanup, other issues on servers with no players
if (flag) {
@@ -768,12 +768,12 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -888,12 +888,12 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
if (flag || this.emptyTime++ < 300) {
@@ -639,7 +640,7 @@ index 4cc1f2fa4453e2ba160bfd42717bd7c8c68541fe..b55517984b3c0ed225a869ae44eceb6c
}
org.spigotmc.ActivationRange.activateEntities(this); // Spigot
@@ -783,9 +783,9 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -903,9 +903,9 @@ public class ServerLevel extends Level implements WorldGenLevel {
if (false && this.shouldDiscardEntity(entity)) { // CraftBukkit - We prevent spawning in general, so this butchering is not needed
entity.discard();
} else {
@@ -651,7 +652,7 @@ index 4cc1f2fa4453e2ba160bfd42717bd7c8c68541fe..b55517984b3c0ed225a869ae44eceb6c
if (true || this.chunkSource.chunkMap.getDistanceManager().inEntityTickingRange(entity.chunkPosition().toLong())) { // Paper - now always true if in the ticking list
Entity entity1 = entity.getVehicle();
@@ -797,22 +797,21 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -917,22 +917,21 @@ public class ServerLevel extends Level implements WorldGenLevel {
entity.stopRiding();
}
@@ -678,7 +679,7 @@ index 4cc1f2fa4453e2ba160bfd42717bd7c8c68541fe..b55517984b3c0ed225a869ae44eceb6c
}
@Override
@@ -892,9 +891,9 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1012,9 +1011,9 @@ public class ServerLevel extends Level implements WorldGenLevel {
boolean flag = this.isRaining();
int j = chunkcoordintpair.getMinBlockX();
int k = chunkcoordintpair.getMinBlockZ();
@@ -690,7 +691,7 @@ index 4cc1f2fa4453e2ba160bfd42717bd7c8c68541fe..b55517984b3c0ed225a869ae44eceb6c
final BlockPos.MutableBlockPos blockposition = this.chunkTickMutablePosition; // Paper - use mutable to reduce allocation rate, final to force compile fail on change
if (!this.paperConfig().environment.disableThunder && flag && this.isThundering() && this.spigotConfig.thunderChance > 0 && this.random.nextInt(this.spigotConfig.thunderChance) == 0) { // Spigot // Paper - disable thunder
@@ -933,7 +932,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1053,7 +1052,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
}
@@ -699,7 +700,7 @@ index 4cc1f2fa4453e2ba160bfd42717bd7c8c68541fe..b55517984b3c0ed225a869ae44eceb6c
if (!this.paperConfig().environment.disableIceAndSnow) { // Paper
for (int l = 0; l < randomTickSpeed; ++l) {
@@ -945,7 +944,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1065,7 +1064,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
} // Paper
// Paper start - optimise random block ticking
@@ -708,7 +709,7 @@ index 4cc1f2fa4453e2ba160bfd42717bd7c8c68541fe..b55517984b3c0ed225a869ae44eceb6c
//timings.chunkTicksBlocks.startTiming(); // Paper // Purpur
if (randomTickSpeed > 0) {
LevelChunkSection[] sections = chunk.getSections();
@@ -980,7 +979,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1100,7 +1099,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
// Paper end - optimise random block ticking
//timings.chunkTicksBlocks.stopTiming(); // Paper // Purpur
@@ -717,7 +718,7 @@ index 4cc1f2fa4453e2ba160bfd42717bd7c8c68541fe..b55517984b3c0ed225a869ae44eceb6c
}
private void tickIceAndSnow(boolean raining, BlockPos.MutableBlockPos blockposition1, final LevelChunk chunk) { // Paper - optimise chunk ticking
@@ -1321,19 +1320,19 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1441,19 +1440,19 @@ public class ServerLevel extends Level implements WorldGenLevel {
//try { // Purpur
// Paper end - timings
entity.setOldPosAndRot();
@@ -742,7 +743,7 @@ index 4cc1f2fa4453e2ba160bfd42717bd7c8c68541fe..b55517984b3c0ed225a869ae44eceb6c
//} finally { timer.stopTiming(); } // Paper - timings // Purpur
Iterator iterator = entity.getPassengers().iterator();
@@ -1362,12 +1361,12 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1482,12 +1481,12 @@ public class ServerLevel extends Level implements WorldGenLevel {
// Paper end
passenger.setOldPosAndRot();
++passenger.tickCount;
@@ -759,7 +760,7 @@ index 4cc1f2fa4453e2ba160bfd42717bd7c8c68541fe..b55517984b3c0ed225a869ae44eceb6c
// Paper start - EAR 2
if (isActive) {
passenger.rideTick();
@@ -1379,7 +1378,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1499,7 +1498,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
vehicle.positionRider(passenger);
}
// Paper end - EAR 2
@@ -769,10 +770,10 @@ index 4cc1f2fa4453e2ba160bfd42717bd7c8c68541fe..b55517984b3c0ed225a869ae44eceb6c
while (iterator.hasNext()) {
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 4f9796dfb1243befb6fa41b4fd633951a4bf0fc6..3c44249e782d0e98689a58c719030dea2f007644 100644
index 7aeaccaa6649a1c93567d07f6b955b9259d3a902..5722265ed3c1b411d2c7bf44d7d42b6420f6381a 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -1235,7 +1235,7 @@ public class ServerPlayer extends Player {
@@ -1236,7 +1236,7 @@ public class ServerPlayer extends Player {
PortalInfo shapedetectorshape = this.findDimensionEntryPoint(worldserver);
if (shapedetectorshape != null) {
@@ -781,7 +782,7 @@ index 4f9796dfb1243befb6fa41b4fd633951a4bf0fc6..3c44249e782d0e98689a58c719030dea
worldserver = shapedetectorshape.world; // CraftBukkit
if (worldserver == null) { } else // CraftBukkit - empty to fall through to null to event
if (resourcekey == LevelStem.OVERWORLD && worldserver.getTypeKey() == LevelStem.NETHER) { // CraftBukkit
@@ -1258,8 +1258,8 @@ public class ServerPlayer extends Player {
@@ -1259,8 +1259,8 @@ public class ServerPlayer extends Player {
worldserver = ((CraftWorld) exit.getWorld()).getHandle();
// CraftBukkit end
@@ -792,7 +793,7 @@ index 4f9796dfb1243befb6fa41b4fd633951a4bf0fc6..3c44249e782d0e98689a58c719030dea
if (true) { // CraftBukkit
this.isChangingDimension = true; // CraftBukkit - Set teleport invulnerability only if player changing worlds
@@ -1277,7 +1277,7 @@ public class ServerPlayer extends Player {
@@ -1278,7 +1278,7 @@ public class ServerPlayer extends Player {
this.connection.teleport(exit); // CraftBukkit - use internal teleport without event
this.connection.resetPosition();
worldserver.addDuringPortalTeleport(this);
@@ -802,7 +803,7 @@ index 4f9796dfb1243befb6fa41b4fd633951a4bf0fc6..3c44249e782d0e98689a58c719030dea
this.connection.send(new ClientboundPlayerAbilitiesPacket(this.getAbilities()));
playerlist.sendLevelInfo(this, worldserver);
diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
index 9bc03cd18bf30bc71f79a6c11f3f30664cf6b822..c0d9e65b8c52afc761c7ca7ec19501141a28aa3a 100644
index edf3b0baa5a23dd957e2747677595cd5f5f7d55c..274b4cb9d008868d49c9578e15d2fecc50f8af8c 100644
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
@@ -212,7 +212,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
@@ -1154,7 +1155,7 @@ index 28cac00d496cc6e37648dbe96ba4aea2b834cedd..6e0331818ef68fa355e3c27dc3e362b8
}
} else {
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 9e07866c6597b62eb02985770c1fcffe6fb3f601..7bace36fb2c447cc2c7d07777a910c5867bbfe99 100644
index 9ca3a8df8d4e0cd733c489c930b563888fb01ffa..a9b87083623050cf9b0a5311f0f687e0ada73137 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -411,7 +411,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -1732,10 +1733,10 @@ index 45243249a561440512ef2a620c60b02e159c80e2..b26cea981a876fd42c9ab91923d507b3
}
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index f9db7dde74ce1277a792497d078ed272e8b23d10..7b35238aadcd10a4a246712f252e6254b0070d57 100644
index 10276a6b2b311f9cf45b030e4dbb46e44faa04a5..4e8738531ea388733c41dbb408eb43c1e3c88fad 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -1296,9 +1296,9 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -1299,9 +1299,9 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
}
protected void tickBlockEntities() {
@@ -1747,7 +1748,7 @@ index f9db7dde74ce1277a792497d078ed272e8b23d10..7b35238aadcd10a4a246712f252e6254
//timings.tileEntityPending.startTiming(); // Spigot // Purpur
this.tickingBlockEntities = true;
if (!this.pendingBlockEntityTickers.isEmpty()) {
@@ -1343,7 +1343,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -1346,7 +1346,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
//timings.tileEntityTick.stopTiming(); // Spigot // Purpur
this.tickingBlockEntities = false;
co.aikar.timings.TimingHistory.tileEntityTicks += this.blockEntityTickers.size(); // Paper
@@ -1756,7 +1757,7 @@ index f9db7dde74ce1277a792497d078ed272e8b23d10..7b35238aadcd10a4a246712f252e6254
spigotConfig.currentPrimedTnt = 0; // Spigot
}
@@ -1546,7 +1546,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -1549,7 +1549,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@Override
public List<Entity> getEntities(@Nullable Entity except, AABB box, Predicate<? super Entity> predicate) {
@@ -1765,7 +1766,7 @@ index f9db7dde74ce1277a792497d078ed272e8b23d10..7b35238aadcd10a4a246712f252e6254
List<Entity> list = Lists.newArrayList();
((ServerLevel)this).getEntityLookup().getEntities(except, box, list, predicate); // Paper - optimise this call
return list;
@@ -1565,7 +1565,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -1568,7 +1568,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
}
public <T extends Entity> void getEntities(EntityTypeTest<Entity, T> filter, AABB box, Predicate<? super T> predicate, List<? super T> result, int limit) {
@@ -1774,7 +1775,7 @@ index f9db7dde74ce1277a792497d078ed272e8b23d10..7b35238aadcd10a4a246712f252e6254
// Paper start - optimise this call
//TODO use limit
if (filter instanceof net.minecraft.world.entity.EntityType entityTypeTest) {
@@ -1822,6 +1822,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -1825,6 +1825,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
}
public ProfilerFiller getProfiler() {
@@ -1783,7 +1784,7 @@ index f9db7dde74ce1277a792497d078ed272e8b23d10..7b35238aadcd10a4a246712f252e6254
}
diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
index 93af6e1a041a514e9b7198e0e510fa88b043439d..ec95678e5fb3f36a35cd0e03c65184a8ee4c8609 100644
index 6a5dddfd120760b3334d8a4c4ebde84744083392..f3ff965e641f561dbc1b5194353e75dc17e9a0ba 100644
--- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java
+++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
@@ -132,7 +132,7 @@ public final class NaturalSpawner {
@@ -1795,7 +1796,7 @@ index 93af6e1a041a514e9b7198e0e510fa88b043439d..ec95678e5fb3f36a35cd0e03c65184a8
//world.timings.mobSpawn.startTiming(); // Spigot // Purpur
MobCategory[] aenumcreaturetype = NaturalSpawner.SPAWNING_CATEGORIES;
int i = aenumcreaturetype.length;
@@ -189,7 +189,7 @@ public final class NaturalSpawner {
@@ -187,7 +187,7 @@ public final class NaturalSpawner {
}
//world.timings.mobSpawn.stopTiming(); // Spigot // Purpur
@@ -1805,10 +1806,10 @@ index 93af6e1a041a514e9b7198e0e510fa88b043439d..ec95678e5fb3f36a35cd0e03c65184a8
// Paper start
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 b27e2e187f9edebdf53cfad3d410154c0751ac86..5ba88bf9109ae1b6cf782b378a08ac7fd135f289 100644
index 7d60f8a4e3fa15d81628bba0f6b3c1fc9040535b..8d385708df97d47881929d4352f1b90286aad1a2 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
@@ -446,11 +446,11 @@ public class LevelChunk extends ChunkAccess {
@@ -447,11 +447,11 @@ public class LevelChunk extends ChunkAccess {
if (LightEngine.hasDifferentLightProperties(this, blockposition, iblockdata1, iblockdata)) {
ProfilerFiller gameprofilerfiller = this.level.getProfiler();
@@ -1823,7 +1824,7 @@ index b27e2e187f9edebdf53cfad3d410154c0751ac86..5ba88bf9109ae1b6cf782b378a08ac7f
}
boolean flag3 = iblockdata1.hasBlockEntity();
@@ -1164,9 +1164,9 @@ public class LevelChunk extends ChunkAccess {
@@ -1165,9 +1165,9 @@ public class LevelChunk extends ChunkAccess {
if (LevelChunk.this.isTicking(blockposition)) {
try {
@@ -1835,7 +1836,7 @@ index b27e2e187f9edebdf53cfad3d410154c0751ac86..5ba88bf9109ae1b6cf782b378a08ac7f
//this.blockEntity.tickTimer.startTiming(); // Spigot // Purpur
BlockState iblockdata = LevelChunk.this.getBlockState(blockposition);
@@ -1178,7 +1178,7 @@ public class LevelChunk extends ChunkAccess {
@@ -1179,7 +1179,7 @@ public class LevelChunk extends ChunkAccess {
LevelChunk.LOGGER.warn("Block entity {} @ {} state {} invalid for ticking:", new Object[]{LogUtils.defer(this::getType), LogUtils.defer(this::getPos), iblockdata});
}