mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-22 02:25:28 +01:00
SPIGOT-5650: Lectern.setPage(int) causes a NullPointerException
This commit is contained in:
parent
3075579f61
commit
bbe3d58efc
@ -89,6 +89,15 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -135,7 +197,7 @@
|
||||
if (j != this.page) {
|
||||
this.page = j;
|
||||
this.update();
|
||||
- BlockLectern.a(this.getWorld(), this.getPosition(), this.getBlock());
|
||||
+ if (this.world != null) BlockLectern.a(this.getWorld(), this.getPosition(), this.getBlock()); // CraftBukkit
|
||||
}
|
||||
|
||||
}
|
||||
@@ -158,6 +220,32 @@
|
||||
return itemstack;
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package org.bukkit.craftbukkit.block;
|
||||
|
||||
import net.minecraft.server.BlockLectern;
|
||||
import net.minecraft.server.TileEntityLectern;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
@ -40,4 +41,15 @@ public class CraftLectern extends CraftBlockEntityState<TileEntityLectern> imple
|
||||
|
||||
return new CraftInventoryLectern(this.getTileEntity().inventory);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean update(boolean force, boolean applyPhysics) {
|
||||
boolean result = super.update(force, applyPhysics);
|
||||
|
||||
if (result && this.isPlaced() && this.getType() == Material.LECTERN) {
|
||||
BlockLectern.a(this.world.getHandle(), this.getPosition(), this.getHandle());
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user