PaperMC/patches/api/0416-Fix-Jukeboxes.patch
Jake Potrebic 7af4cd3647
Updated Upstream (Bukkit/CraftBukkit) (#9013)
* Updated Upstream (Bukkit/CraftBukkit)

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:
150a2861 PR-827: Add BlockData#getPlacementMaterial
58c9c8ce SPIGOT-7301: Prevent creating non-openable inventories
3741079b PR-824: Expand upon PotionEffect API to better accommodate infinite durations

CraftBukkit Changes:
e5a7921f0 PR-1149: Add BlockData#getPlacementMaterial
58504fa61 SPIGOT-7302: Fix more issues with EntityDamageByEntity - Fix Projectile damage by dispenser - Fix cases where only exists a direct entity damager
48394703d Increase outdated build delay

* Improve docs for BlockData#getPlacementMaterial
2023-03-20 01:47:10 -07:00

58 lines
2.1 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jake Potrebic <jake.m.potrebic@gmail.com>
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 321e5e034a906129142341cec952fac3c1e7e360..37967acb9ee85f1d1c9b3b2d3472b460f41f7080 100644
--- a/src/main/java/org/bukkit/block/Jukebox.java
+++ b/src/main/java/org/bukkit/block/Jukebox.java
@@ -8,7 +8,7 @@ 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.
@@ -62,4 +62,20 @@ 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 90a846e23d2b41e3f658fbf48cd43bd5e72b709f..35aac79a7c58d00e6b3c6c042b291093c9c7af71 100644
--- a/src/main/java/org/bukkit/event/inventory/InventoryType.java
+++ b/src/main/java/org/bukkit/event/inventory/InventoryType.java
@@ -146,6 +146,13 @@ 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;