robinjam / keep-items

Bukkit plugin allowing players to keep their items and experience when they die
http://dev.bukkit.org/server-mods/keep-items
GNU General Public License v3.0
1 stars 7 forks source link

Incompatibility between KeepItems and commands that directly kill players #5

Closed robinjam closed 12 years ago

robinjam commented 12 years ago

Commands that directly kill players (such as CommandBook's /slay command) cause a NullPointerException:

03:03:29 [SEVERE] Could not pass event PlayerDeathEvent to KeepItems
java.lang.NullPointerException
        at net.robinjam.bukkit.keepitems.KeepItems.onEntityDeath(KeepItems.java:92)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:301)
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:461)
        at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerDeathEvent(CraftEventFactory.java:322)
        at net.minecraft.server.EntityPlayer.die(EntityPlayer.java:173)
        at org.bukkit.craftbukkit.entity.CraftLivingEntity.setHealth(CraftLivingEntity.java:59)
        at com.sk89q.commandbook.PlayerComponent$Commands.slay(PlayerComponent.java:200)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at com.sk89q.minecraft.util.commands.CommandsManager.invokeMethod(CommandsManager.java:522)
        at com.sk89q.minecraft.util.commands.CommandsManager.executeMethod(CommandsManager.java:509)
        at com.sk89q.minecraft.util.commands.CommandsManager.execute(CommandsManager.java:409)
        at com.zachsthings.libcomponents.bukkit.BukkitComponent.onCommand(BukkitComponent.java:80)
        at com.sk89q.bukkit.util.DynamicPluginCommand.execute(DynamicPluginCommand.java:52)
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:166)
        at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:642)
        at org.bukkit.craftbukkit.CraftServer.dispatchServerCommand(CraftServer.java:638)
        at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:674)
        at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:643)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:506)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:492)