From 90d6fbde482364cd78d3a77e896ac1d2ddbb6e16 Mon Sep 17 00:00:00 2001 From: GJ Date: Tue, 2 Apr 2013 21:24:02 -0400 Subject: [PATCH] Fix ClassCastException with Taming. Fixes #924 --- Changelog.txt | 1 + src/main/java/com/gmail/nossr50/listeners/EntityListener.java | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Changelog.txt b/Changelog.txt index 5d7bae3de..f2e440545 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -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 diff --git a/src/main/java/com/gmail/nossr50/listeners/EntityListener.java b/src/main/java/com/gmail/nossr50/listeners/EntityListener.java index c8a94b6cc..7e53c04b0 100644 --- a/src/main/java/com/gmail/nossr50/listeners/EntityListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/EntityListener.java @@ -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; } }