Performance Commit --Too lazy to do the Altar recipe

This commit is contained in:
Arcaratus 2015-07-02 11:05:07 -04:00
parent 013367cffa
commit e5b795fddc
217 changed files with 840 additions and 1244 deletions

View file

@ -18,14 +18,11 @@ import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.pathfinding.PathEntity;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
public class EntityBileDemon extends EntityDemon
{
private EntityAIAttackOnCollide aiAttackOnCollide = new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.2D, false);
private static float maxTamedHealth = 100.0F;
private static float maxUntamedHealth = 200.0F;
private int attackTimer;
@ -59,10 +56,10 @@ public class EntityBileDemon extends EntityDemon
//My guess is that this will alter the max health
if (this.isTamed())
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxTamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxTamedHealth);
} else
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxUntamedHealth);
}
//this.func_110148_a(SharedMonsterAttributes.field_111267_a).func_111128_a(10.0D);
@ -97,14 +94,14 @@ public class EntityBileDemon extends EntityDemon
*/
protected void updateAITick()
{
this.dataWatcher.updateObject(18, Float.valueOf(this.getHealth()));
this.dataWatcher.updateObject(18, this.getHealth());
}
protected void entityInit()
{
super.entityInit();
this.dataWatcher.addObject(18, new Float(this.getHealth()));
this.dataWatcher.addObject(19, new Byte((byte) 0));
this.dataWatcher.addObject(18, this.getHealth());
this.dataWatcher.addObject(19, 0);
//this.dataWatcher.addObject(20, new Byte((byte) BlockColored.getBlockFromDye(1)));
}
@ -261,10 +258,10 @@ public class EntityBileDemon extends EntityDemon
if (par1)
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxTamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxTamedHealth);
} else
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxUntamedHealth);
}
}
@ -284,7 +281,7 @@ public class EntityBileDemon extends EntityDemon
{
ItemFood itemfood = (ItemFood) itemstack.getItem();
if (itemfood.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < this.maxTamedHealth)
if (itemfood.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < maxTamedHealth)
{
if (!par1EntityPlayer.capabilities.isCreativeMode)
{
@ -295,7 +292,7 @@ public class EntityBileDemon extends EntityDemon
if (itemstack.stackSize <= 0)
{
par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack) null);
par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, null);
}
return true;
@ -309,9 +306,9 @@ public class EntityBileDemon extends EntityDemon
{
this.aiSit.setSitting(!this.isSitting());
this.isJumping = false;
this.setPathToEntity((PathEntity) null);
this.setTarget((Entity) null);
this.setAttackTarget((EntityLivingBase) null);
this.setPathToEntity(null);
this.setTarget(null);
this.setAttackTarget(null);
}
this.sendSittingMessageToPlayer(par1EntityPlayer, !this.isSitting());
@ -333,10 +330,10 @@ public class EntityBileDemon extends EntityDemon
if (this.rand.nextInt(1) == 0)
{
this.setTamed(true);
this.setPathToEntity((PathEntity) null);
this.setAttackTarget((EntityLivingBase) null);
this.setPathToEntity(null);
this.setAttackTarget(null);
this.aiSit.setSitting(true);
this.setHealth(this.maxTamedHealth);
this.setHealth(maxTamedHealth);
this.func_152115_b(par1EntityPlayer.getUniqueID().toString());
this.playTameEffect(true);
this.worldObj.setEntityState(this, (byte) 7);
@ -379,10 +376,10 @@ public class EntityBileDemon extends EntityDemon
if (par1)
{
this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 | 2)));
this.dataWatcher.updateObject(16, b0 | 2);
} else
{
this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 & -3)));
this.dataWatcher.updateObject(16, b0 & -3);
}
}
@ -399,7 +396,7 @@ public class EntityBileDemon extends EntityDemon
*/
public void setCollarColor(int par1)
{
this.dataWatcher.updateObject(20, Byte.valueOf((byte) (par1 & 15)));
this.dataWatcher.updateObject(20, par1 & 15);
}
/**
@ -414,10 +411,10 @@ public class EntityBileDemon extends EntityDemon
{
if (par1)
{
this.dataWatcher.updateObject(19, Byte.valueOf((byte) 1));
this.dataWatcher.updateObject(19, 1);
} else
{
this.dataWatcher.updateObject(19, Byte.valueOf((byte) 0));
this.dataWatcher.updateObject(19, 0);
}
}

View file

@ -20,7 +20,6 @@ import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.pathfinding.PathEntity;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
@ -67,10 +66,10 @@ public class EntityBoulderFist extends EntityDemon
//My guess is that this will alter the max health
if (this.isTamed())
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxTamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxTamedHealth);
} else
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxUntamedHealth);
}
}
@ -103,14 +102,14 @@ public class EntityBoulderFist extends EntityDemon
*/
protected void updateAITick()
{
this.dataWatcher.updateObject(18, Float.valueOf(this.getHealth()));
this.dataWatcher.updateObject(18, this.getHealth());
}
protected void entityInit()
{
super.entityInit();
this.dataWatcher.addObject(18, new Float(this.getHealth()));
this.dataWatcher.addObject(19, new Byte((byte) 0));
this.dataWatcher.addObject(18, this.getHealth());
this.dataWatcher.addObject(19, 0);
}
/**
@ -247,10 +246,10 @@ public class EntityBoulderFist extends EntityDemon
if (par1)
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxTamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxTamedHealth);
} else
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxUntamedHealth);
}
}
@ -270,7 +269,7 @@ public class EntityBoulderFist extends EntityDemon
{
ItemFood itemfood = (ItemFood) itemstack.getItem();
if (itemfood.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < this.maxTamedHealth)
if (itemfood.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < maxTamedHealth)
{
if (!par1EntityPlayer.capabilities.isCreativeMode)
{
@ -281,7 +280,7 @@ public class EntityBoulderFist extends EntityDemon
if (itemstack.stackSize <= 0)
{
par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack) null);
par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, null);
}
return true;
@ -295,9 +294,9 @@ public class EntityBoulderFist extends EntityDemon
{
this.aiSit.setSitting(!this.isSitting());
this.isJumping = false;
this.setPathToEntity((PathEntity) null);
this.setTarget((Entity) null);
this.setAttackTarget((EntityLivingBase) null);
this.setPathToEntity(null);
this.setTarget(null);
this.setAttackTarget(null);
}
this.sendSittingMessageToPlayer(par1EntityPlayer, !this.isSitting());
@ -319,10 +318,10 @@ public class EntityBoulderFist extends EntityDemon
if (this.rand.nextInt(1) == 0)
{
this.setTamed(true);
this.setPathToEntity((PathEntity) null);
this.setAttackTarget((EntityLivingBase) null);
this.setPathToEntity(null);
this.setAttackTarget(null);
this.aiSit.setSitting(true);
this.setHealth(this.maxTamedHealth);
this.setHealth(maxTamedHealth);
this.func_152115_b(par1EntityPlayer.getUniqueID().toString());
this.playTameEffect(true);
this.worldObj.setEntityState(this, (byte) 7);
@ -366,10 +365,10 @@ public class EntityBoulderFist extends EntityDemon
if (par1)
{
this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 | 2)));
this.dataWatcher.updateObject(16, b0 | 2);
} else
{
this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 & -3)));
this.dataWatcher.updateObject(16, b0 & -3);
}
}
@ -386,7 +385,7 @@ public class EntityBoulderFist extends EntityDemon
*/
public void setCollarColor(int par1)
{
this.dataWatcher.updateObject(20, Byte.valueOf((byte) (par1 & 15)));
this.dataWatcher.updateObject(20, par1 & 15);
}
/**
@ -401,10 +400,10 @@ public class EntityBoulderFist extends EntityDemon
{
if (par1)
{
this.dataWatcher.updateObject(19, Byte.valueOf((byte) 1));
this.dataWatcher.updateObject(19, 1);
} else
{
this.dataWatcher.updateObject(19, Byte.valueOf((byte) 0));
this.dataWatcher.updateObject(19, 0);
}
}
@ -461,9 +460,6 @@ public class EntityBoulderFist extends EntityDemon
*/
public void attackEntityWithRangedAttack(EntityLivingBase par1EntityLivingBase, float par2)
{
double xCoord;
double yCoord;
double zCoord;
HolyProjectile hol = new HolyProjectile(worldObj, this, par1EntityLivingBase, 1.8f, 0f, 5, 600);
this.worldObj.spawnEntityInWorld(hol);
}
@ -475,7 +471,6 @@ public class EntityBoulderFist extends EntityDemon
{
this.tasks.removeTask(this.aiAttackOnCollide);
//this.tasks.removeTask(this.aiArrowAttack);
ItemStack itemstack = this.getHeldItem();
this.tasks.addTask(4, this.aiAttackOnCollide);
}
}

