mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-23 06:50:25 +01:00
SPIGOT-5500: Lectern cannot be replaced using /setblock and other commands
This commit is contained in:
parent
c727dc2a8c
commit
2fd7964587
1 changed files with 17 additions and 0 deletions
17
nms-patches/BlockLectern.patch
Normal file
17
nms-patches/BlockLectern.patch
Normal file
|
@ -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);
|
Loading…
Reference in a new issue