diff options
Diffstat (limited to 'patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/LecternBlock.java.patch')
-rw-r--r-- | patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/LecternBlock.java.patch | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/LecternBlock.java.patch b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/LecternBlock.java.patch new file mode 100644 index 0000000000..8c4d06e92f --- /dev/null +++ b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/LecternBlock.java.patch @@ -0,0 +1,29 @@ +--- a/net/minecraft/world/level/block/LecternBlock.java ++++ b/net/minecraft/world/level/block/LecternBlock.java +@@ -219,16 +206,17 @@ + } + } + +- private void popBook(BlockState blockstate, Level level, BlockPos blockpos) { +- BlockEntity blockentity = level.getBlockEntity(blockpos); ++ private void popBook(IBlockData state, Level level, BlockPos pos) { ++ BlockEntity tileentity = level.getBlockEntity(pos, false); // CraftBukkit - don't validate, type may be changed already + +- if (blockentity instanceof LecternBlockEntity) { +- LecternBlockEntity lecternblockentity = (LecternBlockEntity) blockentity; +- Direction direction = (Direction) blockstate.getValue(LecternBlock.FACING); +- ItemStack itemstack = lecternblockentity.getBook().copy(); +- float f = 0.25F * (float) direction.getStepX(); +- float f1 = 0.25F * (float) direction.getStepZ(); +- ItemEntity itementity = new ItemEntity(level, (double) blockpos.getX() + 0.5D + (double) f, (double) (blockpos.getY() + 1), (double) blockpos.getZ() + 0.5D + (double) f1, itemstack); ++ if (tileentity instanceof LecternBlockEntity) { ++ LecternBlockEntity tileentitylectern = (LecternBlockEntity) tileentity; ++ Direction enumdirection = (Direction) state.getValue(LecternBlock.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(); ++ ItemEntity entityitem = new ItemEntity(level, (double) pos.getX() + 0.5D + (double) f, (double) (pos.getY() + 1), (double) pos.getZ() + 0.5D + (double) f1, itemstack); + + itementity.setDefaultPickUpDelay(); + level.addFreshEntity(itementity); |