mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 15:30:19 +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
1 changed files with 7 additions and 5 deletions
|
@ -66,7 +66,7 @@
|
||||||
@Override
|
@Override
|
||||||
public int getSize() {
|
public int getSize() {
|
||||||
return 1;
|
return 1;
|
||||||
@@ -49,11 +102,18 @@
|
@@ -49,11 +102,20 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -75,9 +75,11 @@
|
||||||
+ public void setItem(int i, ItemStack itemstack) {
|
+ public void setItem(int i, ItemStack itemstack) {
|
||||||
+ if (i == 0) {
|
+ if (i == 0) {
|
||||||
+ TileEntityLectern.this.setBook(itemstack);
|
+ TileEntityLectern.this.setBook(itemstack);
|
||||||
|
+ if (TileEntityLectern.this.getWorld() != null) {
|
||||||
+ BlockLectern.setHasBook(TileEntityLectern.this.getWorld(), TileEntityLectern.this.getPosition(), TileEntityLectern.this.getBlock(), TileEntityLectern.this.hasBook());
|
+ BlockLectern.setHasBook(TileEntityLectern.this.getWorld(), TileEntityLectern.this.getPosition(), TileEntityLectern.this.getBlock(), TileEntityLectern.this.hasBook());
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
|
+ }
|
||||||
+ // CraftBukkit end
|
+ // CraftBukkit end
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -87,7 +89,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -158,6 +218,32 @@
|
@@ -158,6 +220,32 @@
|
||||||
return itemstack;
|
return itemstack;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -120,7 +122,7 @@
|
||||||
private CommandListenerWrapper a(@Nullable EntityHuman entityhuman) {
|
private CommandListenerWrapper a(@Nullable EntityHuman entityhuman) {
|
||||||
String s;
|
String s;
|
||||||
Object object;
|
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);
|
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
|
@Override
|
||||||
@@ -211,7 +298,7 @@
|
@@ -211,7 +300,7 @@
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Container createMenu(int i, PlayerInventory playerinventory, EntityHuman entityhuman) {
|
public Container createMenu(int i, PlayerInventory playerinventory, EntityHuman entityhuman) {
|
||||||
|
|
Loading…
Reference in a new issue