Updated Upstream (Paper)

Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@6fe7eb5a Load World Key when its instance is created (#13818)
PaperMC/Paper@944ce44a Fix CraftWorld identifier passing
PaperMC/Paper@aa6f09b0 Prevent Happy Ghast from playing mount/dismount noises when silenced (#13807)
PaperMC/Paper@7b31cc2b Make leaveMessage in PlayerKickEvent nullable (#13804)
PaperMC/Paper@65461225 Update health after setPlayerProfile() (#13717)
PaperMC/Paper@1a8417b1 [ci/skip] Add Javadocs for PotionEffect withX methods (#13723)
PaperMC/Paper@4af86ff3 Handle null ServerLevel in fromGlobalPos (#13703)
PaperMC/Paper@c39822ae reset pending keepalive state on listener handoff during reconfiguration (#13712)
PaperMC/Paper@dcf5577a Fix PlayerProfile applySkinToPlayerHeadContents (#13692)
PaperMC/Paper@dd203a27 chore: Don't log errors for accepting the EULA via the system property (#13681)
PaperMC/Paper@d74f6bc7 Support for Kill damageable entities (#13667)
PaperMC/Paper@90aee8e0 Update world methods to take in account environment attributes (#13543)
PaperMC/Paper@b2b1e177 Improvement to Vehicle damage events (#13572)
PaperMC/Paper@49daadd2 Fix insomniaStartTicks option being ignored for phantom spawning (#13609)
PaperMC/Paper@57d84f68 Prevent NPE on ThrownPotion#splash (#13683)
PaperMC/Paper@4f184db3 Fix memory leak on constantly damage (#13455)
PaperMC/Paper@60073714 Update MOJIRA reference in DeOp command response for multiple targets [ci/skip] (#13812)
PaperMC/Paper@4aef3f0a Remove already fixed vanilla bug MC-244739 (#13787)
PaperMC/Paper@945aea99 Fix Damager for HangingBreakByEntityEvent and minor improvements (#12615)
PaperMC/Paper@a8c05a35 Add an option to WorldCreator to avoid spawn location computation on world creation (#13407)
PaperMC/Paper@182b2f8a Add Point Of Interest API (#12117)
PaperMC/Paper@8021488e Disconnect State Fixes (#13616)
PaperMC/Paper@1f819732 Allow ServerboundChangeGameModePacket if player has /gamemode permissions (#13507)
PaperMC/Paper@a64ea13e Re-implement per-world and per-player time (#13814)
PaperMC/Paper@acfe105b Add options to disable chunk and block entity ticking (#13821)
PaperMC/Paper@651d8481 Finish world key initial migration (#13824)
PaperMC/Paper@f4e769a7 Improvements checks for arguments numbers (#13290)
PaperMC/Paper@5dc4afc1 Promote build channel to BETA
PaperMC/Paper@55be6c0e Fix boat and minecart inventories on region switch [ci/skip] (#13826)
PaperMC/Paper@7799bf28 Update Paperclip to v3.0.4
This commit is contained in:
granny
2026-04-27 00:53:47 -07:00
parent d05f412a97
commit d4d8f4bd90
23 changed files with 104 additions and 107 deletions

View File

@@ -3,7 +3,7 @@ group = org.purpurmc.purpur
mcVersion = 26.1.2 mcVersion = 26.1.2
apiVersion = 26.1.2 apiVersion = 26.1.2
channel=EXPERIMENTAL channel=EXPERIMENTAL
paperCommit = 948acae8c27eba00e17a676533772721aec2e3f8 paperCommit = 7799bf28ae9ba1cbf3b9a23f10f79df5c8e832bc
org.gradle.configuration-cache = true org.gradle.configuration-cache = true
org.gradle.caching = true org.gradle.caching = true

View File

@@ -1,6 +1,6 @@
--- a/src/main/java/org/bukkit/World.java --- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java
@@ -4469,6 +_,100 @@ @@ -4537,6 +_,100 @@
@Nullable @Nullable
public DragonBattle getEnderDragonBattle(); public DragonBattle getEnderDragonBattle();

View File

@@ -18,10 +18,10 @@ index 64a82b414afd093c010878c150592c681665b735..1db70e2397137158c3df9603ea90743e
public boolean isClientAuthoritative() { public boolean isClientAuthoritative() {
return false; return false;
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 9589fc0621021f900ed62f929b7da69705c91573..0279b1d6456ec271b1fc706a9fb5608de179c383 100644 index 33915dbc64062bbe8d0d9df6dbdb60660c1ad9c6..07d3c51b80c251da74aba87bdbf9ac74650b83e5 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
@@ -1862,6 +1862,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1876,6 +1876,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
for (ServerLevel level : this.getAllLevels()) { for (ServerLevel level : this.getAllLevels()) {
level.hasPhysicsEvent = org.bukkit.event.block.BlockPhysicsEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper - BlockPhysicsEvent level.hasPhysicsEvent = org.bukkit.event.block.BlockPhysicsEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper - BlockPhysicsEvent
level.hasEntityMoveEvent = io.papermc.paper.event.entity.EntityMoveEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper - Add EntityMoveEvent level.hasEntityMoveEvent = io.papermc.paper.event.entity.EntityMoveEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper - Add EntityMoveEvent
@@ -30,10 +30,10 @@ index 9589fc0621021f900ed62f929b7da69705c91573..0279b1d6456ec271b1fc706a9fb5608d
net.minecraft.world.level.block.entity.HopperBlockEntity.skipHopperEvents = level.paperConfig().hopper.disableMoveEvent || org.bukkit.event.inventory.InventoryMoveItemEvent.getHandlerList().getRegisteredListeners().length == 0; // Paper - Perf: Optimize Hoppers net.minecraft.world.level.block.entity.HopperBlockEntity.skipHopperEvents = level.paperConfig().hopper.disableMoveEvent || org.bukkit.event.inventory.InventoryMoveItemEvent.getHandlerList().getRegisteredListeners().length == 0; // Paper - Perf: Optimize Hoppers
profiler.push(() -> level + " " + level.dimension().identifier()); profiler.push(() -> level + " " + level.dimension().identifier());
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
index 3710e3ff7a65058dd4799459400a5be6bcf19cb8..7898b28dc2ccca20800d989334b625e8a95c935c 100644 index aa1282fbd44533cbc563fff74d8a1c309f1a9cc0..1072da2fa0138d42769749cc98c6ec0f97fd6f09 100644
--- a/net/minecraft/server/level/ServerLevel.java --- a/net/minecraft/server/level/ServerLevel.java
+++ b/net/minecraft/server/level/ServerLevel.java +++ b/net/minecraft/server/level/ServerLevel.java
@@ -235,6 +235,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ServerEntityGet @@ -236,6 +236,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ServerEntityGet
public boolean hasPhysicsEvent = true; // Paper - BlockPhysicsEvent public boolean hasPhysicsEvent = true; // Paper - BlockPhysicsEvent
public boolean hasEntityMoveEvent; // Paper - Add EntityMoveEvent public boolean hasEntityMoveEvent; // Paper - Add EntityMoveEvent
private final alternate.current.wire.WireHandler wireHandler = new alternate.current.wire.WireHandler(this); // Paper - optimize redstone (Alternate Current) private final alternate.current.wire.WireHandler wireHandler = new alternate.current.wire.WireHandler(this); // Paper - optimize redstone (Alternate Current)
@@ -62,10 +62,10 @@ index 3e8a8509c0574e732c8054cc2b86f74dd47d29d4..1bd1bb805060604fbe4dca6d71a863bb
private void updatePlayerAttributes() { private void updatePlayerAttributes() {
diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index ae965a1c6663ea9dd9588f010cd7831b51357fb0..8ec1aa8fdd2745d2269d73a9cfbb5f489408b91d 100644 index abf5fc6b4beed0e3148c319cfa626be9f25d6b09..0069b240b1be6b80a979bfa9784fb4fd634e7440 100644
--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -3008,6 +3008,8 @@ public class ServerGamePacketListenerImpl @@ -3000,6 +3000,8 @@ public class ServerGamePacketListenerImpl
ServerGamePacketListenerImpl.this.cserver.getPluginManager().callEvent(event); ServerGamePacketListenerImpl.this.cserver.getPluginManager().callEvent(event);
final boolean resendData = event.isCancelled() || !ServerGamePacketListenerImpl.this.player.getItemInHand(hand).is(itemType); final boolean resendData = event.isCancelled() || !ServerGamePacketListenerImpl.this.player.getItemInHand(hand).is(itemType);
@@ -75,7 +75,7 @@ index ae965a1c6663ea9dd9588f010cd7831b51357fb0..8ec1aa8fdd2745d2269d73a9cfbb5f48
if (itemType == Items.WATER_BUCKET && target instanceof net.minecraft.world.entity.animal.Bucketable && target instanceof LivingEntity && resendData) { if (itemType == Items.WATER_BUCKET && target instanceof net.minecraft.world.entity.animal.Bucketable && target instanceof LivingEntity && resendData) {
target.resendPossiblyDesyncedEntityData(ServerGamePacketListenerImpl.this.player); // Paper - The entire mob gets deleted, so resend it target.resendPossiblyDesyncedEntityData(ServerGamePacketListenerImpl.this.player); // Paper - The entire mob gets deleted, so resend it
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
index dd99157af3e234b0c2b3a74e964583dea2e5ba36..1ff07b2d360e42a073a6ff0f2a188f320f8376b3 100644 index 1922a09d57f7f91ef2dec814918fd9da4a9189cd..49c5c8ab8f3333d4d6a96643e7018905a533b645 100644
--- a/net/minecraft/world/entity/Entity.java --- a/net/minecraft/world/entity/Entity.java
+++ b/net/minecraft/world/entity/Entity.java +++ b/net/minecraft/world/entity/Entity.java
@@ -3396,6 +3396,13 @@ public abstract class Entity @@ -3396,6 +3396,13 @@ public abstract class Entity
@@ -107,7 +107,7 @@ index dd99157af3e234b0c2b3a74e964583dea2e5ba36..1ff07b2d360e42a073a6ff0f2a188f32
if (this.passengers.size() == 1 && this.passengers.get(0) == passenger) { if (this.passengers.size() == 1 && this.passengers.get(0) == passenger) {
this.passengers = ImmutableList.of(); this.passengers = ImmutableList.of();
} else { } else {
@@ -5418,4 +5433,44 @@ public abstract class Entity @@ -5417,4 +5432,44 @@ public abstract class Entity
return ((ServerLevel) this.level()).isPositionEntityTicking(this.blockPosition()); return ((ServerLevel) this.level()).isPositionEntityTicking(this.blockPosition());
} }
// Paper end - Expose entity id counter // Paper end - Expose entity id counter
@@ -1814,7 +1814,7 @@ index 3d4bfeae2fddb9ace26e7dea8870704d8309862b..ed8fa3aa3d0bb3c83f46a902dfe60394
profiler.pop(); profiler.pop();
profiler.push("tadpoleActivityUpdate"); profiler.push("tadpoleActivityUpdate");
diff --git a/net/minecraft/world/entity/animal/goat/Goat.java b/net/minecraft/world/entity/animal/goat/Goat.java diff --git a/net/minecraft/world/entity/animal/goat/Goat.java b/net/minecraft/world/entity/animal/goat/Goat.java
index 6c637f9fb552bc287cdddf976b472bae3915b7b4..d4353bb9ba2168b81726bfaa406175e7f2af601a 100644 index 3cb1e55e5400c4ab78fd10fc76db38e8d0dac1a0..3116825b324091b0fd769c7293c5514d88cc3cb5 100644
--- a/net/minecraft/world/entity/animal/goat/Goat.java --- a/net/minecraft/world/entity/animal/goat/Goat.java
+++ b/net/minecraft/world/entity/animal/goat/Goat.java +++ b/net/minecraft/world/entity/animal/goat/Goat.java
@@ -100,6 +100,23 @@ public class Goat extends Animal { @@ -100,6 +100,23 @@ public class Goat extends Animal {
@@ -2027,7 +2027,7 @@ index 0993ec37f58cbc6b201ebc9aeb39aee438bd1cf9..6875e40687bbde6aba25da7d3145eccd
} }
diff --git a/net/minecraft/world/entity/animal/happyghast/HappyGhast.java b/net/minecraft/world/entity/animal/happyghast/HappyGhast.java diff --git a/net/minecraft/world/entity/animal/happyghast/HappyGhast.java b/net/minecraft/world/entity/animal/happyghast/HappyGhast.java
index 413df81578393382a2e6a3aac370d5545d32bd11..f1da6beccfd658d8209dbc3e52f570a476f1c95b 100644 index a7a9deaf637c2e994940ee8fdad7e5e09464dabe..d7f7bafb7c7854ce6bf64bbbab022fdb85a2e9d7 100644
--- a/net/minecraft/world/entity/animal/happyghast/HappyGhast.java --- a/net/minecraft/world/entity/animal/happyghast/HappyGhast.java
+++ b/net/minecraft/world/entity/animal/happyghast/HappyGhast.java +++ b/net/minecraft/world/entity/animal/happyghast/HappyGhast.java
@@ -134,6 +134,13 @@ public class HappyGhast extends Animal { @@ -134,6 +134,13 @@ public class HappyGhast extends Animal {

View File

@@ -5,10 +5,10 @@ Subject: [PATCH] Barrels and enderchests 6 rows
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
index 962dcadc6615128c2ac28e198955aedec09c9317..1d7a67ce5c33119c4ae794f61a5639a92a9e9dd1 100644 index 7c0382f7cb42f448e947001542b7f40f11b018e9..341021c3952b89b6e234ce777aa37856eea58ff8 100644
--- a/net/minecraft/server/players/PlayerList.java --- a/net/minecraft/server/players/PlayerList.java
+++ b/net/minecraft/server/players/PlayerList.java +++ b/net/minecraft/server/players/PlayerList.java
@@ -889,6 +889,27 @@ public abstract class PlayerList { @@ -888,6 +888,27 @@ public abstract class PlayerList {
player.getBukkitEntity().recalculatePermissions(); // CraftBukkit player.getBukkitEntity().recalculatePermissions(); // CraftBukkit
this.server.getCommands().sendCommands(player); this.server.getCommands().sendCommands(player);
} // Paper - Add sendOpLevel API } // Paper - Add sendOpLevel API

View File

@@ -5,10 +5,10 @@ Subject: [PATCH] Setting to reintroduce end void rings
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 0279b1d6456ec271b1fc706a9fb5608de179c383..a653755f70f5f37b60bdd71f0ef51632cfc00186 100644 index 07d3c51b80c251da74aba87bdbf9ac74650b83e5..761acf1c9cae98fc8d7699685824f561352a8f66 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
@@ -1351,6 +1351,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1361,6 +1361,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} }
} }
// Purpur end - config for startup commands // Purpur end - config for startup commands

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/network/Connection.java --- a/net/minecraft/network/Connection.java
+++ b/net/minecraft/network/Connection.java +++ b/net/minecraft/network/Connection.java
@@ -552,11 +_,20 @@ @@ -554,11 +_,20 @@
private static final int MAX_PER_TICK = io.papermc.paper.configuration.GlobalConfiguration.get().misc.maxJoinsPerTick; // Paper - Buffer joins to world private static final int MAX_PER_TICK = io.papermc.paper.configuration.GlobalConfiguration.get().misc.maxJoinsPerTick; // Paper - Buffer joins to world
private static int joinAttemptsThisTick; // Paper - Buffer joins to world private static int joinAttemptsThisTick; // Paper - Buffer joins to world
private static int currTick; // Paper - Buffer joins to world private static int currTick; // Paper - Buffer joins to world

View File

@@ -25,7 +25,7 @@
getTPS(this.tickTimes1m, interval), getTPS(this.tickTimes1m, interval),
getTPS(this.tickTimes5m, interval), getTPS(this.tickTimes5m, interval),
getTPS(this.tickTimes15m, interval) getTPS(this.tickTimes15m, interval)
@@ -1047,6 +_,15 @@ @@ -1057,6 +_,15 @@
LOGGER.info("Stopping server"); LOGGER.info("Stopping server");
Commands.COMMAND_SENDING_POOL.shutdownNow(); // Paper - Perf: Async command map building; Shutdown and don't bother finishing Commands.COMMAND_SENDING_POOL.shutdownNow(); // Paper - Perf: Async command map building; Shutdown and don't bother finishing
@@ -41,7 +41,7 @@
// CraftBukkit start // CraftBukkit start
if (this.server != null) { if (this.server != null) {
this.server.spark.disable(); // Paper - spark this.server.spark.disable(); // Paper - spark
@@ -1141,6 +_,8 @@ @@ -1151,6 +_,8 @@
this.safeShutdown(wait, false); this.safeShutdown(wait, false);
} }
public void safeShutdown(final boolean wait, final boolean isRestarting) { public void safeShutdown(final boolean wait, final boolean isRestarting) {
@@ -50,7 +50,7 @@
this.isRestarting = isRestarting; this.isRestarting = isRestarting;
this.hasLoggedStop = true; // Paper - Debugging this.hasLoggedStop = true; // Paper - Debugging
if (this.isDebugging()) io.papermc.paper.util.TraceUtil.dumpTraceForThread("Server stopped"); // Paper - Debugging if (this.isDebugging()) io.papermc.paper.util.TraceUtil.dumpTraceForThread("Server stopped"); // Paper - Debugging
@@ -1322,11 +_,21 @@ @@ -1332,11 +_,21 @@
} }
// Paper end - Add onboarding message for initial server start // Paper end - Add onboarding message for initial server start
// Paper start - Improve outdated version checking // Paper start - Improve outdated version checking
@@ -73,7 +73,7 @@
while (this.running) { while (this.running) {
final long tickStart = System.nanoTime(); // Paper - improve tick loop final long tickStart = System.nanoTime(); // Paper - improve tick loop
long thisTickNanos; // Paper - improve tick loop - diff on change, expect this to be tick interval long thisTickNanos; // Paper - improve tick loop - diff on change, expect this to be tick interval
@@ -1340,9 +_,11 @@ @@ -1350,9 +_,11 @@
final long ticksBehind = Math.max(1L, this.tickSchedule.getPeriodsAhead(thisTickNanos, tickStart)); final long ticksBehind = Math.max(1L, this.tickSchedule.getPeriodsAhead(thisTickNanos, tickStart));
final long catchup = (long)Math.max( final long catchup = (long)Math.max(
1, 1,
@@ -86,7 +86,7 @@
// adjust ticksBehind so that it is not greater-than catchup // adjust ticksBehind so that it is not greater-than catchup
if (ticksBehind - catchup > 0L) { if (ticksBehind - catchup > 0L) {
final long difference = ticksBehind - catchup; final long difference = ticksBehind - catchup;
@@ -1965,7 +_,7 @@ @@ -1983,7 +_,7 @@
} }
public String getServerModName() { public String getServerModName() {

View File

@@ -9,7 +9,7 @@
private final LevelDebugSynchronizers debugSynchronizers = new LevelDebugSynchronizers(this); private final LevelDebugSynchronizers debugSynchronizers = new LevelDebugSynchronizers(this);
// CraftBukkit start // CraftBukkit start
@@ -642,8 +_,25 @@ @@ -643,8 +_,25 @@
// CraftBukkit end // CraftBukkit end
this.tickTime = tickTime; this.tickTime = tickTime;
this.server = server; this.server = server;
@@ -35,8 +35,8 @@
+ // Purpur end - Allow toggling special MobSpawners per world + // Purpur end - Allow toggling special MobSpawners per world
ChunkGenerator generator = levelStem.generator(); ChunkGenerator generator = levelStem.generator();
// CraftBukkit start // CraftBukkit start
if (loadedWorldData.pdc() != null) { // Paper start - per-world time
@@ -731,6 +_,7 @@ @@ -738,6 +_,7 @@
this.chunkDataController = new ca.spottedleaf.moonrise.patches.chunk_system.io.datacontroller.ChunkDataController((ServerLevel)(Object)this, this.chunkTaskScheduler); this.chunkDataController = new ca.spottedleaf.moonrise.patches.chunk_system.io.datacontroller.ChunkDataController((ServerLevel)(Object)this, this.chunkTaskScheduler);
// Paper end - rewrite chunk system // Paper end - rewrite chunk system
this.getCraftServer().addWorld(this.getWorld()); // CraftBukkit this.getCraftServer().addWorld(this.getWorld()); // CraftBukkit
@@ -44,16 +44,16 @@
} }
// Paper start // Paper start
@@ -787,7 +_,7 @@ @@ -794,7 +_,7 @@
} }
int percentage = this.getGameRules().get(GameRules.PLAYERS_SLEEPING_PERCENTAGE); int percentage = this.getGameRules().get(GameRules.PLAYERS_SLEEPING_PERCENTAGE);
- if (this.sleepStatus.areEnoughSleeping(percentage) && this.sleepStatus.areEnoughDeepSleeping(percentage, this.players)) { - if (this.sleepStatus.areEnoughSleeping(percentage) && this.sleepStatus.areEnoughDeepSleeping(percentage, this.players)) {
+ if (this.purpurConfig.playersSkipNight && this.sleepStatus.areEnoughSleeping(percentage) && this.sleepStatus.areEnoughDeepSleeping(percentage, this.players)) { // Purpur - Config for skipping night + if (this.purpurConfig.playersSkipNight && this.sleepStatus.areEnoughSleeping(percentage) && this.sleepStatus.areEnoughDeepSleeping(percentage, this.players)) { // Purpur - Config for skipping night
Optional<Holder<WorldClock>> defaultClock = this.dimensionType().defaultClock(); Optional<Holder<WorldClock>> defaultClock = this.dimensionType().defaultClock();
org.bukkit.event.world.TimeSkipEvent event = null; // Paper - time skip event org.bukkit.event.world.ClockTimeSkipEvent event = null; // Paper - per-world time
if (this.getGameRules().get(GameRules.ADVANCE_TIME) && defaultClock.isPresent()) { if (this.getGameRules().get(GameRules.ADVANCE_TIME) && defaultClock.isPresent()) {
@@ -1026,9 +_,18 @@ @@ -1036,9 +_,18 @@
&& this.random.nextDouble() < difficulty.getEffectiveDifficulty() * this.paperConfig().entities.spawning.skeletonHorseThunderSpawnChance.or(0.01) // Paper - Configurable spawn chances for skeleton horses && this.random.nextDouble() < difficulty.getEffectiveDifficulty() * this.paperConfig().entities.spawning.skeletonHorseThunderSpawnChance.or(0.01) // Paper - Configurable spawn chances for skeleton horses
&& !this.getBlockState(pos.below()).is(BlockTags.LIGHTNING_RODS); && !this.getBlockState(pos.below()).is(BlockTags.LIGHTNING_RODS);
if (isTrap) { if (isTrap) {
@@ -73,7 +73,7 @@
horse.setAge(0); horse.setAge(0);
horse.setPos(pos.getX(), pos.getY(), pos.getZ()); horse.setPos(pos.getX(), pos.getY(), pos.getZ());
this.addFreshEntity(horse, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.LIGHTNING); // CraftBukkit this.addFreshEntity(horse, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.LIGHTNING); // CraftBukkit
@@ -1063,9 +_,35 @@ @@ -1073,9 +_,35 @@
if (state.is(Blocks.SNOW)) { if (state.is(Blocks.SNOW)) {
int currentLayers = state.getValue(SnowLayerBlock.LAYERS); int currentLayers = state.getValue(SnowLayerBlock.LAYERS);
if (currentLayers < Math.min(maxHeight, 8)) { if (currentLayers < Math.min(maxHeight, 8)) {
@@ -109,7 +109,7 @@
} }
} else { } else {
org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(this, topPos, Blocks.SNOW.defaultBlockState(), Block.UPDATE_ALL, null); // CraftBukkit org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(this, topPos, Blocks.SNOW.defaultBlockState(), Block.UPDATE_ALL, null); // CraftBukkit
@@ -1086,7 +_,7 @@ @@ -1096,7 +_,7 @@
p -> p.is(PoiTypes.LIGHTNING_ROD), p -> p.is(PoiTypes.LIGHTNING_ROD),
lightningRodPos -> lightningRodPos.getY() == this.getHeight(Heightmap.Types.WORLD_SURFACE, lightningRodPos.getX(), lightningRodPos.getZ()) - 1, lightningRodPos -> lightningRodPos.getY() == this.getHeight(Heightmap.Types.WORLD_SURFACE, lightningRodPos.getX(), lightningRodPos.getZ()) - 1,
center, center,
@@ -118,7 +118,7 @@
PoiManager.Occupancy.ANY PoiManager.Occupancy.ANY
); );
return nearbyLightningRod.map(blockPos -> blockPos.above(1)); return nearbyLightningRod.map(blockPos -> blockPos.above(1));
@@ -1134,8 +_,26 @@ @@ -1144,8 +_,26 @@
int percentage = this.getGameRules().get(GameRules.PLAYERS_SLEEPING_PERCENTAGE); int percentage = this.getGameRules().get(GameRules.PLAYERS_SLEEPING_PERCENTAGE);
Component message; Component message;
if (this.sleepStatus.areEnoughSleeping(percentage)) { if (this.sleepStatus.areEnoughSleeping(percentage)) {
@@ -145,7 +145,7 @@
message = Component.translatable("sleep.players_sleeping", this.sleepStatus.amountSleeping(), this.sleepStatus.sleepersNeeded(percentage)); message = Component.translatable("sleep.players_sleeping", this.sleepStatus.amountSleeping(), this.sleepStatus.sleepersNeeded(percentage));
} }
@@ -1301,6 +_,7 @@ @@ -1311,6 +_,7 @@
public void resetWeatherCycle() { public void resetWeatherCycle() {
WeatherData weatherData = this.getWeatherData(); WeatherData weatherData = this.getWeatherData();
// CraftBukkit start // CraftBukkit start
@@ -153,7 +153,7 @@
weatherData.setRaining(false, org.bukkit.event.weather.WeatherChangeEvent.Cause.SLEEP); // Paper - Add cause to Weather/ThunderChangeEvents weatherData.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. // 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.... // Not that everyone ever manages to get the whole server to sleep at the same time....
@@ -1308,6 +_,7 @@ @@ -1318,6 +_,7 @@
weatherData.setRainTime(0); weatherData.setRainTime(0);
} }
// CraftBukkit end // CraftBukkit end
@@ -161,7 +161,7 @@
weatherData.setThundering(false, org.bukkit.event.weather.ThunderChangeEvent.Cause.SLEEP); // Paper - Add cause to Weather/ThunderChangeEvents weatherData.setThundering(false, org.bukkit.event.weather.ThunderChangeEvent.Cause.SLEEP); // Paper - Add cause to Weather/ThunderChangeEvents
// CraftBukkit start // CraftBukkit start
// If we stop due to everyone sleeping we should reset the weather duration to some other random value. // If we stop due to everyone sleeping we should reset the weather duration to some other random value.
@@ -1979,7 +_,7 @@ @@ -1989,7 +_,7 @@
Explosion.BlockInteraction blockInteraction = switch (interactionType) { Explosion.BlockInteraction blockInteraction = switch (interactionType) {
case NONE -> Explosion.BlockInteraction.KEEP; case NONE -> Explosion.BlockInteraction.KEEP;
case BLOCK -> this.getDestroyType(GameRules.BLOCK_EXPLOSION_DROP_DECAY); case BLOCK -> this.getDestroyType(GameRules.BLOCK_EXPLOSION_DROP_DECAY);
@@ -170,7 +170,7 @@
? this.getDestroyType(GameRules.MOB_EXPLOSION_DROP_DECAY) ? this.getDestroyType(GameRules.MOB_EXPLOSION_DROP_DECAY)
: Explosion.BlockInteraction.KEEP; : Explosion.BlockInteraction.KEEP;
case TNT -> this.getDestroyType(GameRules.TNT_EXPLOSION_DROP_DECAY); case TNT -> this.getDestroyType(GameRules.TNT_EXPLOSION_DROP_DECAY);
@@ -2909,7 +_,7 @@ @@ -2919,7 +_,7 @@
// Spigot start // Spigot start
if (entity.getBukkitEntity() instanceof org.bukkit.inventory.InventoryHolder && (!(entity instanceof ServerPlayer) || entity.getRemovalReason() != Entity.RemovalReason.KILLED)) { // SPIGOT-6876: closeInventory clears death message 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 // Paper start - Fix merchant inventory not closing on entity removal

View File

@@ -13,7 +13,7 @@
private volatile int latency; // Paper - improve keepalives - make volatile private volatile int latency; // Paper - improve keepalives - make volatile
private final io.papermc.paper.util.KeepAlive keepAlive; // Paper - improve keepalives private final io.papermc.paper.util.KeepAlive keepAlive; // Paper - improve keepalives
private volatile boolean suspendFlushingOnServerThread = false; private volatile boolean suspendFlushingOnServerThread = false;
@@ -54,6 +_,10 @@ @@ -53,6 +_,10 @@
public final java.util.Map<java.util.UUID, net.kyori.adventure.resource.ResourcePackCallback> packCallbacks = new java.util.concurrent.ConcurrentHashMap<>(); // Paper - adventure resource pack callbacks public final java.util.Map<java.util.UUID, net.kyori.adventure.resource.ResourcePackCallback> packCallbacks = new java.util.concurrent.ConcurrentHashMap<>(); // Paper - adventure resource pack callbacks
private static final long KEEPALIVE_LIMIT = Long.getLong("paper.playerconnection.keepalive", 30) * 1000; // Paper - provide property to set keepalive limit private static final long KEEPALIVE_LIMIT = Long.getLong("paper.playerconnection.keepalive", 30) * 1000; // Paper - provide property to set keepalive limit
protected static final net.minecraft.resources.Identifier MINECRAFT_BRAND = net.minecraft.resources.Identifier.withDefaultNamespace("brand"); // Paper - Brand support protected static final net.minecraft.resources.Identifier MINECRAFT_BRAND = net.minecraft.resources.Identifier.withDefaultNamespace("brand"); // Paper - Brand support
@@ -24,7 +24,7 @@
// Paper start - retain certain values // Paper start - retain certain values
public @Nullable String playerBrand; public @Nullable String playerBrand;
public final java.util.Set<String> pluginMessagerChannels; public final java.util.Set<String> pluginMessagerChannels;
@@ -105,6 +_,18 @@ @@ -104,6 +_,18 @@
// Paper start - improve keepalives // Paper start - improve keepalives
long now = System.nanoTime(); long now = System.nanoTime();
io.papermc.paper.util.KeepAlive.PendingKeepAlive pending = this.keepAlive.pendingKeepAlives.peek(); io.papermc.paper.util.KeepAlive.PendingKeepAlive pending = this.keepAlive.pendingKeepAlives.peek();
@@ -43,7 +43,7 @@
if (pending != null && pending.challengeId() == packet.getId()) { if (pending != null && pending.challengeId() == packet.getId()) {
this.keepAlive.pendingKeepAlives.remove(pending); this.keepAlive.pendingKeepAlives.remove(pending);
@@ -179,6 +_,12 @@ @@ -172,6 +_,12 @@
return; return;
} }
@@ -56,17 +56,17 @@
if (identifier.equals(MINECRAFT_BRAND)) { if (identifier.equals(MINECRAFT_BRAND)) {
this.playerBrand = new net.minecraft.network.FriendlyByteBuf(io.netty.buffer.Unpooled.wrappedBuffer(data)).readUtf(256); this.playerBrand = new net.minecraft.network.FriendlyByteBuf(io.netty.buffer.Unpooled.wrappedBuffer(data)).readUtf(256);
} }
@@ -264,6 +_,23 @@ @@ -257,6 +_,23 @@
Profiler.get().push("keepAlive"); Profiler.get().push("keepAlive");
long now = Util.getMillis(); long now = Util.getMillis();
// Paper start - improve keepalives // Paper start - improve keepalives
+ // Purpur start - Alternative Keepalive Handling + // Purpur start - Alternative Keepalive Handling
+ if (org.purpurmc.purpur.PurpurConfig.useAlternateKeepAlive) { + if (org.purpurmc.purpur.PurpurConfig.useAlternateKeepAlive) {
+ if (this.checkIfClosed(now) && !this.processedDisconnect) { + if (this.checkIfClosed(now)) {
+ long currTime = System.nanoTime(); + long currTime = System.nanoTime();
+ if ((currTime - this.keepAlive.lastKeepAliveTx) >= java.util.concurrent.TimeUnit.SECONDS.toNanos(1L)) { // 1 second + if ((currTime - this.keepAlive.lastKeepAliveTx) >= java.util.concurrent.TimeUnit.SECONDS.toNanos(1L)) { // 1 second
+ this.keepAlive.lastKeepAliveTx = currTime; + this.keepAlive.lastKeepAliveTx = currTime;
+ if (this.keepAlivePending && !this.processedDisconnect && keepAlives.size() * 1000L >= KEEPALIVE_LIMIT) { + if (this.keepAlivePending && keepAlives.size() * 1000L >= KEEPALIVE_LIMIT) {
+ this.disconnect(TIMEOUT_DISCONNECTION_MESSAGE, io.papermc.paper.connection.DisconnectionReason.TIMEOUT); + this.disconnect(TIMEOUT_DISCONNECTION_MESSAGE, io.papermc.paper.connection.DisconnectionReason.TIMEOUT);
+ } else if (this.checkIfClosed(now)) { + } else if (this.checkIfClosed(now)) {
+ this.keepAlivePending = true; + this.keepAlivePending = true;
@@ -77,6 +77,6 @@
+ } + }
+ } else + } else
+ // Purpur end - Alternative Keepalive Handling + // Purpur end - Alternative Keepalive Handling
if (this.checkIfClosed(now) && !this.processedDisconnect) { if (this.checkIfClosed(now)) {
long currTime = System.nanoTime(); long currTime = System.nanoTime();

View File

@@ -20,8 +20,8 @@
+ +
@Override @Override
public void tick() { public void tick() {
if (this.isDisconnected()) return; // Paper if (this.ackBlockChangesUpTo > -1) {
@@ -372,6 +_,12 @@ @@ -371,6 +_,12 @@
&& this.server.playerIdleTimeout() > 0 && this.server.playerIdleTimeout() > 0
&& Util.getMillis() - this.player.getLastActionTime() > TimeUnit.MINUTES.toMillis(this.server.playerIdleTimeout()) && Util.getMillis() - this.player.getLastActionTime() > TimeUnit.MINUTES.toMillis(this.server.playerIdleTimeout())
&& !this.player.wonGame) { && !this.player.wonGame) {
@@ -34,7 +34,7 @@
this.disconnect(Component.translatable("multiplayer.disconnect.idling"), org.bukkit.event.player.PlayerKickEvent.Cause.IDLING); // Paper - kick event cause this.disconnect(Component.translatable("multiplayer.disconnect.idling"), org.bukkit.event.player.PlayerKickEvent.Cause.IDLING); // Paper - kick event cause
} }
} }
@@ -693,6 +_,8 @@ @@ -692,6 +_,8 @@
this.lastYaw = to.getYaw(); this.lastYaw = to.getYaw();
this.lastPitch = to.getPitch(); this.lastPitch = to.getPitch();
@@ -43,7 +43,7 @@
Location oldTo = to.clone(); Location oldTo = to.clone();
PlayerMoveEvent event = new PlayerMoveEvent(player, from, to); PlayerMoveEvent event = new PlayerMoveEvent(player, from, to);
this.cserver.getPluginManager().callEvent(event); this.cserver.getPluginManager().callEvent(event);
@@ -772,6 +_,7 @@ @@ -771,6 +_,7 @@
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.level()); PacketUtils.ensureRunningOnSameThread(packet, this, this.player.level());
if (packet.getId() == this.awaitingTeleport) { if (packet.getId() == this.awaitingTeleport) {
if (this.awaitingPositionFromClient == null) { if (this.awaitingPositionFromClient == null) {
@@ -51,7 +51,7 @@
this.disconnect(Component.translatable("multiplayer.disconnect.invalid_player_movement"), org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_PLAYER_MOVEMENT); // Paper - kick event cause this.disconnect(Component.translatable("multiplayer.disconnect.invalid_player_movement"), org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_PLAYER_MOVEMENT); // Paper - kick event cause
return; return;
} }
@@ -1340,6 +_,10 @@ @@ -1339,6 +_,10 @@
final int maxBookPageSize = pageMax.intValue(); final int maxBookPageSize = pageMax.intValue();
final double multiplier = Math.clamp(io.papermc.paper.configuration.GlobalConfiguration.get().itemValidation.bookSize.totalMultiplier, 0.3D, 1D); final double multiplier = Math.clamp(io.papermc.paper.configuration.GlobalConfiguration.get().itemValidation.bookSize.totalMultiplier, 0.3D, 1D);
long byteAllowed = maxBookPageSize; long byteAllowed = maxBookPageSize;
@@ -62,7 +62,7 @@
for (final String page : pageList) { for (final String page : pageList) {
final int byteLength = page.getBytes(java.nio.charset.StandardCharsets.UTF_8).length; final int byteLength = page.getBytes(java.nio.charset.StandardCharsets.UTF_8).length;
byteTotal += byteLength; byteTotal += byteLength;
@@ -1364,7 +_,8 @@ @@ -1363,7 +_,8 @@
} }
if (byteTotal > byteAllowed) { if (byteTotal > byteAllowed) {
@@ -72,7 +72,7 @@
this.disconnectAsync(Component.literal("Book too large!"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_ACTION); // Paper - kick event cause // Paper - add proper async disconnect this.disconnectAsync(Component.literal("Book too large!"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_ACTION); // Paper - kick event cause // Paper - add proper async disconnect
return; return;
} }
@@ -1383,31 +_,45 @@ @@ -1382,31 +_,45 @@
Optional<String> title = packet.title(); Optional<String> title = packet.title();
title.ifPresent(contents::add); title.ifPresent(contents::add);
contents.addAll(packet.pages()); contents.addAll(packet.pages());
@@ -122,7 +122,7 @@
writtenBook.set( writtenBook.set(
DataComponents.WRITTEN_BOOK_CONTENT, new WrittenBookContent(this.filterableFromOutgoing(title), this.player.getPlainTextName(), 0, pages, true) DataComponents.WRITTEN_BOOK_CONTENT, new WrittenBookContent(this.filterableFromOutgoing(title), this.player.getPlainTextName(), 0, pages, true)
); );
@@ -1420,6 +_,16 @@ @@ -1419,6 +_,16 @@
return this.player.isTextFilteringEnabled() ? Filterable.passThrough(text.filteredOrEmpty()) : Filterable.from(text); return this.player.isTextFilteringEnabled() ? Filterable.passThrough(text.filteredOrEmpty()) : Filterable.from(text);
} }
@@ -139,7 +139,7 @@
@Override @Override
public void handleEntityTagQuery(final ServerboundEntityTagQueryPacket packet) { public void handleEntityTagQuery(final ServerboundEntityTagQueryPacket packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.level()); PacketUtils.ensureRunningOnSameThread(packet, this, this.player.level());
@@ -1459,7 +_,15 @@ @@ -1458,7 +_,15 @@
@Override @Override
public void handleMovePlayer(final ServerboundMovePlayerPacket packet) { public void handleMovePlayer(final ServerboundMovePlayerPacket packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.level()); PacketUtils.ensureRunningOnSameThread(packet, this, this.player.level());
@@ -156,7 +156,7 @@
this.disconnect(Component.translatable("multiplayer.disconnect.invalid_player_movement"), org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_PLAYER_MOVEMENT); // Paper - kick event cause this.disconnect(Component.translatable("multiplayer.disconnect.invalid_player_movement"), org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_PLAYER_MOVEMENT); // Paper - kick event cause
} else { } else {
ServerLevel level = this.player.level(); ServerLevel level = this.player.level();
@@ -1644,7 +_,7 @@ @@ -1643,7 +_,7 @@
movedWrongly = true; movedWrongly = true;
if (event.getLogWarning()) if (event.getLogWarning())
// Paper end // Paper end
@@ -165,7 +165,7 @@
} // Paper } // Paper
} }
@@ -1709,6 +_,8 @@ @@ -1708,6 +_,8 @@
this.lastYaw = to.getYaw(); this.lastYaw = to.getYaw();
this.lastPitch = to.getPitch(); this.lastPitch = to.getPitch();
@@ -174,7 +174,7 @@
Location oldTo = to.clone(); Location oldTo = to.clone();
PlayerMoveEvent event = new PlayerMoveEvent(player, from, to); PlayerMoveEvent event = new PlayerMoveEvent(player, from, to);
this.cserver.getPluginManager().callEvent(event); this.cserver.getPluginManager().callEvent(event);
@@ -1764,6 +_,13 @@ @@ -1763,6 +_,13 @@
this.player.tryResetCurrentImpulseContext(); this.player.tryResetCurrentImpulseContext();
} }
@@ -188,7 +188,7 @@
this.player.checkMovementStatistics(this.player.getX() - startX, this.player.getY() - startY, this.player.getZ() - startZ); this.player.checkMovementStatistics(this.player.getX() - startX, this.player.getY() - startY, this.player.getZ() - startZ);
this.lastGoodX = this.player.getX(); this.lastGoodX = this.player.getX();
this.lastGoodY = this.player.getY(); this.lastGoodY = this.player.getY();
@@ -1784,6 +_,17 @@ @@ -1783,6 +_,17 @@
} }
} }
@@ -206,7 +206,7 @@
private boolean shouldCheckPlayerMovement(final boolean isFallFlying) { private boolean shouldCheckPlayerMovement(final boolean isFallFlying) {
if (this.isSingleplayerOwner()) { if (this.isSingleplayerOwner()) {
return false; return false;
@@ -2228,6 +_,7 @@ @@ -2227,6 +_,7 @@
boolean cancelled; boolean cancelled;
if (hitResult == null || hitResult.getType() != HitResult.Type.BLOCK) { if (hitResult == null || hitResult.getType() != HitResult.Type.BLOCK) {
@@ -214,7 +214,7 @@
org.bukkit.event.player.PlayerInteractEvent event = CraftEventFactory.callPlayerInteractEvent(this.player, Action.RIGHT_CLICK_AIR, itemStack, hand); org.bukkit.event.player.PlayerInteractEvent event = CraftEventFactory.callPlayerInteractEvent(this.player, Action.RIGHT_CLICK_AIR, itemStack, hand);
cancelled = event.useItemInHand() == Event.Result.DENY; cancelled = event.useItemInHand() == Event.Result.DENY;
} else { } else {
@@ -2869,6 +_,7 @@ @@ -2861,6 +_,7 @@
ItemStack mainHandItem = this.player.getMainHandItem(); ItemStack mainHandItem = this.player.getMainHandItem();
if (this.player.isWithinAttackRange(mainHandItem, targetBounds, io.papermc.paper.configuration.GlobalConfiguration.get().misc.clientInteractionLeniencyDistance.or(3.0))) { // Paper - configurable lenience if (this.player.isWithinAttackRange(mainHandItem, targetBounds, io.papermc.paper.configuration.GlobalConfiguration.get().misc.clientInteractionLeniencyDistance.or(3.0))) { // Paper - configurable lenience
if (!mainHandItem.has(DataComponents.PIERCING_WEAPON)) { if (!mainHandItem.has(DataComponents.PIERCING_WEAPON)) {
@@ -222,12 +222,12 @@
if (target instanceof ItemEntity if (target instanceof ItemEntity
|| target instanceof ExperienceOrb || target instanceof ExperienceOrb
|| target == this.player || target == this.player
@@ -3650,7 +_,7 @@ @@ -3642,7 +_,7 @@
@Override @Override
public void handleChangeGameMode(final ServerboundChangeGameModePacket packet) { public void handleChangeGameMode(final ServerboundChangeGameModePacket packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.level()); PacketUtils.ensureRunningOnSameThread(packet, this, this.player.level());
- if (!GameModeCommand.PERMISSION_CHECK.check(this.player.permissions())) { - if (!GameModeCommand.PERMISSION_CHECK.check(this.player.permissions()) && !this.player.getBukkitEntity().hasPermission("minecraft.command.gamemode")) { // Paper - add permission check
+ if (!GameModeCommand.PERMISSION_CHECK.check(this.player.permissions()) && !player.getBukkitEntity().hasPermission("purpur.debug.f3n")) { // Purpur - Add permission for F3+N debug + if (!GameModeCommand.PERMISSION_CHECK.check(this.player.permissions()) && !this.player.getBukkitEntity().hasPermission("minecraft.command.gamemode") && !player.getBukkitEntity().hasPermission("purpur.debug.f3n")) { // Paper - add permission check // Purpur - Add permission for F3+N debug
LOGGER.warn( LOGGER.warn(
"Player {} tried to change game mode to {} without required permissions", "Player {} tried to change game mode to {} without required permissions",
this.player.getGameProfile().name(), this.player.getGameProfile().name(),

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/network/ServerLoginPacketListenerImpl.java --- a/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -282,7 +_,7 @@ @@ -290,7 +_,7 @@
ServerLoginPacketListenerImpl.LOGGER.warn("Failed to verify username but will let them in anyway!"); ServerLoginPacketListenerImpl.LOGGER.warn("Failed to verify username but will let them in anyway!");
ServerLoginPacketListenerImpl.this.startClientVerification(ServerLoginPacketListenerImpl.this.createOfflineProfile(name)); // Spigot ServerLoginPacketListenerImpl.this.startClientVerification(ServerLoginPacketListenerImpl.this.createOfflineProfile(name)); // Spigot
} else { } else {

View File

@@ -16,7 +16,7 @@
ServerLevel level = player.level(); ServerLevel level = player.level();
player.awardStat(Stats.LEAVE_GAME); player.awardStat(Stats.LEAVE_GAME);
// CraftBukkit start - Quitting must be before we do final save of data, in case plugins need to modify it // CraftBukkit start - Quitting must be before we do final save of data, in case plugins need to modify it
@@ -772,6 +_,20 @@ @@ -771,6 +_,20 @@
} }
} }
@@ -37,7 +37,7 @@
public void broadcastAll(final Packet<?> packet, final ResourceKey<Level> dimension) { public void broadcastAll(final Packet<?> packet, final ResourceKey<Level> dimension) {
for (ServerPlayer player : this.players) { for (ServerPlayer player : this.players) {
if (player.level().dimension() == dimension) { if (player.level().dimension() == dimension) {
@@ -865,6 +_,7 @@ @@ -864,6 +_,7 @@
case ADMINS -> EntityEvent.PERMISSION_LEVEL_ADMINS; case ADMINS -> EntityEvent.PERMISSION_LEVEL_ADMINS;
case OWNERS -> EntityEvent.PERMISSION_LEVEL_OWNERS; case OWNERS -> EntityEvent.PERMISSION_LEVEL_OWNERS;
}; };
@@ -45,7 +45,7 @@
player.connection.send(new ClientboundEntityEventPacket(player, eventId)); player.connection.send(new ClientboundEntityEventPacket(player, eventId));
} }
@@ -876,7 +_,7 @@ @@ -875,7 +_,7 @@
// Paper start - whitelist verify event / login event // Paper start - whitelist verify event / login event
public LoginResult canBypassFullServerLogin(final NameAndId nameAndId, final LoginResult currentResult) { public LoginResult canBypassFullServerLogin(final NameAndId nameAndId, final LoginResult currentResult) {

View File

@@ -1,20 +1,17 @@
--- a/net/minecraft/world/clock/ServerClockManager.java --- a/net/minecraft/world/clock/ServerClockManager.java
+++ b/net/minecraft/world/clock/ServerClockManager.java +++ b/net/minecraft/world/clock/ServerClockManager.java
@@ -122,7 +_,7 @@ @@ -149,12 +_,12 @@
ServerClockManager.ClockInstance instance = this.getInstance(clock);
action.accept(instance);
Map<Holder<WorldClock>, ClockNetworkState> updates = Map.of(clock, instance.packNetworkState(this.server));
- this.server.getPlayerList().broadcastAll(new ClientboundSetTimePacket(this.getGameTime(), updates)); // TODO 26.1 per-player time
+ this.server.getPlayerList().broadcastAll(new ClientboundSetTimePacket(this.getGameTime(), updates)); // TODO 26.1 per-player time // Purpur - TODO: Configurable daylight cycle
this.setDirty();
for (ServerLevel level : this.server.getAllLevels()) {
@@ -151,7 +_,7 @@
// Paper end
public ClientboundSetTimePacket createFullSyncPacket() { public ClientboundSetTimePacket createFullSyncPacket() {
- // TODO - snapshot: 26.1 per-player time // Paper start - per-player time
+ // TODO - snapshot: 26.1 per-player time // Purpur - TODO: Configurable daylight cycle - return this.createFullSyncPacket(null);
return new ClientboundSetTimePacket(this.getGameTime(), Util.mapValues(this.clocks, clock -> clock.packNetworkState(this.server))); + return this.createFullSyncPacket(null); // Purpur - TODO: Configurable daylight cycle
} }
public ClientboundSetTimePacket createFullSyncPacket(final net.minecraft.server.level.ServerPlayer player) {
final Map<Holder<WorldClock>, ClockNetworkState> updates = new HashMap<>(this.clocks.size());
- this.clocks.forEach((clock, instance) -> updates.put(clock, this.packNetworkState(clock, instance, player)));
+ this.clocks.forEach((clock, instance) -> updates.put(clock, this.packNetworkState(clock, instance, player))); // Purpur - TODO: Configurable daylight cycle
return new ClientboundSetTimePacket(this.getGameTime(), updates);
// Paper end - per-player time
}

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/damagesource/CombatTracker.java --- a/net/minecraft/world/damagesource/CombatTracker.java
+++ b/net/minecraft/world/damagesource/CombatTracker.java +++ b/net/minecraft/world/damagesource/CombatTracker.java
@@ -66,7 +_,7 @@ @@ -75,7 +_,7 @@
final Entity attackerEntity, final Component attackerName, final String messageWithItem, final String messageWithoutItem final Entity attackerEntity, final Component attackerName, final String messageWithItem, final String messageWithoutItem
) { ) {
ItemStack attackerItem = attackerEntity instanceof LivingEntity livingEntity ? livingEntity.getMainHandItem() : ItemStack.EMPTY; ItemStack attackerItem = attackerEntity instanceof LivingEntity livingEntity ? livingEntity.getMainHandItem() : ItemStack.EMPTY;
@@ -9,7 +9,7 @@
? Component.translatable(messageWithItem, this.mob.getDisplayName(), attackerName, attackerItem.getDisplayName()) ? Component.translatable(messageWithItem, this.mob.getDisplayName(), attackerName, attackerItem.getDisplayName())
: Component.translatable(messageWithoutItem, this.mob.getDisplayName(), attackerName); : Component.translatable(messageWithoutItem, this.mob.getDisplayName(), attackerName);
} }
@@ -109,6 +_,15 @@ @@ -118,6 +_,15 @@
Component link = ComponentUtils.wrapInSquareBrackets(Component.translatable(deathMsg + ".link")).withStyle(INTENTIONAL_GAME_DESIGN_STYLE); Component link = ComponentUtils.wrapInSquareBrackets(Component.translatable(deathMsg + ".link")).withStyle(INTENTIONAL_GAME_DESIGN_STYLE);
return Component.translatable(deathMsg + ".message", this.mob.getDisplayName(), link); return Component.translatable(deathMsg + ".message", this.mob.getDisplayName(), link);
} else { } else {

View File

@@ -137,7 +137,7 @@
} }
} }
} }
@@ -4237,7 +_,7 @@ @@ -4236,7 +_,7 @@
} }
public boolean canUsePortal(final boolean ignorePassenger) { public boolean canUsePortal(final boolean ignorePassenger) {
@@ -146,7 +146,7 @@
} }
public boolean canTeleport(final Level from, final Level to) { public boolean canTeleport(final Level from, final Level to) {
@@ -4787,6 +_,12 @@ @@ -4786,6 +_,12 @@
return Mth.lerp(partial, this.yRotO, this.yRot); return Mth.lerp(partial, this.yRotO, this.yRot);
} }
@@ -159,7 +159,7 @@
public boolean touchingUnloadedChunk() { public boolean touchingUnloadedChunk() {
AABB box = this.getBoundingBox().inflate(1.0); AABB box = this.getBoundingBox().inflate(1.0);
int x0 = Mth.floor(box.minX); int x0 = Mth.floor(box.minX);
@@ -5090,7 +_,7 @@ @@ -5089,7 +_,7 @@
} }
public float maxUpStep() { public float maxUpStep() {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/animal/goat/Goat.java --- a/net/minecraft/world/entity/animal/goat/Goat.java
+++ b/net/minecraft/world/entity/animal/goat/Goat.java +++ b/net/minecraft/world/entity/animal/goat/Goat.java
@@ -363,6 +_,7 @@ @@ -362,6 +_,7 @@
// Paper start - Goat ram API // Paper start - Goat ram API
public void ram(net.minecraft.world.entity.LivingEntity entity) { public void ram(net.minecraft.world.entity.LivingEntity entity) {

View File

@@ -55,16 +55,16 @@
public CraftWorld getWorld() { public CraftWorld getWorld() {
return this.world; return this.world;
} }
@@ -851,6 +_,8 @@ @@ -852,6 +_,8 @@
// Paper end - getblock optimisations - cache world height/sections final org.bukkit.NamespacedKey worldKey = CraftNamespacedKey.fromMinecraft(dimension.identifier()); // Paper
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(bukkitName, CraftNamespacedKey.fromMinecraft(dimension.identifier())); // Spigot this.spigotConfig = new org.spigotmc.SpigotWorldConfig(bukkitName, worldKey); // Spigot
this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper - create paper world config this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper - create paper world config
+ this.purpurConfig = new org.purpurmc.purpur.PurpurWorldConfig(bukkitName, environment, CraftNamespacedKey.fromMinecraft(dimension.identifier())); // Purpur - Purpur config files + this.purpurConfig = new org.purpurmc.purpur.PurpurWorldConfig(bukkitName, environment, worldKey); // Purpur - Purpur config files
+ this.playerBreedingCooldowns = this.getNewBreedingCooldownCache(); // Purpur - Add adjustable breeding cooldown to config + this.playerBreedingCooldowns = this.getNewBreedingCooldownCache(); // Purpur - Add adjustable breeding cooldown to config
this.generator = generator; this.generator = generator;
this.world = new CraftWorld((ServerLevel) this, generator, biomeProvider, environment); this.world = new CraftWorld((ServerLevel) this, worldKey, biomeProvider, environment);
@@ -2193,4 +_,14 @@ @@ -2194,4 +_,14 @@
return this.moonrise$getEntityLookup().getEntityCount(); // Paper - rewrite chunk system return this.moonrise$getEntityLookup().getEntityCount(); // Paper - rewrite chunk system
} }
// Paper end - allow patching this logic // Paper end - allow patching this logic

View File

@@ -36,10 +36,10 @@ index c5a866735d7d918ea58306ea2299a8b82be52f3f..d6ddbcff911ce4c97a20883af10d2b47
+ // Purpur end - Ridables + // Purpur end - Ridables
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 6d485bb4d91668070c28c3fe1dc2c4708760d924..631b8186f89e133936f9a55957fc3215e53184d1 100644 index 7a42d1810f74a041318c8a3c53793106e872081f..6c4045b842a23caa2f3f1e52cb0130a97ffc2682 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -649,6 +649,15 @@ public class CraftEventFactory { @@ -652,6 +652,15 @@ public class CraftEventFactory {
} }
craftServer.getPluginManager().callEvent(event); craftServer.getPluginManager().callEvent(event);
@@ -55,7 +55,7 @@ index 6d485bb4d91668070c28c3fe1dc2c4708760d924..631b8186f89e133936f9a55957fc3215
return event; return event;
} }
@@ -1161,6 +1170,7 @@ public class CraftEventFactory { @@ -1164,6 +1173,7 @@ public class CraftEventFactory {
EntityDamageEvent event; EntityDamageEvent event;
if (damager != null) { if (damager != null) {
event = new EntityDamageByEntityEvent(damager.getBukkitEntity(), damagee.getBukkitEntity(), cause, bukkitDamageSource, modifiers, modifierFunctions, critical); event = new EntityDamageByEntityEvent(damager.getBukkitEntity(), damagee.getBukkitEntity(), cause, bukkitDamageSource, modifiers, modifierFunctions, critical);

View File

@@ -24,10 +24,10 @@ index d6ddbcff911ce4c97a20883af10d2b4752b63f55..7db0454a8c9251faa815500c307d116b
Preconditions.checkArgument(entity != null, "Unknown entity"); Preconditions.checkArgument(entity != null, "Unknown entity");
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index 18709cf2d7d69dc8f4313eca0c0358f60f58b16b..fe9d7ecfec87a8914edb32561210ced95b599a7b 100644 index ca447f1e2840d13217559dc1028dbea63fb05041..983146dc8b685fd0ce906ee8debc2e11df9d9fdc 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -1133,4 +1133,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { @@ -1141,4 +1141,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
manager.untrackWaypoint(getHandle()); manager.untrackWaypoint(getHandle());
manager.trackWaypoint(getHandle()); manager.trackWaypoint(getHandle());
} }

View File

@@ -5,10 +5,10 @@ Subject: [PATCH] Setting to reintroduce end void rings
diff --git a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java diff --git a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
index 569b46cce9d5207380a9391e969e3a6aa790717b..a0cf70f1ccbb78f058e8ac5fc95bcb5b03300cdc 100644 index 232bc5e8b7cbb528b96f8048ba683705cddc436e..7d2b38ecf1478c9e53d033f41c4184864c8d32e4 100644
--- a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java --- a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
+++ b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java +++ b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
@@ -288,6 +288,7 @@ public class GlobalConfiguration extends ConfigurationPart { @@ -292,6 +292,7 @@ public class GlobalConfiguration extends ConfigurationPart {
} }
} }
@@ -16,19 +16,19 @@ index 569b46cce9d5207380a9391e969e3a6aa790717b..a0cf70f1ccbb78f058e8ac5fc95bcb5b
public Misc misc; public Misc misc;
public class Misc extends ConfigurationPart { public class Misc extends ConfigurationPart {
@@ -334,6 +335,7 @@ public class GlobalConfiguration extends ConfigurationPart { @@ -338,6 +339,7 @@ public class GlobalConfiguration extends ConfigurationPart {
@Comment("Whether the nether dimension is enabled and will be loaded.") @Comment("Whether the nether dimension is enabled and will be loaded.")
public boolean enableNether = true; public boolean enableNether = true;
@Comment("Keeps Paper's fix for MC-159283 enabled. Disable to use vanilla End ring terrain.") @Comment("Keeps Paper's fix for MC-159283 enabled. Disable to use vanilla End ring terrain.")
+ @Setting(org.purpurmc.purpur.configuration.transformation.FarEndTerrainGenerationMigration.FIX_FAR_END_TERRAIN_GENERATION_KEY) // Purpur - Migrate Setting to reintroduce end void rings + @Setting(org.purpurmc.purpur.configuration.transformation.FarEndTerrainGenerationMigration.FIX_FAR_END_TERRAIN_GENERATION_KEY) // Purpur - Migrate Setting to reintroduce end void rings
public boolean fixFarEndTerrainGeneration = true; public boolean fixFarEndTerrainGeneration = true;
} @Comment("Fix for MC-301114. This removes the oldest combat entry when it hits the cap, to fix a memory leak on constant entity damage.")
public IntOr.Disabled maxTrackingCombatEntries = new IntOr.Disabled(OptionalInt.of(10240));
diff --git a/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java b/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java diff --git a/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java b/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java
index 1ab7f28e2ba386c68b9c70617c816b0b55fd796d..1446423550b6637aa955a1fa079f6c5d222093df 100644 index aa5ff7fb46b068fcb27abfdcb81f10220c5d1e89..cb9b2b6878e8ca9e3baba341550a860176271013 100644
--- a/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java --- a/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java
+++ b/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java +++ b/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java
@@ -293,6 +293,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor @@ -292,6 +292,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
for (NodePath path : RemovedConfigurations.REMOVED_GLOBAL_PATHS) { for (NodePath path : RemovedConfigurations.REMOVED_GLOBAL_PATHS) {
builder.addAction(path, TransformAction.remove()); builder.addAction(path, TransformAction.remove());
} }

View File

@@ -1,6 +1,6 @@
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -1906,6 +_,52 @@ @@ -1948,6 +_,52 @@
return (this.getHandle().getDragonFight() == null) ? null : new CraftDragonBattle(this.getHandle().getDragonFight()); return (this.getHandle().getDragonFight() == null) ? null : new CraftDragonBattle(this.getHandle().getDragonFight());
} }

View File

@@ -1,6 +1,6 @@
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -491,7 +_,7 @@ @@ -499,7 +_,7 @@
net.minecraft.server.level.ServerPlayer nmsKiller = killer == null ? null : ((CraftPlayer) killer).getHandle(); net.minecraft.server.level.ServerPlayer nmsKiller = killer == null ? null : ((CraftPlayer) killer).getHandle();
this.getHandle().setLastHurtByMob(nmsKiller); this.getHandle().setLastHurtByMob(nmsKiller);
if (nmsKiller != null) { if (nmsKiller != null) {

View File

@@ -1,6 +1,6 @@
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -586,10 +_,15 @@ @@ -582,10 +_,15 @@
@Override @Override
public void setPlayerListName(String name) { public void setPlayerListName(String name) {
@@ -17,7 +17,7 @@
if (this.getHandle().connection == null) return; // Paper - Updates are possible before the player has fully joined if (this.getHandle().connection == null) return; // Paper - Updates are possible before the player has fully joined
for (ServerPlayer player : this.server.getHandle().players) { for (ServerPlayer player : this.server.getHandle().players) {
if (player.getBukkitEntity().canSee(this)) { if (player.getBukkitEntity().canSee(this)) {
@@ -990,6 +_,80 @@ @@ -986,6 +_,80 @@
} }
} }
@@ -98,7 +98,7 @@
@Override @Override
public void sendBlockDamage(Location loc, float progress, org.bukkit.entity.Entity source) { public void sendBlockDamage(Location loc, float progress, org.bukkit.entity.Entity source) {
Preconditions.checkArgument(source != null, "source must not be null"); Preconditions.checkArgument(source != null, "source must not be null");
@@ -2502,6 +_,28 @@ @@ -2490,6 +_,28 @@
public float getWalkSpeed() { public float getWalkSpeed() {
return this.getHandle().getAbilities().walkingSpeed * 2f; return this.getHandle().getAbilities().walkingSpeed * 2f;
} }