mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-09 20:30:28 +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) {
|
public boolean b(Block block) {
|
||||||
if (block.material.k()) {
|
if (block != null && block.material.k()) { // CraftBukkit - fix NPE
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
ItemStack itemstack = this.getItem(this.itemInHandIndex);
|
ItemStack itemstack = this.getItem(this.itemInHandIndex);
|
||||||
|
@ -596,7 +596,7 @@ public final class CraftServer implements Server {
|
|||||||
}
|
}
|
||||||
|
|
||||||
WorldUnloadEvent e = new WorldUnloadEvent(handle.getWorld());
|
WorldUnloadEvent e = new WorldUnloadEvent(handle.getWorld());
|
||||||
pluginManager.callEvent(new WorldUnloadEvent(handle.getWorld()));
|
pluginManager.callEvent(e);
|
||||||
|
|
||||||
if (e.isCancelled()) {
|
if (e.isCancelled()) {
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user