Update to Minecraft 1.18-pre5

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2021-11-22 09:00:00 +11:00
parent a852b81a69
commit 43702a9e10
700 changed files with 10286 additions and 10098 deletions

View File

@@ -1,17 +1,17 @@
--- a/net/minecraft/world/level/block/BlockJukeBox.java
+++ b/net/minecraft/world/level/block/BlockJukeBox.java
@@ -62,7 +62,13 @@
TileEntity tileentity = generatoraccess.getTileEntity(blockposition);
@@ -59,7 +59,13 @@
TileEntity tileentity = generatoraccess.getBlockEntity(blockposition);
if (tileentity instanceof TileEntityJukeBox) {
- ((TileEntityJukeBox) tileentity).setRecord(itemstack.cloneItemStack());
- ((TileEntityJukeBox) tileentity).setRecord(itemstack.copy());
+ // CraftBukkit start - There can only be one
+ itemstack = itemstack.cloneItemStack();
+ itemstack = itemstack.copy();
+ if (!itemstack.isEmpty()) {
+ itemstack.setCount(1);
+ }
+ ((TileEntityJukeBox) tileentity).setRecord(itemstack);
+ // CraftBukkit end
generatoraccess.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockJukeBox.HAS_RECORD, true), 2);
generatoraccess.setBlock(blockposition, (IBlockData) iblockdata.setValue(BlockJukeBox.HAS_RECORD, true), 2);
}
}