2023-03-18 18:52:24 +01:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Nassim Jahnke <nassim@njahnke.dev>
|
|
|
|
Date: Sat, 18 Mar 2023 18:51:33 +0100
|
2023-03-20 09:47:10 +01:00
|
|
|
Subject: [PATCH] Fix chiseled bookshelf and jukebox setItem with air
|
2023-03-18 18:52:24 +01:00
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/level/block/entity/ChiseledBookShelfBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/ChiseledBookShelfBlockEntity.java
|
2023-09-22 18:11:35 +02:00
|
|
|
index 15ef84c39a1a77cd9e33efee670bd0967c52657c..dda68d157d4da6e379567b25810051b652ec122f 100644
|
2023-03-18 18:52:24 +01:00
|
|
|
--- a/src/main/java/net/minecraft/world/level/block/entity/ChiseledBookShelfBlockEntity.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/level/block/entity/ChiseledBookShelfBlockEntity.java
|
2023-09-22 18:11:35 +02:00
|
|
|
@@ -149,7 +149,7 @@ public class ChiseledBookShelfBlockEntity extends BlockEntity implements Contain
|
2023-03-18 18:52:24 +01:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public void setItem(int slot, ItemStack stack) {
|
|
|
|
- if (stack.is(ItemTags.BOOKSHELF_BOOKS)) {
|
|
|
|
+ if (stack.isEmpty() || stack.is(ItemTags.BOOKSHELF_BOOKS)) { // Paper
|
|
|
|
this.items.set(slot, stack);
|
2023-06-13 01:51:45 +02:00
|
|
|
if (level != null) this.updateState(slot); // CraftBukkit - SPIGOT-7381: check for null world
|
2023-09-22 18:11:35 +02:00
|
|
|
} else if (stack.isEmpty()) {
|
2023-03-20 09:47:10 +01:00
|
|
|
diff --git a/src/main/java/net/minecraft/world/level/block/entity/JukeboxBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/JukeboxBlockEntity.java
|
2023-09-22 18:11:35 +02:00
|
|
|
index 2c1edc6dfc7fd1a8af977919ce31913365cf3ddd..6c9b3fb1a015320da207c6b724cc18fb6b80267a 100644
|
2023-03-20 09:47:10 +01:00
|
|
|
--- a/src/main/java/net/minecraft/world/level/block/entity/JukeboxBlockEntity.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/level/block/entity/JukeboxBlockEntity.java
|
|
|
|
@@ -183,6 +183,12 @@ public class JukeboxBlockEntity extends BlockEntity implements Clearable, Contai
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void setItem(int slot, ItemStack stack) {
|
|
|
|
+ // Paper start
|
|
|
|
+ if (stack.isEmpty()) {
|
|
|
|
+ this.removeItem(slot, 0);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
if (stack.is(ItemTags.MUSIC_DISCS) && this.level != null) {
|
|
|
|
this.items.set(slot, stack);
|
|
|
|
this.setHasRecordBlockState((Entity) null, true);
|