Fixed NPE in player inventory + don't ignore the cancel state of world unloads

This commit is contained in:
Nathan Adams 2011-11-24 20:27:16 +00:00
parent a7664a104f
commit e31cedf583
2 changed files with 2 additions and 2 deletions

View File

@ -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);

View File

@ -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;