PaperMC/paper-server/nms-patches/net/minecraft/world/level/block/BlockLectern.patch
CraftBukkit/Spigot 65bc2541a3 Update to Minecraft 1.20.5
By: md_5 <git@md-5.net>
2024-04-24 01:15:00 +10:00

16 lines
1.1 KiB
Diff

--- a/net/minecraft/world/level/block/BlockLectern.java
+++ b/net/minecraft/world/level/block/BlockLectern.java
@@ -207,11 +207,12 @@
}
private void popBook(IBlockData iblockdata, World world, BlockPosition blockposition) {
- TileEntity tileentity = world.getBlockEntity(blockposition);
+ TileEntity tileentity = world.getBlockEntity(blockposition, false); // CraftBukkit - don't validate, type may be changed already
if (tileentity instanceof TileEntityLectern tileentitylectern) {
EnumDirection enumdirection = (EnumDirection) iblockdata.getValue(BlockLectern.FACING);
ItemStack itemstack = tileentitylectern.getBook().copy();
+ if (itemstack.isEmpty()) return; // CraftBukkit - SPIGOT-5500
float f = 0.25F * (float) enumdirection.getStepX();
float f1 = 0.25F * (float) enumdirection.getStepZ();
EntityItem entityitem = new EntityItem(world, (double) blockposition.getX() + 0.5D + (double) f, (double) (blockposition.getY() + 1), (double) blockposition.getZ() + 0.5D + (double) f1, itemstack);