From cca94c1a2199cb304ac3aae3220e38458d273ff4 Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Thu, 28 Dec 2023 12:47:57 -0800 Subject: [PATCH] Updated Upstream (Bukkit/CraftBukkit/Spigot) (#10085) Upstream has released updates that appear to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: 0c7aedbc SPIGOT-7554, PR-954: Add DecoratedPotInventory CraftBukkit Changes: 53ebb05e3 SPIGOT-7554, PR-1323: Add DecoratedPotInventory 33a2d8773 Ensure that PlayerMoveEvent is always fired where applicable 7df18510f SPIGOT-7555: Don't cast ItemFlags to byte 19aec59ea Use provided case for non-existent OfflinePlayers Spigot Changes: e7ce55a3 Remove obsolete PlayerMoveEvent improvements 3e5e22c0 Remove obsolete lowercasing of non existent OfflinePlayer names --- patches/api/Add-missing-InventoryType.patch | 24 +++++++++++++++++++ .../server/Add-missing-InventoryType.patch | 22 +++++++++++++++++ ...event-players-from-moving-into-unloa.patch | 2 +- .../Fix-GameProfileCache-concurrency.patch | 2 +- ...r-large-move-vectors-crashing-server.patch | 7 +++--- ...on-checking-in-player-move-packet-ha.patch | 1 - work/Bukkit | 2 +- work/CraftBukkit | 2 +- work/Spigot | 2 +- 9 files changed, 54 insertions(+), 10 deletions(-) create mode 100644 patches/api/Add-missing-InventoryType.patch create mode 100644 patches/server/Add-missing-InventoryType.patch diff --git a/patches/api/Add-missing-InventoryType.patch b/patches/api/Add-missing-InventoryType.patch new file mode 100644 index 0000000000..453eb03c2c --- /dev/null +++ b/patches/api/Add-missing-InventoryType.patch @@ -0,0 +1,24 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jake Potrebic +Date: Wed, 27 Dec 2023 16:46:13 -0800 +Subject: [PATCH] Add missing InventoryType + +Upstream did not add a DECORATED_POT inventory type + +diff --git a/src/main/java/org/bukkit/event/inventory/InventoryType.java b/src/main/java/org/bukkit/event/inventory/InventoryType.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/event/inventory/InventoryType.java ++++ b/src/main/java/org/bukkit/event/inventory/InventoryType.java +@@ -0,0 +0,0 @@ public enum InventoryType { + * Pseudo jukebox inventory with 1 slot of undefined type. + */ + JUKEBOX(1, "Jukebox", false), ++ // Paper start - add missing type ++ /** ++ * Pseudo decorated pot with 1 slot of undefined type. ++ */ ++ DECORATED_POT(1, "Decorated Pot", false), ++ // Paper end - add missing type + /** + * A crafter inventory, with 9 CRAFTING slots. + */ diff --git a/patches/server/Add-missing-InventoryType.patch b/patches/server/Add-missing-InventoryType.patch new file mode 100644 index 0000000000..7435af66df --- /dev/null +++ b/patches/server/Add-missing-InventoryType.patch @@ -0,0 +1,22 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jake Potrebic +Date: Wed, 27 Dec 2023 16:46:07 -0800 +Subject: [PATCH] Add missing InventoryType + +Upstream did not add a DECORATED_POT inventory type + +diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java ++++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java +@@ -0,0 +0,0 @@ public class CraftInventory implements Inventory { + return InventoryType.COMPOSTER; + } else if (this.inventory instanceof JukeboxBlockEntity) { + return InventoryType.JUKEBOX; ++ // Paper start ++ } else if (this.inventory instanceof net.minecraft.world.level.block.entity.DecoratedPotBlockEntity) { ++ return org.bukkit.event.inventory.InventoryType.DECORATED_POT; ++ // Paper end + } else { + return InventoryType.CHEST; + } diff --git a/patches/server/Add-option-to-prevent-players-from-moving-into-unloa.patch b/patches/server/Add-option-to-prevent-players-from-moving-into-unloa.patch index a22f91e26e..7f3571d222 100644 --- a/patches/server/Add-option-to-prevent-players-from-moving-into-unloa.patch +++ b/patches/server/Add-option-to-prevent-players-from-moving-into-unloa.patch @@ -40,7 +40,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 // CraftBukkit end ServerGamePacketListenerImpl.LOGGER.warn("{} (vehicle of {}) moved too quickly! {},{},{}", new Object[]{entity.getName().getString(), this.player.getName().getString(), d6, d7, d8}); @@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl - this.allowedPlayerTicks = 20; // CraftBukkit + } else { this.awaitingTeleportTime = this.tickCount; - double d0 = ServerGamePacketListenerImpl.clampHorizontal(packet.getX(this.player.getX())); diff --git a/patches/server/Fix-GameProfileCache-concurrency.patch b/patches/server/Fix-GameProfileCache-concurrency.patch index 5378aae3f8..66e2ff69e6 100644 --- a/patches/server/Fix-GameProfileCache-concurrency.patch +++ b/patches/server/Fix-GameProfileCache-concurrency.patch @@ -65,7 +65,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } else { + stateLocked = false; this.stateLock.unlock(); // Paper - allow better concurrency + try { this.lookupLock.lock(); // Paper - allow better concurrency - optional = GameProfileCache.lookupGameProfile(this.profileRepository, name); // Spigot - use correct case for offline players + optional = GameProfileCache.lookupGameProfile(this.profileRepository, name); // CraftBukkit - use correct case for offline players + } finally { this.lookupLock.unlock(); } // Paper - allow better concurrency if (optional.isPresent()) { this.add((GameProfile) optional.get()); diff --git a/patches/server/Fix-for-large-move-vectors-crashing-server.patch b/patches/server/Fix-for-large-move-vectors-crashing-server.patch index e362c6358d..a1679ecf74 100644 --- a/patches/server/Fix-for-large-move-vectors-crashing-server.patch +++ b/patches/server/Fix-for-large-move-vectors-crashing-server.patch @@ -10,9 +10,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl - - if (entity != this.player && entity.getControllingPassenger() == this.player && entity == this.lastVehicle) { - ServerLevel worldserver = this.player.serverLevel(); + float prevYaw = this.player.getYRot(); + float prevPitch = this.player.getXRot(); + // CraftBukkit end - double d0 = entity.getX(); - double d1 = entity.getY(); - double d2 = entity.getZ(); @@ -27,7 +27,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 double d8 = d5 - this.vehicleFirstGoodZ; double d9 = entity.getDeltaMovement().lengthSqr(); - double d10 = d6 * d6 + d7 * d7 + d8 * d8; -- + // Paper start - fix large move vectors killing the server + double currDeltaX = toX - fromX; + double currDeltaY = toY - fromY; diff --git a/patches/server/Optimise-collision-checking-in-player-move-packet-ha.patch b/patches/server/Optimise-collision-checking-in-player-move-packet-ha.patch index b96109475b..a14869f8ef 100644 --- a/patches/server/Optimise-collision-checking-in-player-move-packet-ha.patch +++ b/patches/server/Optimise-collision-checking-in-player-move-packet-ha.patch @@ -36,7 +36,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + flag2 = true; // Paper - diff on change, this should be moved wrongly ServerGamePacketListenerImpl.LOGGER.warn("{} (vehicle of {}) moved wrongly! {}", new Object[]{entity.getName().getString(), this.player.getName().getString(), Math.sqrt(d10)}); } - Location curPos = this.getCraftPlayer().getLocation(); // Spigot entity.absMoveTo(d3, d4, d5, f, f1); this.player.absMoveTo(d3, d4, d5, this.player.getYRot(), this.player.getXRot()); // CraftBukkit diff --git a/work/Bukkit b/work/Bukkit index cc9aa21a28..0c7aedbcea 160000 --- a/work/Bukkit +++ b/work/Bukkit @@ -1 +1 @@ -Subproject commit cc9aa21a289b9a7d361c4a8f99b56d5300f40d4c +Subproject commit 0c7aedbceabcf05dde0a483001acd3d957e06c03 diff --git a/work/CraftBukkit b/work/CraftBukkit index bcf56171a6..53ebb05e39 160000 --- a/work/CraftBukkit +++ b/work/CraftBukkit @@ -1 +1 @@ -Subproject commit bcf56171a63d24b21bea341e8f5b3c5234f077c3 +Subproject commit 53ebb05e3951a1a05e4efb8a739d9bf31d21385e diff --git a/work/Spigot b/work/Spigot index ed9ba9a42d..e7ce55a3b9 160000 --- a/work/Spigot +++ b/work/Spigot @@ -1 +1 @@ -Subproject commit ed9ba9a42d6c6aca02c474aed4207b7b4fd6f5d6 +Subproject commit e7ce55a3b93404a86c248a3d749e5219adda4ca0