From fe586949bf3d3255e76944aecf082b00b1c62384 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Sat, 17 Dec 2016 09:45:14 +1100 Subject: [PATCH] SPIGOT-2924: Improve handling of Jukeboxes playing nothing. By: md_5 --- .../java/org/bukkit/craftbukkit/block/CraftJukebox.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftJukebox.java b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftJukebox.java index ebe7a6d0f6..4df3edf294 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftJukebox.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftJukebox.java @@ -29,7 +29,7 @@ public class CraftJukebox extends CraftBlockState implements Jukebox { @Override public Material getPlaying() { ItemStack record = jukebox.getRecord(); - if (record == null) { + if (record.isEmpty()) { return Material.AIR; } return CraftMagicNumbers.getMaterial(record.getItem()); @@ -39,10 +39,9 @@ public class CraftJukebox extends CraftBlockState implements Jukebox { public void setPlaying(Material record) { if (record == null || CraftMagicNumbers.getItem(record) == null) { record = Material.AIR; - jukebox.setRecord(null); - } else { - jukebox.setRecord(new ItemStack(CraftMagicNumbers.getItem(record), 1)); } + + jukebox.setRecord(new ItemStack(CraftMagicNumbers.getItem(record), 1)); if (!isPlaced()) { return; }