View file

@ -20,7 +20,7 @@ public class EntityEarthElemental extends EntityElemental implements IMob
{
if (target instanceof EntityLivingBase)
{
((EntityLivingBase) target).attackEntityFrom(DamageSource.causeMobDamage(this), 10);
target.attackEntityFrom(DamageSource.causeMobDamage(this), 10);
((EntityLivingBase) target).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 100, 4));
((EntityLivingBase) target).addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionInhibit.id, 150, 0));
}

View file

@ -135,15 +135,6 @@ public class EntityElemental extends EntityDemon
this.motionY *= (double) f2;
this.motionZ *= (double) f2;
}
double d0 = this.posX - this.prevPosX;
double d1 = this.posZ - this.prevPosZ;
float f4 = MathHelper.sqrt_double(d0 * d0 + d1 * d1) * 4.0F;
if (f4 > 1.0F)
{
f4 = 1.0F;
}
}
/**
@ -251,7 +242,7 @@ public class EntityElemental extends EntityDemon
if (this.attackCounter >= 10)
{
this.worldObj.playAuxSFXAtEntity((EntityPlayer) null, 1008, (int) this.posX, (int) this.posY, (int) this.posZ, 0);
this.worldObj.playAuxSFXAtEntity(null, 1008, (int) this.posX, (int) this.posY, (int) this.posZ, 0);
this.inflictEffectOnEntity(this.targetedEntity);
this.attackCounter = -40;
}
@ -262,7 +253,7 @@ public class EntityElemental extends EntityDemon
}
} else
{
this.renderYawOffset = this.rotationYaw = -((float) Math.atan2(this.motionX, this.motionZ)) * 180.0F / (float) Math.PI;
this.renderYawOffset = this.rotationYaw = -((float) Math.atan2(motionX, this.motionZ)) * 180.0F / (float) Math.PI;
if (this.attackCounter > 0)
{
@ -277,7 +268,7 @@ public class EntityElemental extends EntityDemon
if (b0 != b1)
{
this.dataWatcher.updateObject(25, Byte.valueOf(b1));
this.dataWatcher.updateObject(25, b1);
}
}
}
@ -342,10 +333,10 @@ public class EntityElemental extends EntityDemon
//My guess is that this will alter the max health
if (this.isTamed())
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxTamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxTamedHealth);
} else
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxUntamedHealth);
}
}
@ -378,15 +369,15 @@ public class EntityElemental extends EntityDemon
*/
protected void updateAITick()
{
this.dataWatcher.updateObject(18, Float.valueOf(this.getHealth()));
this.dataWatcher.updateObject(18, this.getHealth());
}
protected void entityInit()
{
super.entityInit();
this.dataWatcher.addObject(18, new Float(this.getHealth()));
this.dataWatcher.addObject(19, new Byte((byte) 0));
this.dataWatcher.addObject(25, Byte.valueOf((byte) 0));
this.dataWatcher.addObject(18, this.getHealth());
this.dataWatcher.addObject(19, 0);
this.dataWatcher.addObject(25, 0);
}
/**
@ -503,10 +494,10 @@ public class EntityElemental extends EntityDemon
if (par1)
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxTamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxTamedHealth);
} else
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxUntamedHealth);
}
}
@ -540,10 +531,10 @@ public class EntityElemental extends EntityDemon
if (par1)
{
this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 | 2)));
this.dataWatcher.updateObject(16, b0 | 2);
} else
{
this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 & -3)));
this.dataWatcher.updateObject(16, b0 & -3);
}
}
@ -551,10 +542,10 @@ public class EntityElemental extends EntityDemon
{
if (par1)
{
this.dataWatcher.updateObject(19, Byte.valueOf((byte) 1));
this.dataWatcher.updateObject(19, 1);
} else
{
this.dataWatcher.updateObject(19, Byte.valueOf((byte) 0));
this.dataWatcher.updateObject(19, 0);
}
}
@ -608,7 +599,6 @@ public class EntityElemental extends EntityDemon
public void setCombatTask()
{
this.tasks.removeTask(this.aiAttackOnCollide);
ItemStack itemstack = this.getHeldItem();
this.tasks.addTask(4, this.aiAttackOnCollide);
}

View file

@ -17,7 +17,6 @@ import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.pathfinding.PathEntity;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
@ -65,10 +64,10 @@ public class EntityFallenAngel extends EntityDemon implements IRangedAttackMob
//My guess is that this will alter the max health
if (this.isTamed())
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxTamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxTamedHealth);
} else
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxUntamedHealth);
}
}
@ -101,14 +100,14 @@ public class EntityFallenAngel extends EntityDemon implements IRangedAttackMob
*/
protected void updateAITick()
{
this.dataWatcher.updateObject(18, Float.valueOf(this.getHealth()));
this.dataWatcher.updateObject(18, this.getHealth());
}
protected void entityInit()
{
super.entityInit();
this.dataWatcher.addObject(18, new Float(this.getHealth()));
this.dataWatcher.addObject(19, new Byte((byte) 0));
this.dataWatcher.addObject(18, this.getHealth());
this.dataWatcher.addObject(19, 0);
}
/**
@ -245,10 +244,10 @@ public class EntityFallenAngel extends EntityDemon implements IRangedAttackMob
if (par1)
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxTamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxTamedHealth);
} else
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxUntamedHealth);
}
}
@ -268,7 +267,7 @@ public class EntityFallenAngel extends EntityDemon implements IRangedAttackMob
{
ItemFood itemfood = (ItemFood) itemstack.getItem();
if (itemfood.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < this.maxTamedHealth)
if (itemfood.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < maxTamedHealth)
{
if (!par1EntityPlayer.capabilities.isCreativeMode)
{
@ -293,9 +292,9 @@ public class EntityFallenAngel extends EntityDemon implements IRangedAttackMob
{
this.aiSit.setSitting(!this.isSitting());
this.isJumping = false;
this.setPathToEntity((PathEntity) null);
this.setTarget((Entity) null);
this.setAttackTarget((EntityLivingBase) null);
this.setPathToEntity(null);
this.setTarget(null);
this.setAttackTarget(null);
}
this.sendSittingMessageToPlayer(par1EntityPlayer, !this.isSitting());
@ -317,10 +316,10 @@ public class EntityFallenAngel extends EntityDemon implements IRangedAttackMob
if (this.rand.nextInt(1) == 0)
{
this.setTamed(true);
this.setPathToEntity((PathEntity) null);
this.setAttackTarget((EntityLivingBase) null);
this.setPathToEntity(null);
this.setAttackTarget(null);
this.aiSit.setSitting(true);
this.setHealth(this.maxTamedHealth);
this.setHealth(maxTamedHealth);
this.func_152115_b(par1EntityPlayer.getUniqueID().toString());
this.playTameEffect(true);
this.worldObj.setEntityState(this, (byte) 7);
@ -365,10 +364,10 @@ public class EntityFallenAngel extends EntityDemon implements IRangedAttackMob
if (par1)
{
this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 | 2)));
this.dataWatcher.updateObject(16, b0 | 2);
} else
{
this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 & -3)));
this.dataWatcher.updateObject(16, b0 & -3);
}
}
@ -385,7 +384,7 @@ public class EntityFallenAngel extends EntityDemon implements IRangedAttackMob
*/
public void setCollarColor(int par1)
{
this.dataWatcher.updateObject(20, Byte.valueOf((byte) (par1 & 15)));
this.dataWatcher.updateObject(20, par1 & 15);
}
/**
@ -400,10 +399,10 @@ public class EntityFallenAngel extends EntityDemon implements IRangedAttackMob
{
if (par1)
{
this.dataWatcher.updateObject(19, Byte.valueOf((byte) 1));
this.dataWatcher.updateObject(19, 1);
} else
{
this.dataWatcher.updateObject(19, Byte.valueOf((byte) 0));
this.dataWatcher.updateObject(19, 0);
}
}
@ -460,9 +459,6 @@ public class EntityFallenAngel extends EntityDemon implements IRangedAttackMob
*/
public void attackEntityWithRangedAttack(EntityLivingBase par1EntityLivingBase, float par2)
{
double xCoord;
double yCoord;
double zCoord;
HolyProjectile hol = new HolyProjectile(worldObj, this, par1EntityLivingBase, 1.8f, 0f, 5, 600);
this.worldObj.spawnEntityInWorld(hol);
}
@ -474,7 +470,6 @@ public class EntityFallenAngel extends EntityDemon implements IRangedAttackMob
{
this.tasks.removeTask(this.aiAttackOnCollide);
this.tasks.removeTask(this.aiArrowAttack);
ItemStack itemstack = this.getHeldItem();
this.tasks.addTask(4, this.aiArrowAttack);
}
}

