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
|
|
|
|
index 6986b2a5df34bfe078c902594f6409ad0ea847ef..ed12a23448dc9ada423ebd79a131eab2de3d6e48 100644
|
|
|
|
--- a/src/main/java/net/minecraft/world/level/block/entity/ChiseledBookShelfBlockEntity.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/level/block/entity/ChiseledBookShelfBlockEntity.java
|
|
|
|
@@ -146,7 +146,7 @@ public class ChiseledBookShelfBlockEntity extends BlockEntity implements Contain
|
|
|
|
|
|
|
|
@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);
|
|
|
|
this.updateState(slot);
|
|
|
|
}
|
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-03-24 21:38:40 +01:00
|
|
|
index 9cb6c0d80a988c23dd7af4263882ac128d08d6e8..08a6f2924b36d36fadb35d8d2443bb717ff4567e 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);
|