9
0
mirror of https://github.com/Samsuik/Sakura.git synced 2025-12-19 14:59:30 +00:00

Updated Upstream (Paper)

Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@e0ba395 Add missing plugin ticket comparator fixes #13130
PaperMC/Paper@21b4930 Fix diff in FlowingFluid#canPassThroughWall
PaperMC/Paper@dcd7847 Improve server tick loop
PaperMC/Paper@a4a7461 Rebase fixups
PaperMC/Paper@dc66e8c Return Server#getTPS over minute intervals instead of seconds
PaperMC/Paper@b63dc92 Restore currentTick counter increment as temp feature patch
PaperMC/Paper@523efa4 Flatten currentTick incr into file patches
PaperMC/Paper@4dcd837 Add CommandSourceStack to UnknownCommandEvent (#13083)
PaperMC/Paper@ffd5158 Update 1.21.9 reobf mappings data (#13135)
PaperMC/Paper@b4b1f11 [ci skip] Add docs for virtual createMerchant in MerchantInventoryViewBuilder#merchant (#13125)
PaperMC/Paper@b3d2158 Disable javadoc.io links
PaperMC/Paper@8483163 Yield millis from Bukkit#getAverageTickTime
This commit is contained in:
Samsuik
2025-10-06 20:35:12 +01:00
parent e629d9bceb
commit f194568a55
7 changed files with 30 additions and 26 deletions

View File

@@ -2,7 +2,7 @@ group=me.samsuik.sakura
version=1.21.9-R0.1-SNAPSHOT version=1.21.9-R0.1-SNAPSHOT
mcVersion=1.21.9 mcVersion=1.21.9
paperRef=a3f247c258c4ade42011cbc6f4e2024298e673cf paperRef=8483163895efbe6d71812c1e2e456330c1aa7859
org.gradle.jvmargs=-Xmx2G org.gradle.jvmargs=-Xmx2G
org.gradle.vfs.watch=false org.gradle.vfs.watch=false

View File

@@ -24,8 +24,8 @@
+ activeFork = fork + activeFork = fork
+ +
spigot { spigot {
enabled = false enabled = true
buildDataRef = "436eac9815c211be1a2a6ca0702615f995e81c44" buildDataRef = "42d18d4c4653ffc549778dbe223f6994a031d69e"
@@ -107,7 +_,20 @@ @@ -107,7 +_,20 @@
} }
} }

View File

@@ -5,10 +5,10 @@ Subject: [PATCH] Track block changes and level tick scheduler
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
index a90e5cb4d989f38f7011a6ddd8c539a67e51494c..b2b8c9a651bab91491b4306dbb9d5a818e06869d 100644 index 9d5d30f70fc348ca31ca88e7d8650ea5e338732d..bb53b16be00c0cbb2f16f749d41aad28b70da872 100644
--- a/net/minecraft/server/MinecraftServer.java --- a/net/minecraft/server/MinecraftServer.java
+++ b/net/minecraft/server/MinecraftServer.java +++ b/net/minecraft/server/MinecraftServer.java
@@ -1687,6 +1687,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1793,6 +1793,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
profilerFiller.pop(); profilerFiller.pop();
profilerFiller.pop(); profilerFiller.pop();
serverLevel.explosionDensityCache.clear(); // Paper - Optimize explosions serverLevel.explosionDensityCache.clear(); // Paper - Optimize explosions

View File