View file

@ -19,7 +19,7 @@ public class EntityFireElemental extends EntityElemental implements IMob
{
if (target instanceof EntityLivingBase)
{
((EntityLivingBase) target).setFire(10);
target.setFire(10);
((EntityLivingBase) target).addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionInhibit.id, 150, 0));
}
}

View file

@ -20,7 +20,7 @@ public class EntityHolyElemental extends EntityElemental implements IMob
{
if (target instanceof EntityLivingBase)
{
((EntityLivingBase) target).attackEntityFrom(DamageSource.causeMobDamage(this), 15);
target.attackEntityFrom(DamageSource.causeMobDamage(this), 15);
((EntityLivingBase) target).addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionInhibit.id, 150, 0));
((EntityLivingBase) target).addPotionEffect(new PotionEffect(Potion.poison.id, 100, 1));
}

View file

@ -63,10 +63,10 @@ public class EntityIceDemon extends EntityDemon implements IRangedAttackMob
//My guess is that this will alter the max health
if (this.isTamed())
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxTamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxTamedHealth);
} else
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxUntamedHealth);
}
}
@ -99,14 +99,14 @@ public class EntityIceDemon extends EntityDemon implements IRangedAttackMob
*/
protected void updateAITick()
{
this.dataWatcher.updateObject(18, Float.valueOf(this.getHealth()));
this.dataWatcher.updateObject(18, this.getHealth());
}
protected void entityInit()
{
super.entityInit();
this.dataWatcher.addObject(18, new Float(this.getHealth()));
this.dataWatcher.addObject(19, new Byte((byte) 0));
this.dataWatcher.addObject(18, this.getHealth());
this.dataWatcher.addObject(19, 0);
}
/**
@ -263,10 +263,10 @@ public class EntityIceDemon extends EntityDemon implements IRangedAttackMob
if (par1)
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxTamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxTamedHealth);
} else
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxUntamedHealth);
}
}
@ -286,7 +286,7 @@ public class EntityIceDemon extends EntityDemon implements IRangedAttackMob
{
ItemFood itemfood = (ItemFood) itemstack.getItem();
if (itemfood.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < this.maxTamedHealth)
if (itemfood.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < maxTamedHealth)
{
if (!par1EntityPlayer.capabilities.isCreativeMode)
{
@ -297,7 +297,7 @@ public class EntityIceDemon extends EntityDemon implements IRangedAttackMob
if (itemstack.stackSize <= 0)
{
par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack) null);
par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, null);
}
return true;
@ -311,9 +311,9 @@ public class EntityIceDemon extends EntityDemon implements IRangedAttackMob
{
this.aiSit.setSitting(!this.isSitting());
this.isJumping = false;
this.setPathToEntity((PathEntity) null);
this.setTarget((Entity) null);
this.setAttackTarget((EntityLivingBase) null);
this.setPathToEntity(null);
this.setTarget(null);
this.setAttackTarget(null);
}
this.sendSittingMessageToPlayer(par1EntityPlayer, !this.isSitting());
@ -327,7 +327,7 @@ public class EntityIceDemon extends EntityDemon implements IRangedAttackMob
if (itemstack.stackSize <= 0)
{
par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack) null);
par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, null);
}
if (!this.worldObj.isRemote)
@ -335,10 +335,10 @@ public class EntityIceDemon extends EntityDemon implements IRangedAttackMob
if (this.rand.nextInt(1) == 0)
{
this.setTamed(true);
this.setPathToEntity((PathEntity) null);
this.setAttackTarget((EntityLivingBase) null);
this.setPathToEntity(null);
this.setAttackTarget(null);
this.aiSit.setSitting(true);
this.setHealth(this.maxTamedHealth);
this.setHealth(maxTamedHealth);
this.func_152115_b(par1EntityPlayer.getUniqueID().toString());
this.playTameEffect(true);
this.worldObj.setEntityState(this, (byte) 7);
@ -382,10 +382,10 @@ public class EntityIceDemon extends EntityDemon implements IRangedAttackMob
if (par1)
{
this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 | 2)));
this.dataWatcher.updateObject(16, b0 | 2);
} else
{
this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 & -3)));
this.dataWatcher.updateObject(16, b0 & -3);
}
}
@ -402,7 +402,7 @@ public class EntityIceDemon extends EntityDemon implements IRangedAttackMob
*/
public void setCollarColor(int par1)
{
this.dataWatcher.updateObject(20, Byte.valueOf((byte) (par1 & 15)));
this.dataWatcher.updateObject(20, par1 & 15);
}
/**
@ -417,10 +417,10 @@ public class EntityIceDemon extends EntityDemon implements IRangedAttackMob
{
if (par1)
{
this.dataWatcher.updateObject(19, Byte.valueOf((byte) 1));
this.dataWatcher.updateObject(19, 1);
} else
{
this.dataWatcher.updateObject(19, Byte.valueOf((byte) 0));
this.dataWatcher.updateObject(19, 0);
}
}
@ -476,9 +476,6 @@ public class EntityIceDemon extends EntityDemon implements IRangedAttackMob
*/
public void attackEntityWithRangedAttack(EntityLivingBase par1EntityLivingBase, float par2)
{
double xCoord;
double yCoord;
double zCoord;
IceProjectile hol = new IceProjectile(worldObj, this, par1EntityLivingBase, 1.8f, 0f, 3, 600);
this.worldObj.spawnEntityInWorld(hol);
}
@ -490,7 +487,6 @@ public class EntityIceDemon extends EntityDemon implements IRangedAttackMob
{
this.tasks.removeTask(this.aiAttackOnCollide);
this.tasks.removeTask(this.aiArrowAttack);
ItemStack itemstack = this.getHeldItem();
this.tasks.addTask(4, this.aiArrowAttack);
}
}

