mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-22 17:07:34 +01:00
SPIGOT-5199: Fix NPE if setting the book of the ItemMeta of a lectern
This commit is contained in:
parent
b0ef3996ed
commit
db97147724
@ -66,7 +66,7 @@
|
||||
@Override
|
||||
public int getSize() {
|
||||
return 1;
|
||||
@@ -49,11 +102,18 @@
|
||||
@@ -49,11 +102,20 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -75,7 +75,9 @@
|
||||
+ public void setItem(int i, ItemStack itemstack) {
|
||||
+ if (i == 0) {
|
||||
+ TileEntityLectern.this.setBook(itemstack);
|
||||
+ BlockLectern.setHasBook(TileEntityLectern.this.getWorld(), TileEntityLectern.this.getPosition(), TileEntityLectern.this.getBlock(), TileEntityLectern.this.hasBook());
|
||||
+ if (TileEntityLectern.this.getWorld() != null) {
|
||||
+ BlockLectern.setHasBook(TileEntityLectern.this.getWorld(), TileEntityLectern.this.getPosition(), TileEntityLectern.this.getBlock(), TileEntityLectern.this.hasBook());
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
@ -87,7 +89,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -158,6 +218,32 @@
|
||||
@@ -158,6 +220,32 @@
|
||||
return itemstack;
|
||||
}
|
||||
|
||||
@ -120,7 +122,7 @@
|
||||
private CommandListenerWrapper a(@Nullable EntityHuman entityhuman) {
|
||||
String s;
|
||||
Object object;
|
||||
@@ -172,7 +258,8 @@
|
||||
@@ -172,7 +260,8 @@
|
||||
|
||||
Vec3D vec3d = new Vec3D((double) this.position.getX() + 0.5D, (double) this.position.getY() + 0.5D, (double) this.position.getZ() + 0.5D);
|
||||
|
||||
@ -130,7 +132,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -211,7 +298,7 @@
|
||||
@@ -211,7 +300,7 @@
|
||||
|
||||
@Override
|
||||
public Container createMenu(int i, PlayerInventory playerinventory, EntityHuman entityhuman) {
|
||||
|
Loading…
Reference in New Issue
Block a user