From 5326cb65f0ed13cb1a7882d0cd889f272de45c5f Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Fri, 24 Mar 2023 13:38:40 -0700 Subject: [PATCH] Updated Upstream (Bukkit/CraftBukkit/Spigot) (#9018) 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: 2c64d8c4 SPIGOT-7309: Add API for jukebox inventories a6d7e4ca PR-826: Add Sniffer API CraftBukkit Changes: 93813509b SPIGOT-7309: Add API for jukebox inventories 2d5209e8d PR-1153: Handle teleport reason in spreadplayers command f5b61387e SPIGOT-7308: Fix NullPointerException when calling Jukebox#setRecord() 388d458a6 SPIGOT-7306: Fix reset of coords in default teleportTo in EntityPlayer 40b87e1af PR-1150: Add Sniffer API and handle EntityItemDropEvent Spigot Changes: 6ad4b93c SPIGOT-7298: Fix debug stick always permission left click toggle --- patches/api/Fix-Jukeboxes.patch | 58 ------------------- .../api/Mark-experimental-api-as-such.patch | 14 +++-- patches/server/Fix-Jukeboxes.patch | 44 -------------- work/Bukkit | 2 +- work/CraftBukkit | 2 +- work/Spigot | 2 +- 6 files changed, 11 insertions(+), 111 deletions(-) delete mode 100644 patches/api/Fix-Jukeboxes.patch delete mode 100644 patches/server/Fix-Jukeboxes.patch diff --git a/patches/api/Fix-Jukeboxes.patch b/patches/api/Fix-Jukeboxes.patch deleted file mode 100644 index 4135ed985e..0000000000 --- a/patches/api/Fix-Jukeboxes.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Jake Potrebic -Date: Tue, 14 Mar 2023 18:55:47 -0700 -Subject: [PATCH] Fix Jukeboxes - - -diff --git a/src/main/java/org/bukkit/block/Jukebox.java b/src/main/java/org/bukkit/block/Jukebox.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/org/bukkit/block/Jukebox.java -+++ b/src/main/java/org/bukkit/block/Jukebox.java -@@ -0,0 +0,0 @@ import org.jetbrains.annotations.Nullable; - /** - * Represents a captured state of a jukebox. - */ --public interface Jukebox extends TileState { -+public interface Jukebox extends TileState, org.bukkit.inventory.BlockInventoryHolder { // Paper - - /** - * Gets the record inserted into the jukebox. -@@ -0,0 +0,0 @@ public interface Jukebox extends TileState { - * @throws IllegalStateException if this block state is not placed - */ - public boolean eject(); -+ // Paper start -+ /** -+ * @return inventory -+ * @see Container#getInventory() -+ */ -+ @NotNull -+ @Override -+ org.bukkit.inventory.Inventory getInventory(); -+ -+ /** -+ * @return snapshot inventory -+ * @see Container#getSnapshotInventory() -+ */ -+ @NotNull -+ org.bukkit.inventory.Inventory getSnapshotInventory(); -+ // Paper end - } -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 { - */ - @Deprecated @org.jetbrains.annotations.ApiStatus.Experimental // Paper - 1.20 - SMITHING_NEW(4, "Upgrade Gear"), -+ // Paper start -+ /** -+ * Pseudo jukebox inventory -+ */ -+ @org.jetbrains.annotations.ApiStatus.Experimental -+ JUKEBOX(1, "Jukebox", false); -+ // Paper end - ; - - private final int size; diff --git a/patches/api/Mark-experimental-api-as-such.patch b/patches/api/Mark-experimental-api-as-such.patch index e1e1862691..6ff31ed61f 100644 --- a/patches/api/Mark-experimental-api-as-such.patch +++ b/patches/api/Mark-experimental-api-as-such.patch @@ -1169,14 +1169,15 @@ diff --git a/src/main/java/org/bukkit/entity/Sniffer.java b/src/main/java/org/bu index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/entity/Sniffer.java +++ b/src/main/java/org/bukkit/entity/Sniffer.java -@@ -0,0 +0,0 @@ package org.bukkit.entity; - /** - * Represents a Sniffer. +@@ -0,0 +0,0 @@ import org.jetbrains.annotations.Nullable; + * Note: This entity is part of an experimental feature of Minecraft and + * hence subject to change. */ -+@org.jetbrains.annotations.ApiStatus.Experimental // Paper - 1.20 +-@ApiStatus.Experimental ++@ApiStatus.Experimental // Paper - 1.20 public interface Sniffer extends Animals { - } + /** diff --git a/src/main/java/org/bukkit/entity/memory/MemoryKey.java b/src/main/java/org/bukkit/entity/memory/MemoryKey.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/entity/memory/MemoryKey.java @@ -1200,7 +1201,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + @org.jetbrains.annotations.ApiStatus.Experimental // Paper - 1.20 CHISELED_BOOKSHELF(6, "Chiseled Bookshelf", false), /** - * The new smithing inventory, with 3 CRAFTING slots and 1 RESULT slot. + * Pseudo jukebox inventory with 1 slot of undefined type. +@@ -0,0 +0,0 @@ public enum InventoryType { * * @deprecated draft, experimental 1.20 API */ diff --git a/patches/server/Fix-Jukeboxes.patch b/patches/server/Fix-Jukeboxes.patch deleted file mode 100644 index ac2cc1c503..0000000000 --- a/patches/server/Fix-Jukeboxes.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Jake Potrebic -Date: Tue, 14 Mar 2023 18:55:56 -0700 -Subject: [PATCH] Fix Jukeboxes - - -diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftJukebox.java b/src/main/java/org/bukkit/craftbukkit/block/CraftJukebox.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/org/bukkit/craftbukkit/block/CraftJukebox.java -+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftJukebox.java -@@ -0,0 +0,0 @@ public class CraftJukebox extends CraftBlockEntityState impl - jukebox.popOutRecord(); - return result; - } -+ // Paper start -+ @Override -+ public org.bukkit.inventory.Inventory getInventory() { -+ if (!this.isPlaced()) { -+ return this.getSnapshotInventory(); -+ } -+ return new org.bukkit.craftbukkit.inventory.CraftInventory(this.getTileEntity()); -+ } -+ -+ @Override -+ public org.bukkit.inventory.Inventory getSnapshotInventory() { -+ return new org.bukkit.craftbukkit.inventory.CraftInventory(this.getSnapshot()); -+ } -+ // Paper end - } -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 instanceof CraftInventorySmithingNew) { - return InventoryType.SMITHING_NEW; -+ // Paper start -+ } else if (this.inventory instanceof net.minecraft.world.level.block.entity.JukeboxBlockEntity) { -+ return InventoryType.JUKEBOX; -+ // Paper end - } else { - return InventoryType.CHEST; - } diff --git a/work/Bukkit b/work/Bukkit index 150a2861a7..2c64d8c4a8 160000 --- a/work/Bukkit +++ b/work/Bukkit @@ -1 +1 @@ -Subproject commit 150a2861a7399537d077bb754438d12a8741fe36 +Subproject commit 2c64d8c4a880c6aec8ee8ce3abdd0238b0e0d8a3 diff --git a/work/CraftBukkit b/work/CraftBukkit index e5a7921f05..93813509b6 160000 --- a/work/CraftBukkit +++ b/work/CraftBukkit @@ -1 +1 @@ -Subproject commit e5a7921f0597766fd92590317da11ffea85138a4 +Subproject commit 93813509b6dd3476419a5344b252aa1867960090 diff --git a/work/Spigot b/work/Spigot index 41150f3919..6ad4b93c2a 160000 --- a/work/Spigot +++ b/work/Spigot @@ -1 +1 @@ -Subproject commit 41150f3919a43f833c5c81734afc71ad419c6816 +Subproject commit 6ad4b93c2ab4d981910821bd43be6a085177bed9