View file

@ -19,18 +19,14 @@ import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.pathfinding.PathEntity;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
public class EntityLowerGuardian extends EntityDemon
{
private EntityAIAttackOnCollide aiAttackOnCollide = new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.2D, false);
private static float maxTamedHealth = 50.0F;
private static float maxUntamedHealth = 30.0F;
private int attackTimer;
private boolean isAggro;
public EntityLowerGuardian(World par1World)
{
@ -63,10 +59,10 @@ public class EntityLowerGuardian extends EntityDemon
//My guess is that this will alter the max health
if (this.isTamed())
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxTamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxTamedHealth);
} else
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxUntamedHealth);
}
}
@ -99,14 +95,14 @@ public class EntityLowerGuardian extends EntityDemon
*/
protected void updateAITick()
{
this.dataWatcher.updateObject(18, Float.valueOf(this.getHealth()));
this.dataWatcher.updateObject(18, this.getHealth());
}
protected void entityInit()
{
super.entityInit();
this.dataWatcher.addObject(18, new Float(this.getHealth()));
this.dataWatcher.addObject(19, new Byte((byte) 0));
this.dataWatcher.addObject(18, this.getHealth());
this.dataWatcher.addObject(19, 0);
}
/**
@ -137,7 +133,6 @@ public class EntityLowerGuardian extends EntityDemon
this.setAngry(par1NBTTagCompound.getBoolean("Angry"));
attackTimer = par1NBTTagCompound.getByte("attackTimer");
isAggro = par1NBTTagCompound.getBoolean("isAggro");
}
/**
@ -264,10 +259,10 @@ public class EntityLowerGuardian extends EntityDemon
if (par1)
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxTamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxTamedHealth);
} else
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxUntamedHealth);
}
}
@ -287,7 +282,7 @@ public class EntityLowerGuardian extends EntityDemon
{
ItemFood itemfood = (ItemFood) itemstack.getItem();
if (itemfood.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < this.maxTamedHealth)
if (itemfood.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < maxTamedHealth)
{
if (!par1EntityPlayer.capabilities.isCreativeMode)
{
@ -298,7 +293,7 @@ public class EntityLowerGuardian extends EntityDemon
if (itemstack.stackSize <= 0)
{
par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack) null);
par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, null);
}
return true;
@ -312,9 +307,9 @@ public class EntityLowerGuardian extends EntityDemon
{
this.aiSit.setSitting(!this.isSitting());
this.isJumping = false;
this.setPathToEntity((PathEntity) null);
this.setTarget((Entity) null);
this.setAttackTarget((EntityLivingBase) null);
this.setPathToEntity(null);
this.setTarget(null);
this.setAttackTarget(null);
}
this.sendSittingMessageToPlayer(par1EntityPlayer, !this.isSitting());
@ -328,7 +323,7 @@ public class EntityLowerGuardian extends EntityDemon
if (itemstack.stackSize <= 0)
{
par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack) null);
par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, null);
}
if (!this.worldObj.isRemote)
@ -336,10 +331,10 @@ public class EntityLowerGuardian extends EntityDemon
if (this.rand.nextInt(1) == 0)
{
this.setTamed(true);
this.setPathToEntity((PathEntity) null);
this.setAttackTarget((EntityLivingBase) null);
this.setPathToEntity(null);
this.setAttackTarget(null);
this.aiSit.setSitting(true);
this.setHealth(this.maxTamedHealth);
this.setHealth(maxTamedHealth);
this.func_152115_b(par1EntityPlayer.getUniqueID().toString());
this.playTameEffect(true);
this.worldObj.setEntityState(this, (byte) 7);
@ -383,10 +378,10 @@ public class EntityLowerGuardian extends EntityDemon
if (par1)
{
this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 | 2)));
this.dataWatcher.updateObject(16, b0 | 2);
} else
{
this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 & -3)));
this.dataWatcher.updateObject(16, b0 & -3);
}
}
@ -403,7 +398,7 @@ public class EntityLowerGuardian extends EntityDemon
*/
public void setCollarColor(int par1)
{
this.dataWatcher.updateObject(20, Byte.valueOf((byte) (par1 & 15)));
this.dataWatcher.updateObject(20, par1 & 15);
}
/**
@ -418,10 +413,10 @@ public class EntityLowerGuardian extends EntityDemon
{
if (par1)
{
this.dataWatcher.updateObject(19, Byte.valueOf((byte) 1));
this.dataWatcher.updateObject(19, 1);
} else
{
this.dataWatcher.updateObject(19, Byte.valueOf((byte) 0));
this.dataWatcher.updateObject(19, 0);
}
}

View file

@ -20,7 +20,6 @@ import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.pathfinding.PathEntity;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
@ -66,10 +65,10 @@ public class EntityShade extends EntityDemon
//My guess is that this will alter the max health
if (this.isTamed())
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxTamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxTamedHealth);
} else
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxUntamedHealth);
}
}
@ -102,14 +101,14 @@ public class EntityShade extends EntityDemon
*/
protected void updateAITick()
{
this.dataWatcher.updateObject(18, Float.valueOf(this.getHealth()));
this.dataWatcher.updateObject(18, this.getHealth());
}
protected void entityInit()
{
super.entityInit();
this.dataWatcher.addObject(18, new Float(this.getHealth()));
this.dataWatcher.addObject(19, new Byte((byte) 0));
this.dataWatcher.addObject(18, this.getHealth());
this.dataWatcher.addObject(19, 0);
}
/**
@ -246,10 +245,10 @@ public class EntityShade extends EntityDemon
if (par1)
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxTamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxTamedHealth);
} else
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxUntamedHealth);
}
}
@ -269,7 +268,7 @@ public class EntityShade extends EntityDemon
{
ItemFood itemfood = (ItemFood) itemstack.getItem();
if (itemfood.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < this.maxTamedHealth)
if (itemfood.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < maxTamedHealth)
{
if (!par1EntityPlayer.capabilities.isCreativeMode)
{
@ -280,7 +279,7 @@ public class EntityShade extends EntityDemon
if (itemstack.stackSize <= 0)
{
par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack) null);
par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, null);
}
return true;
@ -294,9 +293,9 @@ public class EntityShade extends EntityDemon
{
this.aiSit.setSitting(!this.isSitting());
this.isJumping = false;
this.setPathToEntity((PathEntity) null);
this.setTarget((Entity) null);
this.setAttackTarget((EntityLivingBase) null);
this.setPathToEntity(null);
this.setTarget(null);
this.setAttackTarget(null);
}
this.sendSittingMessageToPlayer(par1EntityPlayer, !this.isSitting());
@ -318,10 +317,10 @@ public class EntityShade extends EntityDemon
if (this.rand.nextInt(1) == 0)
{
this.setTamed(true);
this.setPathToEntity((PathEntity) null);
this.setAttackTarget((EntityLivingBase) null);
this.setPathToEntity(null);
this.setAttackTarget(null);
this.aiSit.setSitting(true);
this.setHealth(this.maxTamedHealth);
this.setHealth(maxTamedHealth);
this.func_152115_b(par1EntityPlayer.getUniqueID().toString());
this.playTameEffect(true);
this.worldObj.setEntityState(this, (byte) 7);
@ -365,10 +364,10 @@ public class EntityShade extends EntityDemon
if (par1)
{
this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 | 2)));
this.dataWatcher.updateObject(16, b0 | 2);
} else
{
this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 & -3)));
this.dataWatcher.updateObject(16, b0 & -3);
}
}
@ -385,7 +384,7 @@ public class EntityShade extends EntityDemon
*/
public void setCollarColor(int par1)
{
this.dataWatcher.updateObject(20, Byte.valueOf((byte) (par1 & 15)));
this.dataWatcher.updateObject(20, par1 & 15);
}
/**
@ -400,10 +399,10 @@ public class EntityShade extends EntityDemon
{
if (par1)
{
this.dataWatcher.updateObject(19, Byte.valueOf((byte) 1));
this.dataWatcher.updateObject(19, 1);
} else
{
this.dataWatcher.updateObject(19, Byte.valueOf((byte) 0));
this.dataWatcher.updateObject(19, 0);
}
}
@ -459,9 +458,6 @@ public class EntityShade extends EntityDemon
*/
public void attackEntityWithRangedAttack(EntityLivingBase par1EntityLivingBase, float par2)
{
double xCoord;
double yCoord;
double zCoord;
HolyProjectile hol = new HolyProjectile(worldObj, this, par1EntityLivingBase, 1.8f, 0f, 5, 600);
this.worldObj.spawnEntityInWorld(hol);
}
@ -473,7 +469,6 @@ public class EntityShade extends EntityDemon
{
this.tasks.removeTask(this.aiAttackOnCollide);
//this.tasks.removeTask(this.aiArrowAttack);
ItemStack itemstack = this.getHeldItem();
this.tasks.addTask(4, this.aiAttackOnCollide);
}
}