@@ -50,11 +50,11 @@ index 2082b7506a403ed6815076cbd0d3b7eecd7225a0..82dac4fbaf3572391dad61356ba5351b
// bound y // bound y
diff --git a/net/minecraft/server/level/TicketType.java b/net/minecraft/server/level/TicketType.java diff --git a/net/minecraft/server/level/TicketType.java b/net/minecraft/server/level/TicketType.java
index e3a4b57f374bbe9792d86e60da1a115abcc9cd66..c22a4c45da0a4c3f6c043d40b6a9a9cd50a64667 100644 index 25ea504fa93f78b43237e1c79f8b5685a2aa6d7c..5395b3e0491f197ffea3910d3f172dcdef881758 100644
--- a/net/minecraft/server/level/TicketType.java --- a/net/minecraft/server/level/TicketType.java
+++ b/net/minecraft/server/level/TicketType.java +++ b/net/minecraft/server/level/TicketType.java
@@ -62,6 +62,7 @@ public final class TicketType<T> implements ca.spottedleaf.moonrise.patches.chun @@ -62,6 +62,7 @@ public final class TicketType<T> implements ca.spottedleaf.moonrise.patches.chun
public static final TicketType PLUGIN_TICKET = register("plugin_ticket", NO_TIMEOUT, FLAG_LOADING | FLAG_SIMULATION); // Paper public static final TicketType PLUGIN_TICKET = register("plugin_ticket", NO_TIMEOUT, FLAG_LOADING | FLAG_SIMULATION); static { ((TicketType<org.bukkit.plugin.Plugin>)PLUGIN_TICKET).moonrise$setIdentifierComparator((org.bukkit.plugin.Plugin p1, org.bukkit.plugin.Plugin p2) -> p1.getName().compareTo(p2.getName())); } // Paper // Paper - rewrite chunk system
public static final TicketType FUTURE_AWAIT = register("future_await", NO_TIMEOUT, FLAG_LOADING | FLAG_SIMULATION); // Paper public static final TicketType FUTURE_AWAIT = register("future_await", NO_TIMEOUT, FLAG_LOADING | FLAG_SIMULATION); // Paper
public static final TicketType CHUNK_LOAD = register("chunk_load", NO_TIMEOUT, FLAG_LOADING); // Paper - moonrise public static final TicketType CHUNK_LOAD = register("chunk_load", NO_TIMEOUT, FLAG_LOADING); // Paper - moonrise
+ public static final TicketType ENTITY_MOVEMENT = register("entity_movement", 200L, FLAG_LOADING | FLAG_SIMULATION); // Sakura - load chunks on movement + public static final TicketType ENTITY_MOVEMENT = register("entity_movement", 200L, FLAG_LOADING | FLAG_SIMULATION); // Sakura - load chunks on movement

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/MinecraftServer.java --- a/net/minecraft/server/MinecraftServer.java
+++ b/net/minecraft/server/MinecraftServer.java +++ b/net/minecraft/server/MinecraftServer.java
@@ -307,6 +_,7 @@ @@ -299,6 +_,7 @@
public volatile boolean abnormalExit; // Paper - Improved watchdog support public volatile boolean abnormalExit; // Paper - Improved watchdog support
public volatile Thread shutdownThread; // Paper - Improved watchdog support public volatile Thread shutdownThread; // Paper - Improved watchdog support
public final io.papermc.paper.configuration.PaperConfigurations paperConfigurations; // Paper - add paper configuration files public final io.papermc.paper.configuration.PaperConfigurations paperConfigurations; // Paper - add paper configuration files
@@ -8,7 +8,7 @@
public boolean isIteratingOverLevels = false; // Paper - Throw exception on world create while being ticked public boolean isIteratingOverLevels = false; // Paper - Throw exception on world create while being ticked
private final Set<String> pluginsBlockingSleep = new java.util.HashSet<>(); // Paper - API to allow/disallow tick sleeping private final Set<String> pluginsBlockingSleep = new java.util.HashSet<>(); // Paper - API to allow/disallow tick sleeping
public static final long SERVER_INIT = System.nanoTime(); // Paper - Lag compensation public static final long SERVER_INIT = System.nanoTime(); // Paper - Lag compensation
@@ -326,6 +_,17 @@ @@ -362,6 +_,17 @@
thread.start(); thread.start();
return minecraftServer; return minecraftServer;
} }
@@ -26,7 +26,7 @@
// Paper start - rewrite chunk system // Paper start - rewrite chunk system
private volatile Throwable chunkSystemCrash; private volatile Throwable chunkSystemCrash;
@@ -476,6 +_,10 @@ @@ -512,6 +_,10 @@
Runtime.getRuntime().addShutdownHook(new org.bukkit.craftbukkit.util.ServerShutdownThread(this)); Runtime.getRuntime().addShutdownHook(new org.bukkit.craftbukkit.util.ServerShutdownThread(this));
// CraftBukkit end // CraftBukkit end
this.paperConfigurations = services.paper().configurations(); // Paper - add paper configuration files this.paperConfigurations = services.paper().configurations(); // Paper - add paper configuration files
@@ -37,19 +37,23 @@
} }
private void readScoreboard(DimensionDataStorage dataStorage) { private void readScoreboard(DimensionDataStorage dataStorage) {
@@ -1155,6 +_,7 @@ @@ -1277,6 +_,11 @@
if (++MinecraftServer.currentTick % MinecraftServer.SAMPLE_INTERVAL == 0) {
final long diff = currentTime - tickSection; this.currentTickStart = tickStart;
final java.math.BigDecimal currentTps = TPS_BASE.divide(new java.math.BigDecimal(diff), 30, java.math.RoundingMode.HALF_UP); ++MinecraftServer.currentTick;
+ this.tickInformationCollector.levelData(this.levels.values(), currentTps.doubleValue()); // Sakura - track tick information + // Sakura start - track tick information
tps1.add(currentTps, diff); + if (MinecraftServer.currentTick % 20 == 0) {
tps5.add(currentTps, diff); + this.tickInformationCollector.levelData(this.levels.values(), getTPS(this.tickTimes1s, tickStart, l));
tps15.add(currentTps, diff); + }
@@ -1192,6 +_,7 @@ + // Sakura end - track tick information
// Paper end - rewrite chunk system // Paper end - improve tick loop
boolean flag = l == 0L;
@@ -1303,6 +_,7 @@
this.tickFrame.end(); this.tickFrame.end();
this.recordEndOfTick(); // Paper - improve tick loop
profilerFiller.popPush("nextTickWait"); profilerFiller.popPush("nextTickWait");
+ this.tickInformationCollector.tickDuration((System.nanoTime() - currentTime) / 1_000_000L); // Sakura - track tick information + this.tickInformationCollector.tickDuration((System.nanoTime() - tickStart) / 1_000_000L); // Sakura - track tick information
this.mayHaveDelayedTasks = true; this.mayHaveDelayedTasks = true;
this.delayedTasksMaxNextTickTimeNanos = Math.max(Util.getNanos() + l, this.nextTickTimeNanos); this.delayedTasksMaxNextTickTimeNanos = Math.max(Util.getNanos() + l, this.nextTickTimeNanos);
this.startMeasuringTaskExecutionTime(); this.startMeasuringTaskExecutionTime();

View File

@@ -135,7 +135,7 @@
} }
// Paper start - fluid method optimisations // Paper start - fluid method optimisations
@@ -417,7 +_,7 @@ @@ -415,7 +_,7 @@
if (blockState == null) continue; // Paper - Prevent chunk loading from fluid flowing if (blockState == null) continue; // Paper - Prevent chunk loading from fluid flowing
FluidState fluidState = blockState.getFluidState(); FluidState fluidState = blockState.getFluidState();
if (this.canMaybePassThrough(level, pos, state, direction, blockPos, blockState, fluidState)) { if (this.canMaybePassThrough(level, pos, state, direction, blockPos, blockState, fluidState)) {
@@ -144,7 +144,7 @@
if (canHoldSpecificFluid(level, blockPos, blockState, newLiquid.getType())) { if (canHoldSpecificFluid(level, blockPos, blockState, newLiquid.getType())) {
if (spreadContext == null) { if (spreadContext == null) {
spreadContext = new FlowingFluid.SpreadContext(level, pos); spreadContext = new FlowingFluid.SpreadContext(level, pos);
@@ -468,6 +_,11 @@ @@ -466,6 +_,11 @@
} }
private static boolean canHoldSpecificFluid(BlockGetter level, BlockPos pos, BlockState state, Fluid fluid) { private static boolean canHoldSpecificFluid(BlockGetter level, BlockPos pos, BlockState state, Fluid fluid) {
@@ -156,7 +156,7 @@
return !(state.getBlock() instanceof LiquidBlockContainer liquidBlockContainer) || liquidBlockContainer.canPlaceLiquid(null, level, pos, state, fluid); return !(state.getBlock() instanceof LiquidBlockContainer liquidBlockContainer) || liquidBlockContainer.canPlaceLiquid(null, level, pos, state, fluid);
} }
@@ -480,7 +_,7 @@ @@ -478,7 +_,7 @@
@Override @Override
public void tick(ServerLevel level, BlockPos pos, BlockState blockState, FluidState fluidState) { public void tick(ServerLevel level, BlockPos pos, BlockState blockState, FluidState fluidState) {
if (!fluidState.isSource()) { if (!fluidState.isSource()) {

View File

@@ -1,6 +1,6 @@
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -992,6 +_,7 @@ @@ -993,6 +_,7 @@
org.spigotmc.SpigotConfig.init((File) this.console.options.valueOf("spigot-settings")); // Spigot org.spigotmc.SpigotConfig.init((File) this.console.options.valueOf("spigot-settings")); // Spigot
this.console.paperConfigurations.reloadConfigs(this.console); this.console.paperConfigurations.reloadConfigs(this.console);
@@ -8,7 +8,7 @@
for (ServerLevel world : this.console.getAllLevels()) { for (ServerLevel world : this.console.getAllLevels()) {
// world.serverLevelData.setDifficulty(config.difficulty); // Paper - per level difficulty // world.serverLevelData.setDifficulty(config.difficulty); // Paper - per level difficulty
world.setSpawnSettings(world.serverLevelData.getDifficulty() != Difficulty.PEACEFUL && world.getGameRules().getBoolean(GameRules.RULE_SPAWN_MONSTERS)); // Paper - per level difficulty (from MinecraftServer#setDifficulty(ServerLevel, Difficulty, boolean)) world.setSpawnSettings(world.serverLevelData.getDifficulty() != Difficulty.PEACEFUL && world.getGameRules().getBoolean(GameRules.RULE_SPAWN_MONSTERS)); // Paper - per level difficulty (from MinecraftServer#setDifficulty(ServerLevel, Difficulty, boolean))
@@ -1023,6 +_,7 @@ @@ -1024,6 +_,7 @@
this.reloadData(); this.reloadData();
org.spigotmc.SpigotConfig.registerCommands(); // Spigot org.spigotmc.SpigotConfig.registerCommands(); // Spigot
io.papermc.paper.command.PaperCommands.registerCommands(this.console); // Paper io.papermc.paper.command.PaperCommands.registerCommands(this.console); // Paper