Fix ClassCastException with Taming. Fixes #924

This commit is contained in:
GJ 2013-04-02 21:24:02 -04:00
parent 802ad84613
commit 90d6fbde48
2 changed files with 3 additions and 1 deletions

View File

@ -18,6 +18,7 @@ Version 1.4.05-dev
= Fixed Berserk misbehaving when /reload was used
= Fixed parties misbehaving when /reload was used
= Fixed Berserk getting "stuck" when /mcrefresh was used
= Fix ClassCastException with Taming
Version 1.4.04
+ Added functions to ExperienceAPI for use with offline players

View File

@ -1,5 +1,6 @@
package com.gmail.nossr50.listeners;
import org.bukkit.OfflinePlayer;
import org.bukkit.block.Block;
import org.bukkit.entity.AnimalTamer;
import org.bukkit.entity.Entity;
@ -106,7 +107,7 @@ public class EntityListener implements Listener {
else if (attacker instanceof Tameable) {
AnimalTamer animalTamer = ((Tameable) attacker).getOwner();
if (animalTamer != null) {
if (animalTamer != null && ((OfflinePlayer) animalTamer).isOnline()) {
attacker = (Entity) animalTamer;
}
}