PaperMC/paper-server/nms-patches/net/minecraft/world/level/block/BlockJukeBox.patch
CraftBukkit/Spigot f8db65033c Update to Minecraft 1.19.1
By: md_5 <git@md-5.net>
2022-07-28 04:00:00 +10:00

17 lines
896 B
Diff

--- a/net/minecraft/world/level/block/BlockJukeBox.java
+++ b/net/minecraft/world/level/block/BlockJukeBox.java
@@ -67,7 +67,13 @@
if (tileentity instanceof TileEntityJukeBox) {
TileEntityJukeBox tileentityjukebox = (TileEntityJukeBox) tileentity;
- tileentityjukebox.setRecord(itemstack.copy());
+ // CraftBukkit start - There can only be one
+ itemstack = itemstack.copy();
+ if (!itemstack.isEmpty()) {
+ itemstack.setCount(1);
+ }
+ tileentityjukebox.setRecord(itemstack);
+ // CraftBukkit end
tileentityjukebox.playRecord();
generatoraccess.setBlock(blockposition, (IBlockData) iblockdata.setValue(BlockJukeBox.HAS_RECORD, true), 2);
generatoraccess.gameEvent(GameEvent.BLOCK_CHANGE, blockposition, GameEvent.a.of(entity, iblockdata));