View file

@ -17,7 +17,6 @@ import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.pathfinding.PathEntity;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
@ -63,10 +62,10 @@ public class EntitySmallEarthGolem extends EntityDemon implements IRangedAttackM
//My guess is that this will alter the max health
if (this.isTamed())
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxTamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxTamedHealth);
} else
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxUntamedHealth);
}
}
@ -99,14 +98,14 @@ public class EntitySmallEarthGolem extends EntityDemon implements IRangedAttackM
*/
protected void updateAITick()
{
this.dataWatcher.updateObject(18, Float.valueOf(this.getHealth()));
this.dataWatcher.updateObject(18, this.getHealth());
}
protected void entityInit()
{
super.entityInit();
this.dataWatcher.addObject(18, new Float(this.getHealth()));
this.dataWatcher.addObject(19, new Byte((byte) 0));
this.dataWatcher.addObject(18, this.getHealth());
this.dataWatcher.addObject(19, 0);
}
/**
@ -242,10 +241,10 @@ public class EntitySmallEarthGolem extends EntityDemon implements IRangedAttackM
if (par1)
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxTamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxTamedHealth);
} else
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxUntamedHealth);
}
}
@ -265,7 +264,7 @@ public class EntitySmallEarthGolem extends EntityDemon implements IRangedAttackM
{
ItemFood itemfood = (ItemFood) itemstack.getItem();
if (itemfood.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < this.maxTamedHealth)
if (itemfood.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < maxTamedHealth)
{
if (!par1EntityPlayer.capabilities.isCreativeMode)
{
@ -276,7 +275,7 @@ public class EntitySmallEarthGolem extends EntityDemon implements IRangedAttackM
if (itemstack.stackSize <= 0)
{
par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack) null);
par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, null);
}
return true;
@ -290,9 +289,9 @@ public class EntitySmallEarthGolem extends EntityDemon implements IRangedAttackM
{
this.aiSit.setSitting(!this.isSitting());
this.isJumping = false;
this.setPathToEntity((PathEntity) null);
this.setTarget((Entity) null);
this.setAttackTarget((EntityLivingBase) null);
this.setPathToEntity(null);
this.setTarget(null);
this.setAttackTarget(null);
}
this.sendSittingMessageToPlayer(par1EntityPlayer, !this.isSitting());
@ -314,10 +313,10 @@ public class EntitySmallEarthGolem extends EntityDemon implements IRangedAttackM
if (this.rand.nextInt(1) == 0)
{
this.setTamed(true);
this.setPathToEntity((PathEntity) null);
this.setAttackTarget((EntityLivingBase) null);
this.setPathToEntity(null);
this.setAttackTarget(null);
this.aiSit.setSitting(true);
this.setHealth(this.maxTamedHealth);
this.setHealth(maxTamedHealth);
this.func_152115_b(par1EntityPlayer.getUniqueID().toString());
this.playTameEffect(true);
this.worldObj.setEntityState(this, (byte) 7);
@ -361,10 +360,10 @@ public class EntitySmallEarthGolem extends EntityDemon implements IRangedAttackM
if (par1)
{
this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 | 2)));
this.dataWatcher.updateObject(16, b0 | 2);
} else
{
this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 & -3)));
this.dataWatcher.updateObject(16, b0 & -3);
}
}
@ -381,7 +380,7 @@ public class EntitySmallEarthGolem extends EntityDemon implements IRangedAttackM
*/
public void setCollarColor(int par1)
{
this.dataWatcher.updateObject(20, Byte.valueOf((byte) (par1 & 15)));
this.dataWatcher.updateObject(20, par1 & 15);
}
/**
@ -396,10 +395,10 @@ public class EntitySmallEarthGolem extends EntityDemon implements IRangedAttackM
{
if (par1)
{
this.dataWatcher.updateObject(19, Byte.valueOf((byte) 1));
this.dataWatcher.updateObject(19, 1);
} else
{
this.dataWatcher.updateObject(19, Byte.valueOf((byte) 0));
this.dataWatcher.updateObject(19, 0);
}
}
@ -455,9 +454,6 @@ public class EntitySmallEarthGolem extends EntityDemon implements IRangedAttackM
*/
public void attackEntityWithRangedAttack(EntityLivingBase par1EntityLivingBase, float par2)
{
double xCoord;
double yCoord;
double zCoord;
MudProjectile hol = new MudProjectile(worldObj, this, par1EntityLivingBase, 1.8f, 0f, 3, 600, false);
this.worldObj.spawnEntityInWorld(hol);
}
@ -469,7 +465,6 @@ public class EntitySmallEarthGolem extends EntityDemon implements IRangedAttackM
{
this.tasks.removeTask(this.aiAttackOnCollide);
this.tasks.removeTask(this.aiArrowAttack);
ItemStack itemstack = this.getHeldItem();
this.tasks.addTask(4, this.aiArrowAttack);
}
}

