Updated Upstream (Paper)

Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@cdad49b7 Do not mark plugin tickets as forced; keep correct ticket types
PaperMC/Paper@a1c4fc96 Add generic ticket identifier
PaperMC/Paper@745881bb Update Moonrise common for 1.21.5
PaperMC/Paper@e9d00eb6 Apply Moonrise patch
PaperMC/Paper@ef0f0d10 Copy Moonrise 1.21.5 update over
This commit is contained in:
granny
2025-04-01 22:26:42 -07:00
parent aa0bf38f14
commit b81ab42440
15 changed files with 85 additions and 85 deletions

View File

@@ -26,7 +26,7 @@
public static <S extends MinecraftServer> S spin(Function<Thread, S> threadFunction) {
AtomicReference<S> atomicReference = new AtomicReference<>();
@@ -917,6 +_,15 @@
@@ -993,6 +_,15 @@
LOGGER.info("Stopping server");
Commands.COMMAND_SENDING_POOL.shutdownNow(); // Paper - Perf: Async command map building; Shutdown and don't bother finishing
@@ -42,7 +42,7 @@
// CraftBukkit start
if (this.server != null) {
this.server.spark.disable(); // Paper - spark
@@ -1011,6 +_,8 @@
@@ -1091,6 +_,8 @@
this.safeShutdown(waitForServer, false);
}
public void safeShutdown(boolean waitForServer, boolean isRestarting) {
@@ -51,7 +51,7 @@
this.isRestarting = isRestarting;
this.hasLoggedStop = true; // Paper - Debugging
if (isDebugging()) io.papermc.paper.util.TraceUtil.dumpTraceForThread("Server stopped"); // Paper - Debugging
@@ -1030,6 +_,7 @@
@@ -1110,6 +_,7 @@
private static final long MAX_CATCHUP_BUFFER = TICK_TIME * TPS * 60L;
private long lastTick = 0;
private long catchupTime = 0;
@@ -59,7 +59,7 @@
public final RollingAverage tps1 = new RollingAverage(60);
public final RollingAverage tps5 = new RollingAverage(60 * 5);
public final RollingAverage tps15 = new RollingAverage(60 * 15);
@@ -1115,6 +_,16 @@
@@ -1195,6 +_,16 @@
}
// Paper end - Add onboarding message for initial server start
@@ -76,7 +76,7 @@
while (this.running) {
long l;
if (!this.isPaused() && this.tickRateManager.isSprinting() && this.tickRateManager.checkShouldSprintThisTick()) {
@@ -1139,14 +_,19 @@
@@ -1219,14 +_,19 @@
if (++MinecraftServer.currentTick % MinecraftServer.SAMPLE_INTERVAL == 0) {
final long diff = currentTime - tickSection;
final java.math.BigDecimal currentTps = TPS_BASE.divide(new java.math.BigDecimal(diff), 30, java.math.RoundingMode.HALF_UP);
@@ -99,7 +99,7 @@
tickSection = currentTime;
}
// Paper end - further improve server tick loop
@@ -1171,6 +_,12 @@
@@ -1258,6 +_,12 @@
profilerFiller.popPush("nextTickWait");
this.mayHaveDelayedTasks = true;
this.delayedTasksMaxNextTickTimeNanos = Math.max(Util.getNanos() + l, this.nextTickTimeNanos);
@@ -112,7 +112,7 @@
this.startMeasuringTaskExecutionTime();
this.waitUntilNextTick();
this.finishMeasuringTaskExecutionTime();
@@ -1580,7 +_,7 @@
@@ -1668,7 +_,7 @@
long worldTime = level.getGameTime();
final ClientboundSetTimePacket worldPacket = new ClientboundSetTimePacket(worldTime, dayTime, doDaylight);
for (Player entityhuman : level.players()) {
@@ -121,7 +121,7 @@
continue;
}
ServerPlayer entityplayer = (ServerPlayer) entityhuman;
@@ -1744,7 +_,7 @@
@@ -1832,7 +_,7 @@
@DontObfuscate
public String getServerModName() {

View File

@@ -9,7 +9,7 @@
private final RandomSequences randomSequences;
// CraftBukkit start
@@ -350,7 +_,24 @@
@@ -586,7 +_,24 @@
// CraftBukkit end
this.tickTime = tickTime;
this.server = server;
@@ -35,15 +35,15 @@
this.serverLevelData = serverLevelData;
ChunkGenerator chunkGenerator = levelStem.generator();
// CraftBukkit start
@@ -431,6 +_,7 @@
this.gameEventDispatcher = new GameEventDispatcher(this);
this.randomSequences = Objects.requireNonNullElseGet(randomSequences, () -> this.getDataStorage().computeIfAbsent(RandomSequences.TYPE));
@@ -670,6 +_,7 @@
this.chunkDataController = new ca.spottedleaf.moonrise.patches.chunk_system.io.datacontroller.ChunkDataController((ServerLevel)(Object)this, this.chunkTaskScheduler);
// Paper end - rewrite chunk system
this.getCraftServer().addWorld(this.getWorld()); // CraftBukkit
+ this.preciseTime = this.serverLevelData.getDayTime(); // Purpur - Configurable daylight cycle
}
// Paper start
@@ -477,7 +_,7 @@
@@ -716,7 +_,7 @@
}
int _int = this.getGameRules().getInt(GameRules.RULE_PLAYERS_SLEEPING_PERCENTAGE);
@@ -52,7 +52,7 @@
// Paper start - create time skip event - move up calculations
final long newDayTime = this.levelData.getDayTime() + 24000L;
org.bukkit.event.world.TimeSkipEvent event = new org.bukkit.event.world.TimeSkipEvent(
@@ -594,6 +_,13 @@
@@ -835,6 +_,13 @@
this.serverLevelData.getScheduledEvents().tick(this.server, l);
Profiler.get().pop();
if (this.serverLevelData.getGameRules().getBoolean(GameRules.RULE_DAYLIGHT)) {
@@ -66,7 +66,7 @@
this.setDayTime(this.levelData.getDayTime() + 1L);
}
}
@@ -601,7 +_,21 @@
@@ -842,7 +_,21 @@
public void setDayTime(long time) {
this.serverLevelData.setDayTime(time);
@@ -89,7 +89,7 @@
public void tickCustomSpawners(boolean spawnEnemies, boolean spawnFriendlies) {
for (CustomSpawner customSpawner : this.customSpawners) {
@@ -678,9 +_,17 @@
@@ -946,9 +_,17 @@
&& this.random.nextDouble() < currentDifficultyAt.getEffectiveDifficulty() * this.paperConfig().entities.spawning.skeletonHorseThunderSpawnChance.or(0.01) // Paper - Configurable spawn chances for skeleton horses
&& !this.getBlockState(blockPos.below()).is(Blocks.LIGHTNING_ROD);
if (flag) {
@@ -109,7 +109,7 @@
skeletonHorse.setAge(0);
skeletonHorse.setPos(blockPos.getX(), blockPos.getY(), blockPos.getZ());
this.addFreshEntity(skeletonHorse, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.LIGHTNING); // CraftBukkit
@@ -738,7 +_,7 @@
@@ -1006,7 +_,7 @@
pointOfInterestType -> pointOfInterestType.is(PoiTypes.LIGHTNING_ROD),
blockPos -> blockPos.getY() == this.getHeight(Heightmap.Types.WORLD_SURFACE, blockPos.getX(), blockPos.getZ()) - 1,
pos,
@@ -118,7 +118,7 @@
PoiManager.Occupancy.ANY
);
return optional.map(blockPos -> blockPos.above(1));
@@ -787,8 +_,26 @@
@@ -1055,8 +_,26 @@
int _int = this.getGameRules().getInt(GameRules.RULE_PLAYERS_SLEEPING_PERCENTAGE);
Component component;
if (this.sleepStatus.areEnoughSleeping(_int)) {
@@ -145,7 +145,7 @@
component = Component.translatable("sleep.players_sleeping", this.sleepStatus.amountSleeping(), this.sleepStatus.sleepersNeeded(_int));
}
@@ -921,6 +_,7 @@
@@ -1189,6 +_,7 @@
@VisibleForTesting
public void resetWeatherCycle() {
// CraftBukkit start
@@ -153,7 +153,7 @@
this.serverLevelData.setRaining(false, org.bukkit.event.weather.WeatherChangeEvent.Cause.SLEEP); // Paper - Add cause to Weather/ThunderChangeEvents
// If we stop due to everyone sleeping we should reset the weather duration to some other random value.
// Not that everyone ever manages to get the whole server to sleep at the same time....
@@ -928,6 +_,7 @@
@@ -1196,6 +_,7 @@
this.serverLevelData.setRainTime(0);
}
// CraftBukkit end
@@ -161,7 +161,7 @@
this.serverLevelData.setThundering(false, org.bukkit.event.weather.ThunderChangeEvent.Cause.SLEEP); // Paper - Add cause to Weather/ThunderChangeEvents
// CraftBukkit start
// If we stop due to everyone sleeping we should reset the weather duration to some other random value.
@@ -2331,7 +_,7 @@
@@ -2644,7 +_,7 @@
// Spigot start
if (entity.getBukkitEntity() instanceof org.bukkit.inventory.InventoryHolder && (!(entity instanceof ServerPlayer) || entity.getRemovalReason() != Entity.RemovalReason.KILLED)) { // SPIGOT-6876: closeInventory clears death message
// Paper start - Fix merchant inventory not closing on entity removal

View File

@@ -9,9 +9,9 @@
+ private boolean compassBar = false; // Purpur - Add compass command
+ private boolean ramBar = false; // Purpur - Implement rambar commands
public ServerPlayer(MinecraftServer server, ServerLevel level, GameProfile gameProfile, ClientInformation clientInformation) {
super(level, level.getSharedSpawnPos(), level.getSharedSpawnAngle(), gameProfile);
@@ -525,6 +_,10 @@
// Paper start - rewrite chunk system
private ca.spottedleaf.moonrise.patches.chunk_system.player.RegionizedPlayerChunkLoader.PlayerChunkLoaderData chunkLoader;
@@ -555,6 +_,10 @@
this.respawnConfig = compound.read("respawn", ServerPlayer.RespawnConfig.CODEC).orElse(null);
this.spawnExtraParticlesOnFall = compound.getBooleanOr("spawn_extra_particles_on_fall", false);
this.raidOmenPosition = compound.read("raid_omen_position", BlockPos.CODEC).orElse(null);
@@ -22,7 +22,7 @@
}
@Override
@@ -542,6 +_,9 @@
@@ -572,6 +_,9 @@
compound.storeNullable("raid_omen_position", BlockPos.CODEC, this.raidOmenPosition);
this.saveEnderPearls(compound);
this.getBukkitEntity().setExtraData(compound); // CraftBukkit
@@ -32,7 +32,7 @@
}
private void saveParentVehicle(CompoundTag tag) {
@@ -1024,6 +_,7 @@
@@ -1054,6 +_,7 @@
)
);
Team team = this.getTeam();
@@ -40,7 +40,7 @@
if (team == null || team.getDeathMessageVisibility() == Team.Visibility.ALWAYS) {
this.server.getPlayerList().broadcastSystemMessage(deathMessage, false);
} else if (team.getDeathMessageVisibility() == Team.Visibility.HIDE_FOR_OTHER_TEAMS) {
@@ -1130,6 +_,13 @@
@@ -1160,6 +_,13 @@
if (this.isInvulnerableTo(level, damageSource)) {
return false;
} else {
@@ -54,7 +54,7 @@
Entity entity = damageSource.getEntity();
if (!( // Paper - split the if statement. If below statement is false, hurtServer would not have been evaluated. Return false.
!(entity instanceof Player player && !this.canHarmPlayer(player))
@@ -1360,6 +_,7 @@
@@ -1390,6 +_,7 @@
serverLevel.removePlayerImmediately(this, Entity.RemovalReason.CHANGED_DIMENSION);
this.unsetRemoved();
// CraftBukkit end
@@ -62,7 +62,7 @@
this.setServerLevel(level);
this.connection.internalTeleport(PositionMoveRotation.of(teleportTransition), teleportTransition.relatives()); // CraftBukkit - use internal teleport without event
this.connection.resetPosition();
@@ -1477,7 +_,7 @@
@@ -1507,7 +_,7 @@
new AABB(vec3.x() - 8.0, vec3.y() - 5.0, vec3.z() - 8.0, vec3.x() + 8.0, vec3.y() + 5.0, vec3.z() + 8.0),
monster -> monster.isPreventingPlayerRest(this.serverLevel(), this)
);
@@ -71,7 +71,7 @@
return Either.left(Player.BedSleepingProblem.NOT_SAFE);
}
}
@@ -1514,7 +_,19 @@
@@ -1544,7 +_,19 @@
CriteriaTriggers.SLEPT_IN_BED.trigger(this);
});
if (!this.serverLevel().canSleepThroughNights()) {
@@ -92,7 +92,7 @@
}
((ServerLevel)this.level()).updateSleepingPlayerList();
@@ -1606,6 +_,7 @@
@@ -1636,6 +_,7 @@
@Override
public void openTextEdit(SignBlockEntity signEntity, boolean isFrontText) {
@@ -100,7 +100,7 @@
this.connection.send(new ClientboundBlockUpdatePacket(this.level(), signEntity.getBlockPos()));
this.connection.send(new ClientboundOpenSignEditorPacket(signEntity.getBlockPos(), isFrontText));
}
@@ -1908,6 +_,26 @@
@@ -1938,6 +_,26 @@
this.lastSentExp = -1; // CraftBukkit - Added to reset
}
@@ -127,7 +127,7 @@
@Override
public void displayClientMessage(Component chatComponent, boolean actionBar) {
this.sendSystemMessage(chatComponent, actionBar);
@@ -2125,6 +_,20 @@
@@ -2155,6 +_,20 @@
);
}
@@ -148,7 +148,7 @@
public void sendSystemMessage(Component mesage) {
this.sendSystemMessage(mesage, false);
}
@@ -2263,7 +_,67 @@
@@ -2293,7 +_,67 @@
public void resetLastActionTime() {
this.lastActionTime = Util.getMillis();
@@ -217,7 +217,7 @@
public ServerStatsCounter getStats() {
return this.stats;
@@ -2891,4 +_,56 @@
@@ -2921,4 +_,56 @@
return (org.bukkit.craftbukkit.entity.CraftPlayer) super.getBukkitEntity();
}
// CraftBukkit end

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/level/WorldGenRegion.java
+++ b/net/minecraft/server/level/WorldGenRegion.java
@@ -284,6 +_,7 @@
@@ -314,6 +_,7 @@
return true;
} else {
// Paper start - Buffer OOB setBlock calls