mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-26 10:57:47 +01:00
Fixed NPE in player inventory + don't ignore the cancel state of world unloads
This commit is contained in:
parent
a7664a104f
commit
e31cedf583
@ -312,7 +312,7 @@ public class InventoryPlayer implements IInventory {
|
||||
}
|
||||
|
||||
public boolean b(Block block) {
|
||||
if (block.material.k()) {
|
||||
if (block != null && block.material.k()) { // CraftBukkit - fix NPE
|
||||
return true;
|
||||
} else {
|
||||
ItemStack itemstack = this.getItem(this.itemInHandIndex);
|
||||
|
@ -596,7 +596,7 @@ public final class CraftServer implements Server {
|
||||
}
|
||||
|
||||
WorldUnloadEvent e = new WorldUnloadEvent(handle.getWorld());
|
||||
pluginManager.callEvent(new WorldUnloadEvent(handle.getWorld()));
|
||||
pluginManager.callEvent(e);
|
||||
|
||||
if (e.isCancelled()) {
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user