View file

@ -17,7 +17,6 @@ import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.pathfinding.PathEntity;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
@ -65,10 +64,10 @@ public class EntityWingedFireDemon extends EntityDemon implements IRangedAttackM
//My guess is that this will alter the max health
if (this.isTamed())
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxTamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxTamedHealth);
} else
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxUntamedHealth);
}
//this.func_110148_a(SharedMonsterAttributes.field_111267_a).func_111128_a(10.0D);
@ -103,14 +102,14 @@ public class EntityWingedFireDemon extends EntityDemon implements IRangedAttackM
*/
protected void updateAITick()
{
this.dataWatcher.updateObject(18, Float.valueOf(this.getHealth()));
this.dataWatcher.updateObject(18, this.getHealth());
}
protected void entityInit()
{
super.entityInit();
this.dataWatcher.addObject(18, new Float(this.getHealth()));
this.dataWatcher.addObject(19, new Byte((byte) 0));
this.dataWatcher.addObject(18, this.getHealth());
this.dataWatcher.addObject(19, 0);
}
/**
@ -246,10 +245,10 @@ public class EntityWingedFireDemon extends EntityDemon implements IRangedAttackM
if (par1)
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxTamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxTamedHealth);
} else
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxUntamedHealth);
}
}
@ -269,7 +268,7 @@ public class EntityWingedFireDemon extends EntityDemon implements IRangedAttackM
{
ItemFood itemfood = (ItemFood) itemstack.getItem();
if (itemfood.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < this.maxTamedHealth)
if (itemfood.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < maxTamedHealth)
{
if (!par1EntityPlayer.capabilities.isCreativeMode)
{
@ -280,7 +279,7 @@ public class EntityWingedFireDemon extends EntityDemon implements IRangedAttackM
if (itemstack.stackSize <= 0)
{
par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack) null);
par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, null);
}
return true;
@ -294,9 +293,9 @@ public class EntityWingedFireDemon extends EntityDemon implements IRangedAttackM
{
this.aiSit.setSitting(!this.isSitting());
this.isJumping = false;
this.setPathToEntity((PathEntity) null);
this.setTarget((Entity) null);
this.setAttackTarget((EntityLivingBase) null);
this.setPathToEntity(null);
this.setTarget(null);
this.setAttackTarget(null);
}
this.sendSittingMessageToPlayer(par1EntityPlayer, !this.isSitting());
@ -310,7 +309,7 @@ public class EntityWingedFireDemon extends EntityDemon implements IRangedAttackM
if (itemstack.stackSize <= 0)
{
par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack) null);
par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, null);
}
if (!this.worldObj.isRemote)
@ -318,10 +317,10 @@ public class EntityWingedFireDemon extends EntityDemon implements IRangedAttackM
if (this.rand.nextInt(1) == 0)
{
this.setTamed(true);
this.setPathToEntity((PathEntity) null);
this.setAttackTarget((EntityLivingBase) null);
this.setPathToEntity(null);
this.setAttackTarget(null);
this.aiSit.setSitting(true);
this.setHealth(this.maxTamedHealth);
this.setHealth(maxTamedHealth);
this.func_152115_b(par1EntityPlayer.getUniqueID().toString());
this.playTameEffect(true);
this.worldObj.setEntityState(this, (byte) 7);
@ -365,10 +364,10 @@ public class EntityWingedFireDemon extends EntityDemon implements IRangedAttackM
if (par1)
{
this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 | 2)));
this.dataWatcher.updateObject(16, b0 | 2);
} else
{
this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 & -3)));
this.dataWatcher.updateObject(16, b0 & -3);
}
}
@ -385,7 +384,7 @@ public class EntityWingedFireDemon extends EntityDemon implements IRangedAttackM
*/
public void setCollarColor(int par1)
{
this.dataWatcher.updateObject(20, Byte.valueOf((byte) (par1 & 15)));
this.dataWatcher.updateObject(20, par1 & 15);
}
/**
@ -400,10 +399,10 @@ public class EntityWingedFireDemon extends EntityDemon implements IRangedAttackM
{
if (par1)
{
this.dataWatcher.updateObject(19, Byte.valueOf((byte) 1));
this.dataWatcher.updateObject(19, 1);
} else
{
this.dataWatcher.updateObject(19, Byte.valueOf((byte) 0));
this.dataWatcher.updateObject(19, 0);
}
}
@ -459,10 +458,7 @@ public class EntityWingedFireDemon extends EntityDemon implements IRangedAttackM
*/
public void attackEntityWithRangedAttack(EntityLivingBase par1EntityLivingBase, float par2)
{
double xCoord;
double yCoord;
double zCoord;
this.worldObj.playAuxSFXAtEntity((EntityPlayer) null, 1009, (int) this.posX, (int) this.posY, (int) this.posZ, 0);
this.worldObj.playAuxSFXAtEntity(null, 1009, (int) this.posX, (int) this.posY, (int) this.posZ, 0);
FireProjectile hol = new FireProjectile(worldObj, this, par1EntityLivingBase, 1.8f, 0f, 20, 600);
this.worldObj.spawnEntityInWorld(hol);
}
@ -474,7 +470,6 @@ public class EntityWingedFireDemon extends EntityDemon implements IRangedAttackM
{
this.tasks.removeTask(this.aiAttackOnCollide);
this.tasks.removeTask(this.aiArrowAttack);
ItemStack itemstack = this.getHeldItem();
this.tasks.addTask(4, this.aiArrowAttack);
}
}