add foxes, complete texture
This commit is contained in:
parent
ad930fcbdc
commit
339a7679f7
16 changed files with 138 additions and 67 deletions
|
@ -12,6 +12,7 @@ import common.entity.types.EntityLiving;
|
|||
import common.entity.types.IEntityMultiPart;
|
||||
import common.init.SoundEvent;
|
||||
import common.model.ParticleType;
|
||||
import common.potion.Potion;
|
||||
import common.util.ExtMath;
|
||||
import common.util.Vec3;
|
||||
import common.vars.Vars;
|
||||
|
@ -56,6 +57,10 @@ public class EntityDragon extends EntityLiving implements IEntityMultiPart
|
|||
return true;
|
||||
}
|
||||
|
||||
public boolean isPotionApplicable(Potion potion, int amplifier) {
|
||||
return false;
|
||||
}
|
||||
|
||||
protected void applyEntityAttributes()
|
||||
{
|
||||
super.applyEntityAttributes();
|
||||
|
|
|
@ -5,6 +5,7 @@ import common.ai.EntityAIHurtByTarget;
|
|||
import common.ai.EntityAILeapAtTarget;
|
||||
import common.ai.EntityAILookIdle;
|
||||
import common.ai.EntityAIMate;
|
||||
import common.ai.EntityAINearestAttackableTarget;
|
||||
import common.ai.EntityAISwimming;
|
||||
import common.ai.EntityAIWander;
|
||||
import common.ai.EntityAIWatchClosest;
|
||||
|
@ -37,28 +38,24 @@ public class EntityFox extends EntityAnimal
|
|||
this.tasks.addTask(9, new EntityAIWatchClosest(this, null, 8.0F));
|
||||
this.tasks.addTask(9, new EntityAILookIdle(this));
|
||||
this.targets.addTask(3, new EntityAIHurtByTarget(this, true));
|
||||
// this.targets.addTask(5, new EntityAINearestAttackableTarget(this, EntityUndead.class, false));
|
||||
this.targets.addTask(5, new EntityAINearestAttackableTarget(this, EntityChicken.class, true));
|
||||
}
|
||||
|
||||
protected void applyEntityAttributes()
|
||||
{
|
||||
super.applyEntityAttributes();
|
||||
this.getEntityAttribute(Attribute.MOVEMENT_SPEED).setBaseValue(0.35D);
|
||||
|
||||
this.setMaxHealth(6);
|
||||
|
||||
this.getAttributeMap().registerAttribute(Attribute.ATTACK_DAMAGE);
|
||||
this.getEntityAttribute(Attribute.ATTACK_DAMAGE).setBaseValue(2.0D);
|
||||
}
|
||||
|
||||
protected SoundEvent getHurtSound()
|
||||
{
|
||||
return SoundEvent.WOLF_HURT;
|
||||
return SoundEvent.FOX_HURT;
|
||||
}
|
||||
|
||||
protected SoundEvent getDeathSound()
|
||||
{
|
||||
return SoundEvent.WOLF_DEATH;
|
||||
return SoundEvent.FOX_DEATH;
|
||||
}
|
||||
|
||||
protected float getSoundVolume()
|
||||
|
@ -80,7 +77,7 @@ public class EntityFox extends EntityAnimal
|
|||
{
|
||||
if(!this.worldObj.client && !Vars.damageMobs)
|
||||
return false;
|
||||
boolean flag = entityIn.attackEntityFrom(DamageSource.causeMobDamage(this), ((int)this.getEntityAttribute(Attribute.ATTACK_DAMAGE).getAttributeValue()));
|
||||
boolean flag = entityIn.attackEntityFrom(DamageSource.causeMobDamage(this), 2);
|
||||
|
||||
if (flag)
|
||||
{
|
||||
|
@ -110,6 +107,6 @@ public class EntityFox extends EntityAnimal
|
|||
}
|
||||
|
||||
public Alignment getAlignment() {
|
||||
return Alignment.LAWFUL;
|
||||
return Alignment.CHAOTIC;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -85,6 +85,10 @@ public class EntityRabbit extends EntityAnimal {
|
|||
return this.moveHelper.isUpdating() && this.moveHelper.getY() > this.posY + 0.5D ? 0.5F : this.moveType.getUpwardsMotion();
|
||||
}
|
||||
|
||||
public boolean isPotionApplicable(Potion potion, int amplifier) {
|
||||
return super.isPotionApplicable(potion, amplifier) || potion == Potion.JUMP;
|
||||
}
|
||||
|
||||
public void setMoveType(EntityRabbit.EnumMoveType type) {
|
||||
this.moveType = type;
|
||||
}
|
||||
|
|
|
@ -87,18 +87,7 @@ public class EntityWolf extends EntityTameable
|
|||
{
|
||||
super.applyEntityAttributes();
|
||||
this.getEntityAttribute(Attribute.MOVEMENT_SPEED).setBaseValue(0.30000001192092896D);
|
||||
|
||||
if (this.isTamed())
|
||||
{
|
||||
this.setMaxHealth(20);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.setMaxHealth(8);
|
||||
}
|
||||
|
||||
this.getAttributeMap().registerAttribute(Attribute.ATTACK_DAMAGE);
|
||||
this.getEntityAttribute(Attribute.ATTACK_DAMAGE).setBaseValue(2.0D);
|
||||
this.setMaxHealth(8);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -350,7 +339,7 @@ public class EntityWolf extends EntityTameable
|
|||
{
|
||||
if(!this.worldObj.client && !Vars.damageMobs)
|
||||
return false;
|
||||
boolean flag = entityIn.attackEntityFrom(DamageSource.causeMobDamage(this), ((int)this.getEntityAttribute(Attribute.ATTACK_DAMAGE).getAttributeValue()));
|
||||
boolean flag = entityIn.attackEntityFrom(DamageSource.causeMobDamage(this), this.rand.chance(2, 3, 8));
|
||||
|
||||
if (flag)
|
||||
{
|
||||
|
@ -360,22 +349,6 @@ public class EntityWolf extends EntityTameable
|
|||
return flag;
|
||||
}
|
||||
|
||||
public void setTamed(boolean tamed)
|
||||
{
|
||||
super.setTamed(tamed);
|
||||
|
||||
if (tamed)
|
||||
{
|
||||
this.setMaxHealth(20);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.setMaxHealth(8);
|
||||
}
|
||||
|
||||
this.getEntityAttribute(Attribute.ATTACK_DAMAGE).setBaseValue(4.0D);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig.
|
||||
*/
|
||||
|
|
|
@ -549,6 +549,10 @@ public abstract class EntityNPC extends EntityLiving
|
|||
this.getAttributeMap().registerAttribute(Attribute.MANA_CAPACITY);
|
||||
this.getEntityAttribute(Attribute.MANA_CAPACITY).setBaseValue(20.0D);
|
||||
}
|
||||
|
||||
public boolean isPotionApplicable(Potion potion, int amplifier) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// protected int getExperiencePoints(EntityNPC player)
|
||||
// {
|
||||
|
|
|
@ -828,20 +828,9 @@ public abstract class EntityLiving extends Entity
|
|||
}
|
||||
}
|
||||
|
||||
public boolean isPotionApplicable(Potion potion, int amplifier)
|
||||
{
|
||||
// if (this.getCreatureType() == CreatureType.UNDEAD)
|
||||
// {
|
||||
// int i = potioneffectIn.getPotionID();
|
||||
//
|
||||
// if (i == Potion.regeneration.id || i == Potion.poison.id)
|
||||
// {
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
|
||||
return true;
|
||||
}
|
||||
public boolean isPotionApplicable(Potion potion, int amplifier) {
|
||||
return potion == Potion.SPEED || potion == Potion.SLOWNESS || potion == Potion.HEAL || potion == Potion.DAMAGE || potion == Potion.POISON || potion == Potion.RADIATION;
|
||||
}
|
||||
|
||||
public boolean arePotionsInverted()
|
||||
{
|
||||
|
|
|
@ -109,6 +109,9 @@ public enum SoundEvent {
|
|||
WOLF_PANTING("wolf_panting"),
|
||||
WOLF_SHAKE("wolf_shake"),
|
||||
WOLF_WHINE("wolf_whine"),
|
||||
|
||||
FOX_DEATH("fox_death"),
|
||||
FOX_HURT("fox_hurt1", "fox_hurt2"),
|
||||
|
||||
SLIME_ATTACK("slime_attack1", "slime_attack2"),
|
||||
SLIME_BIG("slime_big1", "slime_big2", "slime_big3", "slime_big4"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue