mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-08 03:22:19 +01:00
SPIGOT-7381: Fix NullPointerException when setting item in ChiseledBookshelfInventory snapshot
By: Parker Hawke <hawkeboyz2@hotmail.com>
This commit is contained in:
parent
f800a3801e
commit
4c192dd4e7
1 changed files with 9 additions and 0 deletions
|
@ -55,6 +55,15 @@
|
|||
|
||||
public ChiseledBookShelfBlockEntity(BlockPosition blockposition, IBlockData iblockdata) {
|
||||
super(TileEntityTypes.CHISELED_BOOKSHELF, blockposition, iblockdata);
|
||||
@@ -106,7 +148,7 @@
|
||||
public void setItem(int i, ItemStack itemstack) {
|
||||
if (itemstack.is(TagsItem.BOOKSHELF_BOOKS)) {
|
||||
this.items.set(i, itemstack);
|
||||
- this.updateState(i);
|
||||
+ if (level != null) this.updateState(i); // CraftBukkit - SPIGOT-7381: check for null world
|
||||
}
|
||||
|
||||
}
|
||||
@@ -120,7 +162,7 @@
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue