This commit is contained in:
Riley Park 2023-03-29 18:26:03 -07:00
parent f34a20c36a
commit 00864ac5b1
10 changed files with 97 additions and 98 deletions

View File

@ -2,7 +2,7 @@ group=dev.folia
version=1.19.4-R0.1-SNAPSHOT
mcVersion=1.19.4
paperRef=e8b82590d0c3dd57ac1728b236117d2fcd531c4f
paperRef=cbcdfd03e7d4042a8812d70d3e20fc216bdc5e02
org.gradle.caching=true
org.gradle.parallel=true

View File

@ -6,14 +6,14 @@ Subject: [PATCH] Force disable timings
Need a new profiler system with region threading
diff --git a/src/main/java/co/aikar/timings/Timings.java b/src/main/java/co/aikar/timings/Timings.java
index dd72a34eaa4bedd9ea0b92eaa79091b00eb4dd09..d886b909d74ad49198204199f7472f5d5bf4f06e 100644
index c5ae86919e7ad8cc902405e34ddca633d6354e6b..85536ea8dc7943415c8cdb3c2c175ac2d21f7a90 100644
--- a/src/main/java/co/aikar/timings/Timings.java
+++ b/src/main/java/co/aikar/timings/Timings.java
@@ -135,6 +135,7 @@ public final class Timings {
@@ -141,6 +141,7 @@ public final class Timings {
* @param enabled Should timings be reported
*/
public static void setTimingsEnabled(boolean enabled) {
+ enabled = false; // Folia - region threading - disable timings
timingsEnabled = enabled;
warnAboutDeprecationOnEnable();
reset();
}

View File

@ -485,7 +485,7 @@ index 0000000000000000000000000000000000000000..a6b50c9d8af589cc4747e14d343d2045
+ }
+}
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index ac9b690fcccb60b587e5345f12f1383afd0a73a1..7986b9fcaf256e9042f6d9ddc38e8bd76645cbb7 100644
index a6bdd42b38454fe481f9210e1a0f5f94023a0543..aa2d0af0b0a783000e993fa622dd14e32b1914e3 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -2459,6 +2459,44 @@ public final class Bukkit {
@ -534,7 +534,7 @@ index ac9b690fcccb60b587e5345f12f1383afd0a73a1..7986b9fcaf256e9042f6d9ddc38e8bd7
@NotNull
public static Server.Spigot spigot() {
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 2204336d8800311b65e894739ab1b27273e7c6f2..5caa00a413450dee18739f6430ffaf5095ea3036 100644
index ce2ef5cff6ad10b64791e67f6d3cff328c2cf7dc..2f1d1edbe802f66962e2763d49a025fbc657c99f 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -2139,4 +2139,36 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@ -575,7 +575,7 @@ index 2204336d8800311b65e894739ab1b27273e7c6f2..5caa00a413450dee18739f6430ffaf50
+ // Folia end - region threading API
}
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
index 365350d38b2eee00d22bad09ab95c6054f11d536..86a86ad5555c5f9f6ed1938615f1cae9149b2805 100644
index 8c58018b155c52a7b2a139f784abceb6aa00a268..d8c447b4c01e82efab6f68b0c668fc10404ef202 100644
--- a/src/main/java/org/bukkit/entity/Entity.java
+++ b/src/main/java/org/bukkit/entity/Entity.java
@@ -953,4 +953,13 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent

View File

@ -11,7 +11,7 @@ the schedulers depending on the result of the ownership
check.
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 7986b9fcaf256e9042f6d9ddc38e8bd76645cbb7..3c940426f1ea03bb1279b4f397549642e98dd72d 100644
index aa2d0af0b0a783000e993fa622dd14e32b1914e3..92678097e5255a8c7ff7b6b302ccb99f13c6f2e6 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -2496,6 +2496,107 @@ public final class Bukkit {
@ -123,7 +123,7 @@ index 7986b9fcaf256e9042f6d9ddc38e8bd76645cbb7..3c940426f1ea03bb1279b4f397549642
@NotNull
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 5caa00a413450dee18739f6430ffaf5095ea3036..c230a10aff36f6b484d7e3963cbf8073f8676fb1 100644
index 2f1d1edbe802f66962e2763d49a025fbc657c99f..717635388aa449fd2e24692b14ceccc8a0f762c1 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -2170,5 +2170,90 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi

View File

@ -79,10 +79,10 @@ index bf42969859545a8a520923ef1836ffa4a5cc24a0..719b0e318a85d4a1fb8f616deeb31193
return history != null ? TextComponent.ofChildren(updateMessage, Component.newline(), history) : updateMessage;
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 4450d825a5474da211f0e83f845d8c7129fa08aa..8ccc92836bfda8e00eea649430174dcd5664af70 100644
index 9f15d9dbdfa74a0640b1a2b4ff695609d4758a4c..3219482b96cab8262e393a790c88d903d7de5166 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1681,7 +1681,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1682,7 +1682,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@DontObfuscate
public String getServerModName() {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] New player chunk loader system
diff --git a/src/main/java/co/aikar/timings/TimingsExport.java b/src/main/java/co/aikar/timings/TimingsExport.java
index 06bff37e4c1fddd3be6343049a66787c63fb420c..1be1fe766401221b6adb417175312007d29d347e 100644
index c07eb451a576811a39021f6f97103c77488fd001..a2f71a6d1a9e98133dff6cd0f625da9435a8af14 100644
--- a/src/main/java/co/aikar/timings/TimingsExport.java
+++ b/src/main/java/co/aikar/timings/TimingsExport.java
@@ -163,9 +163,9 @@ public class TimingsExport extends Thread {
@@ -164,9 +164,9 @@ public class TimingsExport extends Thread {
return pair(rule, world.getWorld().getGameRuleValue(rule));
})),
// Paper start - replace chunk loader system
@ -2007,10 +2007,10 @@ index 5a5ff40df37db9cbd53c584ed26a3ce4888b29c0..bf1a77cf9bbea4e2104b2a8c61309e74
public ServerLevel(MinecraftServer minecraftserver, Executor executor, LevelStorageSource.LevelStorageAccess convertable_conversionsession, PrimaryLevelData iworlddataserver, ResourceKey<Level> resourcekey, LevelStem worlddimension, ChunkProgressListener worldloadlistener, boolean flag, long i, List<CustomSpawner> list, boolean flag1, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider) {
// IRegistryCustom.Dimension iregistrycustom_dimension = minecraftserver.registryAccess(); // CraftBukkit - decompile error
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index ca5291a9573a62cb5c19539cf5c7aceff11f9829..a3cef477646abf6172d4e50a28ed30f04c30d667 100644
index 1d4d02f26391ac55c7631817f09d05e2769b0d29..4231c3fe14a621d237bdc3d56c593f0adc0a7bc6 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -275,6 +275,48 @@ public class ServerPlayer extends Player {
@@ -276,6 +276,48 @@ public class ServerPlayer extends Player {
public PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper
public org.bukkit.event.player.PlayerQuitEvent.QuitReason quitReason = null; // Paper - there are a lot of changes to do if we change all methods leading to the event
@ -2203,7 +2203,7 @@ index 5e9055fdf411029ea2fed91acd6b981f79156418..ff6559bf563f2fdcc0f2843d4f4aa24d
// Paper end - view distance api
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 1bada55af5d16437da4d16f9ded55f88a6121eb4..e769c1c2a99a13941124c7442d44a509e7859666 100644
index 0ae1fce0c1a2e3bfbbab756a088fc76545e263fa..fec408416aa63e1022802a644bb95131601f0c3b 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -189,44 +189,22 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@ -11691,10 +11691,10 @@ index d2f0a0755317f5fa9a1ccf7db346aa77fd287d80..b07df826a3028c14b48b09dbaeccc907
// CraftBukkit start - SPIGOT-5477, MC-142590
} else if (MinecraftServer.getServer().hasStopped() || (listener instanceof ServerGamePacketListenerImpl && ((ServerGamePacketListenerImpl) listener).processedDisconnect)) {
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2be06fd587 100644
index 3219482b96cab8262e393a790c88d903d7de5166..f5977082a31d44088ab5ba31fad88e823cfe56e0 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -294,7 +294,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -295,7 +295,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public org.bukkit.command.ConsoleCommandSender console;
public org.bukkit.command.RemoteConsoleCommandSender remoteConsole;
//public ConsoleReader reader; // Paper
@ -11703,7 +11703,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
public java.util.Queue<Runnable> processQueue = new java.util.concurrent.ConcurrentLinkedQueue<Runnable>();
public int autosavePeriod;
public Commands vanillaCommandDispatcher;
@@ -307,12 +307,40 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -308,12 +308,40 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public final double[] recentTps = new double[ 3 ];
// Spigot end
public final io.papermc.paper.configuration.PaperConfigurations paperConfigurations;
@ -11745,7 +11745,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
public static <S extends MinecraftServer> S spin(Function<Thread, S> serverFactory) {
AtomicReference<S> atomicreference = new AtomicReference();
Thread thread = new io.papermc.paper.util.TickThread(() -> { // Paper - rewrite chunk system
@@ -604,7 +632,21 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -605,7 +633,21 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
worlddata.setModdedInfo(this.getServerModName(), this.getModdedStatus().shouldReportAsModified());
this.addLevel(world); // Paper - move up
@ -11768,7 +11768,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
// Paper - move up
this.getPlayerList().addWorldborderListener(world);
@@ -616,6 +658,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -617,6 +659,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.forceDifficulty();
for (ServerLevel worldserver : this.getAllLevels()) {
this.prepareLevels(worldserver.getChunkSource().chunkMap.progressListener, worldserver);
@ -11776,7 +11776,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
//worldserver.entityManager.tick(); // SPIGOT-6526: Load pending entities so they are available to the API // Paper - rewrite chunk system, not required to "tick" anything
this.server.getPluginManager().callEvent(new org.bukkit.event.world.WorldLoadEvent(worldserver.getWorld()));
}
@@ -683,7 +726,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -684,7 +727,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
worldProperties.setSpawn(BlockPos.ZERO.above(80), 0.0F);
} else {
ServerChunkCache chunkproviderserver = world.getChunkSource();
@ -11785,7 +11785,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
// CraftBukkit start
if (world.generator != null) {
Random rand = new Random(world.getSeed());
@@ -704,6 +747,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -705,6 +748,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
if (i < world.getMinBuildHeight()) {
BlockPos blockposition = chunkcoordintpair.getWorldPosition();
@ -11793,7 +11793,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
i = world.getHeight(Heightmap.Types.WORLD_SURFACE, blockposition.getX() + 8, blockposition.getZ() + 8);
}
@@ -785,7 +829,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -786,7 +830,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// Paper end
// this.nextTickTime = SystemUtils.getMillis() + 10L;
@ -11802,7 +11802,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
// Iterator iterator = this.levels.values().iterator();
}
@@ -808,7 +852,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -809,7 +853,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// CraftBukkit start
// this.nextTickTime = SystemUtils.getMillis() + 10L;
@ -11811,7 +11811,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
// CraftBukkit end
if (worldserver.getWorld().getKeepSpawnInMemory()) worldloadlistener.stop(); // Paper
chunkproviderserver.getLightEngine().setTaskPerBatch(worldserver.paperConfig().misc.lightQueueSize); // Paper - increase light queue size
@@ -913,7 +957,37 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -914,7 +958,37 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
// CraftBukkit end
@ -11849,7 +11849,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
// CraftBukkit start - prevent double stopping on multiple threads
synchronized(this.stopLock) {
if (this.hasStopped) return;
@@ -923,7 +997,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -924,7 +998,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// Paper start - kill main thread, and kill it hard
shutdownThread = Thread.currentThread();
org.spigotmc.WatchdogThread.doStop(); // Paper
@ -11858,7 +11858,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
MinecraftServer.LOGGER.info("Stopping main thread (Ignore any thread death message you see! - DO NOT REPORT THREAD DEATH TO PAPER)");
while (this.getRunningThread().isAlive()) {
this.getRunningThread().stop();
@@ -953,12 +1027,19 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -954,12 +1028,19 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.isSaving = true;
if (this.playerList != null) {
@ -11880,7 +11880,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
MinecraftServer.LOGGER.info("Saving worlds");
Iterator iterator = this.getAllLevels().iterator();
@@ -974,6 +1055,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -975,6 +1056,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.saveAllChunks(false, true, false, true); // Paper - rewrite chunk system - move closing into here
this.isSaving = false;
@ -11892,7 +11892,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
this.resources.close();
try {
@@ -1027,6 +1113,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1028,6 +1114,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
if (isDebugging()) io.papermc.paper.util.TraceUtil.dumpTraceForThread("Server stopped"); // Paper
// Paper end
this.running = false;
@ -11900,7 +11900,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
if (waitForShutdown) {
try {
this.serverThread.join();
@@ -1108,6 +1195,19 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1109,6 +1196,19 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.statusIcon = (ServerStatus.Favicon) this.loadStatusIcon().orElse(null); // CraftBukkit - decompile error
this.status = this.buildServerStatus();
@ -11920,7 +11920,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
// Spigot start
// Paper start - move done tracking
LOGGER.info("Running delayed init tasks");
@@ -1143,8 +1243,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1144,8 +1244,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.lastOverloadWarning = this.nextTickTime;
}
@ -11931,7 +11931,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
{
final long diff = curTime - tickSection;
java.math.BigDecimal currentTps = TPS_BASE.divide(new java.math.BigDecimal(diff), 30, java.math.RoundingMode.HALF_UP);
@@ -1170,7 +1270,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1171,7 +1271,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.nextTickTime += 50L;
this.startMetricsRecordingTick();
this.profiler.push("tick");
@ -11940,7 +11940,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
this.profiler.popPush("nextTickWait");
this.mayHaveDelayedTasks = true;
this.delayedTasksMaxNextTickTime = Math.max(Util.getMillis() + 50L, this.nextTickTime);
@@ -1308,6 +1408,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1309,6 +1409,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@Override
public boolean pollTask() {
@ -11948,7 +11948,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
boolean flag = this.pollTaskInternal();
this.mayHaveDelayedTasks = flag;
@@ -1315,6 +1416,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1316,6 +1417,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
private boolean pollTaskInternal() {
@ -11956,7 +11956,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
if (super.pollTask()) {
this.executeMidTickTasks(); // Paper - execute chunk tasks mid tick
return true;
@@ -1337,6 +1439,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1338,6 +1440,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
public void doRunTask(TickTask ticktask) { // CraftBukkit - decompile error
@ -11964,7 +11964,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
this.getProfiler().incrementCounter("runTask");
super.doRunTask(ticktask);
}
@@ -1379,22 +1482,64 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1380,22 +1483,64 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public void onServerExit() {}
@ -12034,7 +12034,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
this.lastServerStatus = i;
this.status = this.buildServerStatus();
}
@@ -1411,9 +1556,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1412,9 +1557,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
if (playerSaveInterval > 0) {
this.playerList.saveAll(playerSaveInterval);
}
@ -12046,7 +12046,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
}
}
} finally {
@@ -1423,16 +1568,17 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1424,16 +1569,17 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// Paper end
io.papermc.paper.util.CachedLists.reset(); // Paper
// Paper start - move executeAll() into full server tick timing
@ -12067,7 +12067,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
long j = this.tickTimes[this.tickCount % 100] = Util.getNanos() - i;
this.averageTickTime = this.averageTickTime * 0.8F + (float) j / 1000000.0F * 0.19999999F;
@@ -1444,11 +1590,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1445,11 +1591,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
tickTimes60s.add(this.tickCount, j);
// Paper end
this.frameTimer.logFrameDuration(k - i);
@ -12086,7 +12086,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
private ServerStatus buildServerStatus() {
ServerStatus.Players serverping_serverpingplayersample = this.buildPlayerStatus();
@@ -1456,7 +1609,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1457,7 +1610,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
private ServerStatus.Players buildPlayerStatus() {
@ -12095,7 +12095,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
int i = this.getMaxPlayers();
if (this.hidesOnlinePlayers()) {
@@ -1477,14 +1630,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1478,14 +1631,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
}
@ -12114,7 +12114,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
MinecraftTimings.commandFunctionsTimer.stopTiming(); // Spigot // Paper
this.profiler.popPush("levels");
//Iterator iterator = this.getAllLevels().iterator(); // Paper - moved down
@@ -1492,7 +1645,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1493,7 +1646,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// CraftBukkit start
// Run tasks that are waiting on processing
MinecraftTimings.processQueueTimer.startTiming(); // Spigot
@ -12123,7 +12123,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
this.processQueue.remove().run();
}
MinecraftTimings.processQueueTimer.stopTiming(); // Spigot
@@ -1500,13 +1653,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1501,13 +1654,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
MinecraftTimings.timeUpdateTimer.startTiming(); // Spigot // Paper
// Send time updates to everyone, it will get the right time from the world the player is in.
// Paper start - optimize time updates
@ -12140,7 +12140,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
continue;
}
ServerPlayer entityplayer = (ServerPlayer) entityhuman;
@@ -1519,13 +1672,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1520,13 +1673,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// Paper end
MinecraftTimings.timeUpdateTimer.stopTiming(); // Spigot // Paper
@ -12157,7 +12157,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
this.profiler.push(() -> {
return worldserver + " " + worldserver.dimension().location();
@@ -1542,7 +1693,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1543,7 +1694,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
try {
worldserver.timings.doTick.startTiming(); // Spigot
@ -12166,7 +12166,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
// Paper start
for (final io.papermc.paper.chunk.SingleThreadChunkRegionManager regionManager : worldserver.getChunkSource().chunkMap.regionManagers) {
regionManager.recalculateRegions();
@@ -1566,17 +1717,17 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1567,17 +1718,17 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.profiler.pop();
this.profiler.pop();
@ -12188,7 +12188,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
MinecraftTimings.playerListTimer.stopTiming(); // Spigot // Paper
if (SharedConstants.IS_RUNNING_IN_IDE) {
GameTestTicker.SINGLETON.tick();
@@ -1585,7 +1736,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1586,7 +1737,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.profiler.popPush("server gui refresh");
MinecraftTimings.tickablesTimer.startTiming(); // Spigot // Paper
@ -12197,7 +12197,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
((Runnable) this.tickables.get(i)).run();
}
MinecraftTimings.tickablesTimer.stopTiming(); // Spigot // Paper
@@ -1976,6 +2127,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1977,6 +2128,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
public void invalidateStatus() {
@ -12213,7 +12213,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
this.lastServerStatus = 0L;
}
@@ -1990,6 +2150,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1991,6 +2151,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@Override
public void executeIfPossible(Runnable runnable) {
@ -12221,7 +12221,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
if (this.isStopped()) {
throw new RejectedExecutionException("Server already shutting down");
} else {
@@ -2737,33 +2898,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -2740,33 +2901,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
static final long TASK_EXECUTION_FAILURE_BACKOFF = 5L * 1000L; // 5us
@ -12261,7 +12261,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
// it's shown to be bad to constantly hit the queue (chunk loads slow to a crawl), even if no tasks are executed.
// so, backoff to prevent this
return;
@@ -2772,13 +2918,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -2775,13 +2921,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
co.aikar.timings.MinecraftTimings.midTickChunkTasks.startTiming();
try {
for (;;) {
@ -12277,7 +12277,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
}
// note: negative values reduce the time
@@ -2791,7 +2937,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -2794,7 +2940,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
double overuseCount = (double)overuse/(double)MAX_CHUNK_EXEC_TIME;
long extraSleep = (long)Math.round(overuseCount*CHUNK_TASK_QUEUE_BACKOFF_MIN_TIME);
@ -15889,10 +15889,10 @@ index bf1a77cf9bbea4e2104b2a8c61309e740f28d51b..acc8af33ad8534d812908b0feb9a1963
for (ServerPlayer player : ServerLevel.this.players) {
player.getBukkitEntity().onEntityRemove(entity);
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index a3cef477646abf6172d4e50a28ed30f04c30d667..d2ba72653cad27380600f0e013d0954ee22baf9c 100644
index 4231c3fe14a621d237bdc3d56c593f0adc0a7bc6..7935fccf078ba92b3bafde7eb3cd146f57af37c2 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -187,7 +187,7 @@ import org.bukkit.inventory.MainHand;
@@ -188,7 +188,7 @@ import org.bukkit.inventory.MainHand;
public class ServerPlayer extends Player {
private static final Logger LOGGER = LogUtils.getLogger();
@ -15901,7 +15901,7 @@ index a3cef477646abf6172d4e50a28ed30f04c30d667..d2ba72653cad27380600f0e013d0954e
private static final int NEUTRAL_MOB_DEATH_NOTIFICATION_RADII_XZ = 32;
private static final int NEUTRAL_MOB_DEATH_NOTIFICATION_RADII_Y = 10;
public ServerGamePacketListenerImpl connection;
@@ -248,11 +248,7 @@ public class ServerPlayer extends Player {
@@ -249,11 +249,7 @@ public class ServerPlayer extends Player {
public boolean queueHealthUpdatePacket = false;
public net.minecraft.network.protocol.game.ClientboundSetHealthPacket queuedHealthUpdatePacket;
// Paper end
@ -15914,7 +15914,7 @@ index a3cef477646abf6172d4e50a28ed30f04c30d667..d2ba72653cad27380600f0e013d0954e
// CraftBukkit start
public String displayName;
@@ -414,7 +410,7 @@ public class ServerPlayer extends Player {
@@ -415,7 +411,7 @@ public class ServerPlayer extends Player {
this.adventure$displayName = net.kyori.adventure.text.Component.text(this.getScoreboardName()); // Paper
this.bukkitPickUpLoot = true;
this.maxHealthCache = this.getMaxHealth();
@ -15923,7 +15923,7 @@ index a3cef477646abf6172d4e50a28ed30f04c30d667..d2ba72653cad27380600f0e013d0954e
}
// Yes, this doesn't match Vanilla, but it's the best we can do for now.
@@ -456,11 +452,11 @@ public class ServerPlayer extends Player {
@@ -457,11 +453,11 @@ public class ServerPlayer extends Player {
}
// CraftBukkit end
@ -15938,7 +15938,7 @@ index a3cef477646abf6172d4e50a28ed30f04c30d667..d2ba72653cad27380600f0e013d0954e
int j = Mth.floor(world.getWorldBorder().getDistanceToBorder((double) blockposition.getX(), (double) blockposition.getZ()));
if (j < i) {
@@ -474,33 +470,76 @@ public class ServerPlayer extends Player {
@@ -475,33 +471,76 @@ public class ServerPlayer extends Player {
long k = (long) (i * 2 + 1);
long l = k * k;
int i1 = l > 2147483647L ? Integer.MAX_VALUE : (int) l;
@ -16034,7 +16034,7 @@ index a3cef477646abf6172d4e50a28ed30f04c30d667..d2ba72653cad27380600f0e013d0954e
return horizontalSpawnArea <= 16 ? horizontalSpawnArea - 1 : 17;
}
@@ -1159,6 +1198,343 @@ public class ServerPlayer extends Player {
@@ -1160,6 +1199,343 @@ public class ServerPlayer extends Player {
}
}
@ -16378,7 +16378,7 @@ index a3cef477646abf6172d4e50a28ed30f04c30d667..d2ba72653cad27380600f0e013d0954e
@Nullable
@Override
public Entity changeDimension(ServerLevel destination) {
@@ -1168,6 +1544,11 @@ public class ServerPlayer extends Player {
@@ -1169,6 +1545,11 @@ public class ServerPlayer extends Player {
@Nullable
public Entity changeDimension(ServerLevel worldserver, PlayerTeleportEvent.TeleportCause cause) {
@ -16390,7 +16390,7 @@ index a3cef477646abf6172d4e50a28ed30f04c30d667..d2ba72653cad27380600f0e013d0954e
// CraftBukkit end
if (this.isSleeping()) return this; // CraftBukkit - SPIGOT-3154
// this.isChangingDimension = true; // CraftBukkit - Moved down and into PlayerList#changeDimension
@@ -2098,6 +2479,12 @@ public class ServerPlayer extends Player {
@@ -2109,6 +2490,12 @@ public class ServerPlayer extends Player {
public void setCamera(@Nullable Entity entity) {
Entity entity1 = this.getCamera();
@ -16403,7 +16403,7 @@ index a3cef477646abf6172d4e50a28ed30f04c30d667..d2ba72653cad27380600f0e013d0954e
this.camera = (Entity) (entity == null ? this : entity);
if (entity1 != this.camera) {
// Paper start - Add PlayerStartSpectatingEntityEvent and PlayerStopSpectatingEntity Event
@@ -2559,7 +2946,7 @@ public class ServerPlayer extends Player {
@@ -2570,7 +2957,7 @@ public class ServerPlayer extends Player {
this.experienceLevel = this.newLevel;
this.totalExperience = this.newTotalExp;
this.experienceProgress = 0;
@ -16413,7 +16413,7 @@ index a3cef477646abf6172d4e50a28ed30f04c30d667..d2ba72653cad27380600f0e013d0954e
this.removeAllEffects(org.bukkit.event.entity.EntityPotionEffectEvent.Cause.DEATH);
this.effectsDirty = true;
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
index 0a3eb5e929c605d9eb7369de8ade8b49951f5d37..6b7b44ad8cb7ece5cfbf69bc54ed589a34f448a2 100644
index 1d33c02088c150189d7f4b0aa27f6a1de96b11cf..59a9a9633ac924c606564b75298fae22f1ffd4ec 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
@@ -123,11 +123,11 @@ public class ServerPlayerGameMode {
@ -16439,7 +16439,7 @@ index 0a3eb5e929c605d9eb7369de8ade8b49951f5d37..6b7b44ad8cb7ece5cfbf69bc54ed589a
if (iblockdata == null) {
this.isDestroyingBlock = false;
return;
@@ -408,7 +408,7 @@ public class ServerPlayerGameMode {
@@ -416,7 +416,7 @@ public class ServerPlayerGameMode {
} else {
// CraftBukkit start
org.bukkit.block.BlockState state = bblock.getState();
@ -16448,7 +16448,7 @@ index 0a3eb5e929c605d9eb7369de8ade8b49951f5d37..6b7b44ad8cb7ece5cfbf69bc54ed589a
// CraftBukkit end
block.playerWillDestroy(this.level, pos, iblockdata, this.player);
boolean flag = this.level.removeBlock(pos, false);
@@ -436,8 +436,8 @@ public class ServerPlayerGameMode {
@@ -444,8 +444,8 @@ public class ServerPlayerGameMode {
// return true; // CraftBukkit
}
// CraftBukkit start
@ -17710,7 +17710,7 @@ index 93a1e990b0a6caae4143c2f9d09bfb368fa1d6db..ad3166481dd37f4b5380f8bf28653bb4
itemstack = entityliving2.getMainHandItem();
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 9a1e8589e6b371869b2199650172d61ae186c907..f038f6d4e9fc4b76d5774fc637171191405ee7bb 100644
index 4705d7066207250c03a5f98eef61554c901f2e35..17b3c16008d801fa61cb3e7d89f31a4e0c166ac7 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -165,7 +165,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@ -18657,7 +18657,7 @@ index 9a1e8589e6b371869b2199650172d61ae186c907..f038f6d4e9fc4b76d5774fc637171191
// CraftBukkit end
// Paper start - fix bad state entities causing dupes
if (!isAlive() || !valid) {
@@ -3904,17 +4680,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -3910,17 +4686,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
// Paper start
public void startSeenByPlayer(ServerPlayer player) {
@ -18677,7 +18677,7 @@ index 9a1e8589e6b371869b2199650172d61ae186c907..f038f6d4e9fc4b76d5774fc637171191
}
// Paper end
@@ -4405,7 +5177,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -4411,7 +5183,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
}
}
// Paper end - fix MC-4
@ -18687,7 +18687,7 @@ index 9a1e8589e6b371869b2199650172d61ae186c907..f038f6d4e9fc4b76d5774fc637171191
synchronized (this.posLock) { // Paper
this.position = new Vec3(x, y, z);
} // Paper
@@ -4426,7 +5199,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -4432,7 +5205,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
// Paper start - never allow AABB to become desynced from position
// hanging has its own special logic
@ -18696,7 +18696,7 @@ index 9a1e8589e6b371869b2199650172d61ae186c907..f038f6d4e9fc4b76d5774fc637171191
this.setBoundingBox(this.makeBoundingBox());
}
// Paper end
@@ -4513,6 +5286,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -4519,6 +5292,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
return this.removalReason != null;
}
@ -18709,7 +18709,7 @@ index 9a1e8589e6b371869b2199650172d61ae186c907..f038f6d4e9fc4b76d5774fc637171191
@Nullable
public Entity.RemovalReason getRemovalReason() {
return this.removalReason;
@@ -4537,7 +5316,23 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -4543,7 +5322,23 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
if (reason != RemovalReason.UNLOADED_TO_CHUNK) this.getPassengers().forEach(Entity::stopRiding); // Paper - chunk system - don't adjust passenger state when unloading, it's just not safe (and messes with our logic in entity chunk unload)
this.levelCallback.onRemove(reason);
@ -19492,7 +19492,7 @@ index 6023b9eb3001e1a98ab8b970d853c4e7c7603f4d..0d16b7ea1e2c7d430b09721d50ea199a
}
});
diff --git a/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java b/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java
index ae9f9112ce9bec82e7571f679017f1723d9eb982..509718d30800f94ea7d3233aba8566547e5766af 100644
index 5d199fe497bd852827d3d18fb7566a09e70331a3..db6139c04ce9a1bc17e4305f5644c0e1ff9bf02e 100644
--- a/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java
+++ b/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java
@@ -32,16 +32,14 @@ public class WanderingTraderSpawner implements CustomSpawner {
@ -19515,7 +19515,7 @@ index ae9f9112ce9bec82e7571f679017f1723d9eb982..509718d30800f94ea7d3233aba856654
//this.spawnDelay = properties.getWanderingTraderSpawnDelay(); // Paper - This value is read from the world file only for the first spawn, after which vanilla uses a hardcoded value
//this.spawnChance = properties.getWanderingTraderSpawnChance(); // Paper - This value is read from the world file only for the first spawn, after which vanilla uses a hardcoded value
//if (this.spawnDelay == 0 && this.spawnChance == 0) {
@@ -56,37 +54,37 @@ public class WanderingTraderSpawner implements CustomSpawner {
@@ -56,36 +54,37 @@ public class WanderingTraderSpawner implements CustomSpawner {
@Override
public int tick(ServerLevel world, boolean spawnMonsters, boolean spawnAnimals) {
@ -19555,10 +19555,9 @@ index ae9f9112ce9bec82e7571f679017f1723d9eb982..509718d30800f94ea7d3233aba856654
- int i = this.spawnChance;
+ int i = worldData.wanderingTraderSpawnChance; // Folia - region threading
- this.serverLevelData.setWanderingTraderSpawnChance(this.spawnChance);
// this.serverLevelData.setWanderingTraderSpawnChance(this.spawnChance); // Paper - We don't need to save this value to disk if it gets set back to a hardcoded value anyways
- this.spawnChance = Mth.clamp(i + world.paperConfig().entities.spawning.wanderingTrader.spawnChanceFailureIncrement, world.paperConfig().entities.spawning.wanderingTrader.spawnChanceMin, world.paperConfig().entities.spawning.wanderingTrader.spawnChanceMax);
+ worldData.wanderingTraderSpawnChance = Mth.clamp(i + world.paperConfig().entities.spawning.wanderingTrader.spawnChanceFailureIncrement, world.paperConfig().entities.spawning.wanderingTrader.spawnChanceMin, world.paperConfig().entities.spawning.wanderingTrader.spawnChanceMax); // Folia - region threading
//this.serverLevelData.setWanderingTraderSpawnChance(this.spawnChance); // Paper - We don't need to save this value to disk if it gets set back to a hardcoded value anyways
if (this.random.nextInt(100) > i) {
return 0;
} else if (this.spawn(world)) {
@ -19567,7 +19566,7 @@ index ae9f9112ce9bec82e7571f679017f1723d9eb982..509718d30800f94ea7d3233aba856654
// Paper end
return 1;
} else {
@@ -98,7 +96,7 @@ public class WanderingTraderSpawner implements CustomSpawner {
@@ -97,7 +96,7 @@ public class WanderingTraderSpawner implements CustomSpawner {
}
private boolean spawn(ServerLevel world) {
@ -19576,7 +19575,7 @@ index ae9f9112ce9bec82e7571f679017f1723d9eb982..509718d30800f94ea7d3233aba856654
if (entityplayer == null) {
return true;
@@ -128,7 +126,7 @@ public class WanderingTraderSpawner implements CustomSpawner {
@@ -127,7 +126,7 @@ public class WanderingTraderSpawner implements CustomSpawner {
this.tryToSpawnLlamaFor(world, entityvillagertrader, 4);
}
@ -20082,7 +20081,7 @@ index d7a0cbde8f8c99276307502674c71463fbe7e89c..2a501b3fa8d69f627b279fd035fd2cb1
}
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
index a6253272205337b3b855679b3057c2519a807a4c..c867737f839598b996b58942017ff6f5b2aaa3f0 100644
index d690b8d0c1da1f56b226376df8c76c34375e3c73..6e6f73d50725057bc713bc6ae3a31b77ee97d415 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
@@ -334,6 +334,7 @@ public final class ItemStack {
@ -20131,7 +20130,7 @@ index a6253272205337b3b855679b3057c2519a807a4c..c867737f839598b996b58942017ff6f5
StructureGrowEvent structureEvent = null;
if (treeType != null) {
boolean isBonemeal = this.getItem() == Items.BONE_MEAL;
@@ -393,12 +395,12 @@ public final class ItemStack {
@@ -394,12 +396,12 @@ public final class ItemStack {
SignItem.openSign = null; // SPIGOT-6758 - Reset on early return
return enuminteractionresult;
}
@ -20147,7 +20146,7 @@ index a6253272205337b3b855679b3057c2519a807a4c..c867737f839598b996b58942017ff6f5
if (blocks.size() > 1) {
placeEvent = org.bukkit.craftbukkit.event.CraftEventFactory.callBlockMultiPlaceEvent(world, entityhuman, enumhand, blocks, blockposition.getX(), blockposition.getY(), blockposition.getZ());
} else if (blocks.size() == 1 && item != Items.POWDER_SNOW_BUCKET) { // Paper - don't call event twice for snow buckets
@@ -409,13 +411,13 @@ public final class ItemStack {
@@ -410,13 +412,13 @@ public final class ItemStack {
enuminteractionresult = InteractionResult.FAIL; // cancel placement
// PAIL: Remove this when MC-99075 fixed
placeEvent.getPlayer().updateInventory();
@ -20164,7 +20163,7 @@ index a6253272205337b3b855679b3057c2519a807a4c..c867737f839598b996b58942017ff6f5
// Brute force all possible updates
BlockPos placedPos = ((CraftBlock) placeEvent.getBlock()).getPosition();
@@ -430,7 +432,7 @@ public final class ItemStack {
@@ -431,7 +433,7 @@ public final class ItemStack {
this.setCount(newCount);
}
@ -20173,7 +20172,7 @@ index a6253272205337b3b855679b3057c2519a807a4c..c867737f839598b996b58942017ff6f5
world.setBlockEntity(e.getValue());
}
@@ -504,8 +506,8 @@ public final class ItemStack {
@@ -505,8 +507,8 @@ public final class ItemStack {
entityhuman.awardStat(Stats.ITEM_USED.get(item));
}
}
@ -23751,10 +23750,10 @@ index ff6559bf563f2fdcc0f2843d4f4aa24d7ddfb6db..2ead9af36c4d41c61b68a960ff17e258
if (chunk != null) addTicket(x, z); // Paper
ret.complete(chunk == null ? null : chunk.getBukkitChunk());
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CapturedBlockState.java b/src/main/java/org/bukkit/craftbukkit/block/CapturedBlockState.java
index fb6454cc64ebc549f61ad7d51efb16ef15f8384d..903408d4d8f9ce5c9566ec96312281ab15f16c2f 100644
index a3d5e319473e2f6316b3ef8edf719296e02d85a1..55abed5fdf8dc699ade5b25b1f1949417dbf7a69 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/CapturedBlockState.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/CapturedBlockState.java
@@ -40,6 +40,7 @@ public final class CapturedBlockState extends CraftBlockState {
@@ -46,6 +46,7 @@ public final class CapturedBlockState extends CraftBlockState {
for (int k = 0; k < j; ++k) {
Bee entitybee = new Bee(EntityType.BEE, generatoraccessseed.getMinecraftWorld());
@ -24117,7 +24116,7 @@ index 57a0dbb23a32123d30c3b3572f4d129be9d97847..3f46d9398add0e97a2b8b072f66b48b0
@Override
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index e769c1c2a99a13941124c7442d44a509e7859666..aac6d175e17b8419f7938c432a8fbbf3c34f3fbe 100644
index fec408416aa63e1022802a644bb95131601f0c3b..c6e6ce4a077550e8e86995f18a4deda4b7b369eb 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -564,7 +564,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@ -24150,7 +24149,7 @@ index e769c1c2a99a13941124c7442d44a509e7859666..aac6d175e17b8419f7938c432a8fbbf3
if (entry != null) {
entry.removePlayer(this.getHandle());
}
@@ -1858,7 +1863,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1863,7 +1868,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
this.getHandle().connection.send(ClientboundPlayerInfoUpdatePacket.createPlayerInitializing(List.of(otherPlayer)));
}

View File

@ -51,7 +51,7 @@ index d9687722e02dfd4088c7030abbf5008eb0a092c8..62484ebf4550b05182f693a3180bbac5
TickThread.ensureTickThread(thisEntity, "May not tick entity scheduler asynchronously");
final List<ScheduledTask> toRun;
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index f038f6d4e9fc4b76d5774fc637171191405ee7bb..55a03a3b22c37338d32aeb0878169c4462d1a1d0 100644
index 17b3c16008d801fa61cb3e7d89f31a4e0c166ac7..068d4a60db0c5c849e4ea555c7e8936906d812f6 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2767,6 +2767,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@ -2147,7 +2147,7 @@ index beea227855f0b978e655efc298024120df8f4945..e1b7922ed298b6b3068c3f5fbe3b4030
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index aac6d175e17b8419f7938c432a8fbbf3c34f3fbe..34bddd5478a2bb6cd880970765933abcfdde173f 100644
index c6e6ce4a077550e8e86995f18a4deda4b7b369eb..545a7c3ba18c983681eb5489ff6c6da41ee18988 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -584,7 +584,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@ -2159,7 +2159,7 @@ index aac6d175e17b8419f7938c432a8fbbf3c34f3fbe..34bddd5478a2bb6cd880970765933abc
final ServerGamePacketListenerImpl connection = this.getHandle().connection;
if (connection != null) {
connection.disconnect(message == null ? net.kyori.adventure.text.Component.empty() : message, cause);
@@ -1968,9 +1968,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1978,9 +1978,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
return this;
}
@ -2177,7 +2177,7 @@ index aac6d175e17b8419f7938c432a8fbbf3c34f3fbe..34bddd5478a2bb6cd880970765933abc
}
public void setHandle(final ServerPlayer entity) {
@@ -2996,7 +3003,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -3006,7 +3013,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
{
if ( CraftPlayer.this.getHealth() <= 0 && CraftPlayer.this.isOnline() )
{
@ -2524,10 +2524,10 @@ index d8b4df1300791aaf310465ec1577b1b8c202901a..17b83eb8563586f1ddf252f438d52d55
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftSniffer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftSniffer.java
index 92d1c7943c7ddb5d29b657f8da74e29dfe051c2b..5dc45789f92a49ce461db06b322d14e897d2f951 100644
index 5fde54aa18cc3e474e5ea252efed91a7e1809929..a1dfa6c6368311e78b76c8c30227461ccb3eea9e 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftSniffer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftSniffer.java
@@ -10,8 +10,16 @@ public class CraftSniffer extends CraftAnimals implements Sniffer {
@@ -16,8 +16,16 @@ public class CraftSniffer extends CraftAnimals implements Sniffer {
super(server, entity);
}

View File

@ -10,10 +10,10 @@ the impact from scaling the region threads, but is not a fix
to the underlying issue.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 26350a185cadbb64696b2a1ac88b1a2be06fd587..61a7d2728c6f4b936dc8f1031950374f2c35cac7 100644
index f5977082a31d44088ab5ba31fad88e823cfe56e0..f5721f6d719b7055fdccc81d5e67ed758e90cb10 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -2906,6 +2906,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -2909,6 +2909,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
public final void executeMidTickTasks() {

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Require plugins to be explicitly marked as Folia supported
diff --git a/src/main/java/io/papermc/paper/plugin/provider/configuration/PaperPluginMeta.java b/src/main/java/io/papermc/paper/plugin/provider/configuration/PaperPluginMeta.java
index 3808f5a9abc9f084cbabfc4cb95394cc37aaf4bb..19a136c482ba28a2fcedc8e9c889510c974b8f68 100644
index 7605efe37ac4a63cb95c8c64c576e93c0e676cc0..bf4da696710026febea85ffcc559621d1ea33e45 100644
--- a/src/main/java/io/papermc/paper/plugin/provider/configuration/PaperPluginMeta.java
+++ b/src/main/java/io/papermc/paper/plugin/provider/configuration/PaperPluginMeta.java
@@ -62,6 +62,7 @@ public class PaperPluginMeta implements PluginMeta {
@ -31,7 +31,7 @@ index 3808f5a9abc9f084cbabfc4cb95394cc37aaf4bb..19a136c482ba28a2fcedc8e9c889510c
public @NotNull List<String> getProvidedPlugins() {
return this.provides;
diff --git a/src/main/java/io/papermc/paper/plugin/provider/type/paper/PaperPluginProviderFactory.java b/src/main/java/io/papermc/paper/plugin/provider/type/paper/PaperPluginProviderFactory.java
index eb0464a52d99a916bca8f93cd9294cdc30893671..923019a5823033871ab61ed9ed7625a2bc4d2b3d 100644
index 1ba051931d3ce6ac0bef559911e4453044266aab..dc81e1a9faa54ba677bede6d7ca2414b1d7b6003 100644
--- a/src/main/java/io/papermc/paper/plugin/provider/type/paper/PaperPluginProviderFactory.java
+++ b/src/main/java/io/papermc/paper/plugin/provider/type/paper/PaperPluginProviderFactory.java
@@ -24,6 +24,11 @@ class PaperPluginProviderFactory implements PluginTypeFactory<PaperPluginParent,
@ -45,7 +45,7 @@ index eb0464a52d99a916bca8f93cd9294cdc30893671..923019a5823033871ab61ed9ed7625a2
+ // Folia end - block plugins not marked as supported
Logger jul = PaperPluginLogger.getLogger(configuration);
ComponentLogger logger = ComponentLogger.logger(jul.getName());
PluginProviderContext context = PluginProviderContextImpl.of(configuration, logger);
PluginProviderContext context = PluginProviderContextImpl.of(configuration, logger, source);
diff --git a/src/main/java/io/papermc/paper/plugin/provider/type/spigot/SpigotPluginProviderFactory.java b/src/main/java/io/papermc/paper/plugin/provider/type/spigot/SpigotPluginProviderFactory.java
index 14ed05945ba5bfeb2b539d4786278b0e04130404..ad13d60eeb94a75c97b3d0696c39d834d6082bfa 100644
--- a/src/main/java/io/papermc/paper/plugin/provider/type/spigot/SpigotPluginProviderFactory.java