From 2fd7964587a3fb8c9b11883eb73f69c41a69d647 Mon Sep 17 00:00:00 2001 From: md_5 Date: Mon, 6 Jan 2020 12:12:34 +1100 Subject: [PATCH] SPIGOT-5500: Lectern cannot be replaced using /setblock and other commands --- nms-patches/BlockLectern.patch | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 nms-patches/BlockLectern.patch diff --git a/nms-patches/BlockLectern.patch b/nms-patches/BlockLectern.patch new file mode 100644 index 0000000000..81c3a26947 --- /dev/null +++ b/nms-patches/BlockLectern.patch @@ -0,0 +1,17 @@ +--- a/net/minecraft/server/BlockLectern.java ++++ b/net/minecraft/server/BlockLectern.java +@@ -151,12 +151,13 @@ + } + + private void d(IBlockData iblockdata, World world, BlockPosition blockposition) { +- TileEntity tileentity = world.getTileEntity(blockposition); ++ TileEntity tileentity = world.getTileEntity(blockposition, false); // CraftBukkit - don't validate, type may be changed already + + if (tileentity instanceof TileEntityLectern) { + TileEntityLectern tileentitylectern = (TileEntityLectern) tileentity; + EnumDirection enumdirection = (EnumDirection) iblockdata.get(BlockLectern.a); + ItemStack itemstack = tileentitylectern.getBook().cloneItemStack(); ++ if (itemstack.isEmpty()) return; // CraftBukkit - SPIGOT-5500 + float f = 0.25F * (float) enumdirection.getAdjacentX(); + float f1 = 0.25F * (float) enumdirection.getAdjacentZ(); + EntityItem entityitem = new EntityItem(world, (double) blockposition.getX() + 0.5D + (double) f, (double) (blockposition.getY() + 1), (double) blockposition.getZ() + 0.5D + (double) f1, itemstack);