package main.flowstoneenergy.entities;

import io.netty.buffer.ByteBuf;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityAgeable;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.passive.EntityAnimal;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World;
import cpw.mods.fml.common.registry.IEntityAdditionalSpawnData;

public class EntityRobot extends EntityAnimal implements IEntityAdditionalSpawnData {

    private boolean charged;

    public EntityRobot(World world) {
        super(world);
        setSize(1.5F, 0.6F);
    }

    public boolean isCharged() {
        return charged;
    }

    public void setCharged() {
        charged = true;
    }
    
    @Override
    protected void applyEntityAttributes()
    {
        super.applyEntityAttributes();
        this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(8.0D);
        this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.7D);
    }

    @Override
    public AxisAlignedBB getBoundingBox() {
        return boundingBox;
    }

    @Override
    public AxisAlignedBB getCollisionBox(Entity entity) {
        if (entity != riddenByEntity)
            return entity.boundingBox;
        else
            return null;
    }

    @Override
    public double getMountedYOffset() {
        return -0.015;
    }

    @Override
    public void onUpdate() {
        super.onUpdate();

        if (!worldObj.isRemote) {
            if (riddenByEntity != null) {
                motionY = 0.2;
            } else if (worldObj.isAirBlock((int) posX, (int) posY - 1, (int) posZ)) {
                motionY = -0.1;
            } else {
                motionY = 0;
            }
        }
        setPosition(posX + motionX, posY + motionY, posZ + motionZ);
    }

    @Override
    public boolean canBeCollidedWith() {
        return !isDead;
    }

    @Override
    protected void entityInit() {

    }

    @Override
	public void readEntityFromNBT(NBTTagCompound nbt) {
        charged = nbt.getBoolean("Charged");
    }

    @Override
	public void writeEntityToNBT(NBTTagCompound nbt) {
        nbt.setBoolean("Charged", charged);
    }

    @Override
    public void writeSpawnData(ByteBuf data) {
        data.writeBoolean(charged);
    }

    @Override
    public void readSpawnData(ByteBuf data) {
        charged = data.readBoolean();
    }

	@Override
	public EntityAgeable createChild(EntityAgeable var1) {
		return null;
	}

}

@@ -37,40 +37,8 @@
 s;%0A%0A
-import io.netty.buffer.ByteBuf;%0A
 impo
@@ -103,22 +103,23 @@
 y.Entity
-Ageabl
+Creatur
 e;%0Aimpor
@@ -198,28 +198,20 @@
 ity.
-passive.EntityAnimal
+monster.IMob
 ;%0Aim
@@ -327,72 +327,8 @@
 rld;
-%0Aimport cpw.mods.fml.common.registry.IEntityAdditionalSpawnData;
 %0A%0Apu
@@ -368,14 +368,16 @@
 tity
-Animal
+Creature
  imp
@@ -389,33 +389,11 @@
 ts I
-EntityAdditionalSpawnData
+Mob
  %7B%0A%0A
@@ -478,24 +478,47 @@
 per(world);%0A
+        setHealth(20);%0A
         setS
@@ -523,17 +523,17 @@
 tSize(1.
-5
+0
 F, 0.6F)
@@ -1401,382 +1401,11 @@
 e();
-%0A%0A        if (!worldObj.isRemote) %7B%0A            if (riddenByEntity != null) %7B%0A                motionY = 0.2;%0A            %7D else if (worldObj.isAirBlock((int) posX, (int) posY - 1, (int) posZ)) %7B%0A                motionY = -0.1;%0A            %7D else %7B%0A                motionY = 0;%0A            %7D%0A        %7D%0A        setPosition(posX + motionX, posY + motionY, posZ + motionZ);%0A    
+%09%0A%09
 %7D%0A%0A 
@@ -1493,64 +1493,8 @@
  %7D%0A%0A
-    @Override%0A    protected void entityInit() %7B%0A%0A    %7D%0A%0A
     
@@ -1728,302 +1728,6 @@
   %7D%0A
-%0A    @Override%0A    public void writeSpawnData(ByteBuf data) %7B%0A        data.writeBoolean(charged);%0A    %7D%0A%0A    @Override%0A    public void readSpawnData(ByteBuf data) %7B%0A        charged = data.readBoolean();%0A    %7D%0A%0A%09@Override%0A%09public EntityAgeable createChild(EntityAgeable var1) %7B%0A%09%09return null;%0A%09%7D%0A%0A
 %7D%0A

Update EntityRobot.java