/*
 * This file is part of Sponge, licensed under the MIT License (MIT).
 *
 * Copyright (c) SpongePowered.org <http://www.spongepowered.org>
 * Copyright (c) contributors
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
package org.spongepowered.mod.mixin.entity.living.monster;

import net.minecraft.entity.monster.EntityMob;
import net.minecraft.entity.monster.EntityZombie;
import net.minecraft.world.World;

import org.spongepowered.api.entity.living.monster.Zombie;
import org.spongepowered.api.util.annotation.NonnullByDefault;
import org.spongepowered.asm.mixin.Implements;
import org.spongepowered.asm.mixin.Interface;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;

@NonnullByDefault
@Mixin(EntityZombie.class)
@Implements(@Interface(iface = Zombie.class, prefix = "zombie$"))
public abstract class MixinEntityZombie extends EntityMob {

    @Shadow
    public abstract boolean isVillager();

    @Shadow
    public abstract void setVillager(boolean villagerZombie);

    public MixinEntityZombie(World worldIn) {
        super(worldIn);
    }

   public boolean zombie$isVillagerZombie() {
       return this.isVillager();
   }

   public void zombie$setVillagerZombie(boolean villagerZombie) {
       this.setVillager(villagerZombie);
   }
}

@@ -1304,16 +1304,70 @@
 nster;%0A%0A
+import net.minecraft.entity.ai.attributes.IAttribute;%0A
 import n
@@ -1963,16 +1963,72 @@
 yMob %7B%0A%0A
+    @Shadow private static IAttribute field_110186_bp;%0A%0A
     @Sha
@@ -2145,24 +2145,215 @@
 erZombie);%0A%0A
+    @Shadow%0A    public abstract boolean isChild();%0A%0A    @Shadow%0A    public abstract void setChild(boolean childZombie);%0A%0A    @Shadow%0A    public abstract void func_146071_k(boolean isChild);%0A%0A
     public M
@@ -2416,24 +2416,25 @@
 ;%0A    %7D%0A%0A   
+ 
 public boole
@@ -2471,16 +2471,17 @@
 %0A       
+ 
 return t
@@ -2501,19 +2501,21 @@
 r();%0A   
+ 
 %7D%0A%0A
+ 
    publi
@@ -2579,16 +2579,17 @@
 %0A       
+ 
 this.set
@@ -2614,15 +2614,722 @@
 ombie);%0A
+    %7D%0A%0A    public void zombie$setAge(int age) %7B%0A        this.setChild(age %3C 0);%0A    %7D%0A%0A    public void zombie$setBaby() %7B%0A        this.setChild(true);%0A    %7D%0A%0A    public void zombie$setAdult() %7B%0A        this.setChild(false);%0A    %7D%0A%0A    public boolean zombie$isBaby() %7B%0A        return this.isChild();%0A    %7D%0A%0A    public boolean zombie$canBreed() %7B%0A        return this.getEntityAttribute(field_110186_bp).getAttributeValue() %3E 0;%0A    %7D%0A%0A    public void zombie$setBreeding(boolean breeding) %7B%0A        this.getEntityAttribute(field_110186_bp).setBaseValue(breeding ? this.rand.nextDouble() * 0.10000000149011612D : 0);%0A    %7D%0A%0A    public void zombie$setScaleForAge() %7B%0A        this.func_146071_k(this.isChild());%0A 
    %7D%0A%7D%0A

Implement Ageable methods into Zombie. Fixes #168