Fix persistence on tamed pets. Fixes BUKKIT-3300

With the persistence api introduced, pets did not have their
persistence flag updated to reflect their persistence. This caused
tame ocelots to not persist under specific conditions.

By: feildmaster <admin@feildmaster.com>
This commit is contained in:
CraftBukkit/Spigot 2012-12-28 20:27:41 -06:00
parent 2d0ea62fb2
commit be291480fc

View file

@ -236,6 +236,8 @@ public class CraftEventFactory {
org.bukkit.entity.AnimalTamer bukkitTamer = (tamer != null ? (AnimalTamer) tamer.getBukkitEntity() : null);
CraftServer craftServer = (CraftServer) bukkitEntity.getServer();
entity.persistent = true;
EntityTameEvent event = new EntityTameEvent((LivingEntity) bukkitEntity, bukkitTamer);
craftServer.getPluginManager().callEvent(event);
return event;