Updated Upstream (Paper)

Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@6bb9dc6b Normalize and trim spaces in Player#performCommand (#12892)
PaperMC/Paper@840dd9e1 Fix dialog preconditions (#12895)
PaperMC/Paper@9ccc51df Fix legacy pearls forgetting owner on disconnect (#12884)
PaperMC/Paper@57c13137 Allow to change despawnInPeaceful (#12880)
PaperMC/Paper@a5763618  Add WorldDifficultyChangeEvent (#12471)
PaperMC/Paper@dbc367ba Keep non-container slots synced when in container view (#12881)
This commit is contained in:
granny
2025-07-28 16:39:42 -07:00
parent 6c88d74021
commit 520a7e500d
14 changed files with 97 additions and 95 deletions

View File

@@ -29,10 +29,10 @@ index edc1758f12b36555edb7eaba2ea3bd78118dda93..7a9e20699a8a5e95910ed15eb6cd1192
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 25df43fd934d9b446dde5c46b5dd2083910435fa..aed79c57a691eb9a100e566c4d1163181af0b360 100644
index 2b17b3b51bd4ccd431e7cc959cc42795dfb2c1b8..54fbe5006c2c240937efb6fc89cf08b72637b9e5 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1490,6 +1490,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player, PluginMessa
@@ -1459,6 +1459,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player, PluginMessa
// Paper start - Teleport passenger API
// Don't allow teleporting between worlds while keeping passengers
if (ignorePassengers && entity.isVehicle() && location.getWorld() != this.getWorld()) {
@@ -40,7 +40,7 @@ index 25df43fd934d9b446dde5c46b5dd2083910435fa..aed79c57a691eb9a100e566c4d116318
return false;
}
@@ -1511,6 +1512,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player, PluginMessa
@@ -1480,6 +1481,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player, PluginMessa
}
if (entity.isVehicle() && !ignorePassengers) { // Paper - Teleport API

View File

@@ -1,6 +1,6 @@
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -428,6 +_,20 @@
@@ -429,6 +_,20 @@
this.paperPluginManager = new io.papermc.paper.plugin.manager.PaperPluginManagerImpl(this, this.commandMap, pluginManager);
this.pluginManager.paperPluginManager = this.paperPluginManager;
// Paper end
@@ -21,7 +21,7 @@
CraftRegistry.setMinecraftRegistry(console.registryAccess());
@@ -1045,6 +_,7 @@
@@ -1048,6 +_,7 @@
org.spigotmc.SpigotConfig.init((File) this.console.options.valueOf("spigot-settings")); // Spigot
this.console.paperConfigurations.reloadConfigs(this.console);
@@ -29,7 +29,7 @@
for (ServerLevel world : this.console.getAllLevels()) {
// world.serverLevelData.setDifficulty(config.difficulty); // Paper - per level difficulty
world.setSpawnSettings(world.serverLevelData.getDifficulty() != Difficulty.PEACEFUL && config.spawnMonsters); // Paper - per level difficulty (from MinecraftServer#setDifficulty(ServerLevel, Difficulty, boolean))
@@ -1060,6 +_,7 @@
@@ -1063,6 +_,7 @@
}
}
world.spigotConfig.init(); // Spigot
@@ -37,7 +37,7 @@
}
Plugin[] pluginClone = pluginManager.getPlugins().clone(); // Paper
@@ -1077,6 +_,7 @@
@@ -1080,6 +_,7 @@
org.spigotmc.SpigotConfig.registerCommands(); // Spigot
io.papermc.paper.command.PaperCommands.registerCommands(this.console); // Paper
this.spark.registerCommandBeforePlugins(this); // Paper - spark
@@ -45,7 +45,7 @@
this.overrideAllCommandBlockCommands = this.commandsConfiguration.getStringList("command-block-overrides").contains("*");
this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions");
@@ -1576,6 +_,60 @@
@@ -1579,6 +_,60 @@
return true;
}
@@ -106,7 +106,7 @@
@Override
public List<Recipe> getRecipesFor(ItemStack result) {
Preconditions.checkArgument(result != null, "ItemStack cannot be null");
@@ -2944,6 +_,18 @@
@@ -2947,6 +_,18 @@
return CraftServer.this.console.paperConfigurations.createLegacyObject(CraftServer.this.console);
}
@@ -125,7 +125,7 @@
@Override
public void restart() {
CraftServer.this.restart();
@@ -2976,6 +_,7 @@
@@ -2979,6 +_,7 @@
@Override
public double[] getTPS() {
return new double[] {
@@ -133,7 +133,7 @@
net.minecraft.server.MinecraftServer.getServer().tps1.getAverage(),
net.minecraft.server.MinecraftServer.getServer().tps5.getAverage(),
net.minecraft.server.MinecraftServer.getServer().tps15.getAverage()
@@ -3183,4 +_,18 @@
@@ -3186,4 +_,18 @@
public void allowPausing(final Plugin plugin, final boolean value) {
this.console.addPluginAllowingSleep(plugin.getName(), value);
}

View File

@@ -1,6 +1,6 @@
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -2374,6 +_,50 @@
@@ -2375,6 +_,50 @@
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/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -681,10 +_,15 @@
@@ -564,10 +_,15 @@
@Override
public void setPlayerListName(String name) {
@@ -17,40 +17,10 @@
if (this.getHandle().connection == null) return; // Paper - Updates are possible before the player has fully joined
for (ServerPlayer player : (List<ServerPlayer>) this.server.getHandle().players) {
if (player.getBukkitEntity().canSee(this)) {
@@ -2792,6 +_,28 @@
this.getHandle().getAttribute(Attributes.MOVEMENT_SPEED).setBaseValue(player.getAbilities().walkingSpeed); // SPIGOT-5833: combination of the two in 1.16+
}
+ // Purpur start - OfflinePlayer API
+ @Override
+ public boolean teleportOffline(Location destination) {
+ return this.teleport(destination);
+ }
+
+ @Override
+ public boolean teleportOffline(Location destination, PlayerTeleportEvent.TeleportCause cause) {
+ return this.teleport(destination, cause);
+ }
+
+ @Override
+ public java.util.concurrent.CompletableFuture<Boolean> teleportOfflineAsync(Location destination) {
+ return this.teleportAsync(destination);
+ }
+
+ @Override
+ public java.util.concurrent.CompletableFuture<Boolean> teleportOfflineAsync(Location destination, PlayerTeleportEvent.TeleportCause cause) {
+ return this.teleportAsync(destination, cause);
+ }
+ // Purpur end - OfflinePlayer API
+
private void validateSpeed(float value) {
Preconditions.checkArgument(value <= 1f && value >= -1f, "Speed value (%s) need to be between -1f and 1f", value);
}
@@ -3600,4 +_,76 @@
this(new ShortArraySet(), new ArrayList<>());
@@ -1008,6 +_,78 @@
}
}
+
+ // Purpur start - Purpur client support
+ @Override
+ public boolean usesPurpurClient() {
@@ -122,4 +92,36 @@
+ this.getHandle().connection.send(new net.minecraft.network.protocol.game.ClientboundPlayerCombatKillPacket(getEntityId(), io.papermc.paper.adventure.PaperAdventure.asVanilla(message)));
+ }
+ // Purpur end - Death screen API
}
+
@Override
public void sendBlockDamage(Location loc, float progress) {
this.sendBlockDamage(loc, progress, this.getEntityId());
@@ -2664,6 +_,28 @@
public float getWalkSpeed() {
return this.getHandle().getAbilities().walkingSpeed * 2f;
}
+
+ // Purpur start - OfflinePlayer API
+ @Override
+ public boolean teleportOffline(Location destination) {
+ return this.teleport(destination);
+ }
+
+ @Override
+ public boolean teleportOffline(Location destination, PlayerTeleportEvent.TeleportCause cause) {
+ return this.teleport(destination, cause);
+ }
+
+ @Override
+ public java.util.concurrent.CompletableFuture<Boolean> teleportOfflineAsync(Location destination) {
+ return this.teleportAsync(destination);
+ }
+
+ @Override
+ public java.util.concurrent.CompletableFuture<Boolean> teleportOfflineAsync(Location destination, PlayerTeleportEvent.TeleportCause cause) {
+ return this.teleportAsync(destination, cause);
+ }
+ // Purpur end - OfflinePlayer API
private void validateSpeed(float value) {
Preconditions.checkArgument(value <= 1f && value >= -1f, "Speed value (%s) need to be between -1f and 1f", value);