2014-06-27 19:43:09 -04:00
|
|
|
package WayofTime.alchemicalWizardry.common.entity.mob;
|
|
|
|
|
2015-07-29 08:23:01 -04:00
|
|
|
import net.minecraft.entity.Entity;
|
2014-06-27 19:43:09 -04:00
|
|
|
import net.minecraft.entity.EntityAgeable;
|
2015-07-29 08:23:01 -04:00
|
|
|
import net.minecraft.entity.EntityLivingBase;
|
|
|
|
import net.minecraft.entity.SharedMonsterAttributes;
|
|
|
|
import net.minecraft.entity.monster.EntityCreeper;
|
|
|
|
import net.minecraft.entity.monster.EntityGhast;
|
|
|
|
import net.minecraft.entity.passive.EntityAnimal;
|
|
|
|
import net.minecraft.entity.passive.EntityHorse;
|
2014-06-27 19:43:09 -04:00
|
|
|
import net.minecraft.entity.passive.EntityTameable;
|
2015-07-29 08:23:01 -04:00
|
|
|
import net.minecraft.entity.passive.EntityWolf;
|
2014-06-27 19:43:09 -04:00
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
2015-07-29 08:23:01 -04:00
|
|
|
import net.minecraft.entity.projectile.EntityArrow;
|
|
|
|
import net.minecraft.item.ItemFood;
|
2014-06-27 19:43:09 -04:00
|
|
|
import net.minecraft.item.ItemStack;
|
2014-12-29 16:21:12 -05:00
|
|
|
import net.minecraft.nbt.NBTTagCompound;
|
2015-04-26 13:50:55 +03:00
|
|
|
import net.minecraft.util.ChatComponentTranslation;
|
2015-07-29 08:23:01 -04:00
|
|
|
import net.minecraft.util.DamageSource;
|
2014-06-27 19:43:09 -04:00
|
|
|
import net.minecraft.world.World;
|
2014-12-29 16:21:12 -05:00
|
|
|
import WayofTime.alchemicalWizardry.ModItems;
|
|
|
|
import WayofTime.alchemicalWizardry.common.IDemon;
|
|
|
|
import WayofTime.alchemicalWizardry.common.items.DemonPlacer;
|
|
|
|
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
2014-06-27 19:43:09 -04:00
|
|
|
|
|
|
|
public class EntityDemon extends EntityTameable implements IDemon
|
|
|
|
{
|
2015-07-29 08:23:01 -04:00
|
|
|
protected boolean isAggro;
|
|
|
|
protected String demonID;
|
|
|
|
|
|
|
|
protected float maxTamedHealth = 100.0F;
|
|
|
|
protected float maxUntamedHealth = 200.0F;
|
|
|
|
protected int attackTimer;
|
2014-12-04 14:31:31 -05:00
|
|
|
|
|
|
|
protected boolean dropCrystal = true;
|
2014-06-27 19:43:09 -04:00
|
|
|
|
2014-10-19 19:34:51 -04:00
|
|
|
public EntityDemon(World par1World, String demonID)
|
2014-06-27 19:43:09 -04:00
|
|
|
{
|
|
|
|
super(par1World);
|
|
|
|
this.demonID = demonID;
|
|
|
|
}
|
2014-12-04 14:31:31 -05:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean getDoesDropCrystal()
|
|
|
|
{
|
|
|
|
return dropCrystal;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void setDropCrystal(boolean crystal)
|
|
|
|
{
|
|
|
|
this.dropCrystal = crystal;
|
|
|
|
}
|
2014-06-27 19:43:09 -04:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public void setSummonedConditions()
|
|
|
|
{
|
|
|
|
this.setAggro(true);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean isAggro()
|
|
|
|
{
|
|
|
|
return this.isAggro;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void setAggro(boolean aggro)
|
|
|
|
{
|
|
|
|
this.isAggro = aggro;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public EntityAgeable createChild(EntityAgeable entityageable)
|
|
|
|
{
|
|
|
|
// TODO Auto-generated method stub
|
|
|
|
return null;
|
|
|
|
}
|
2015-07-29 08:23:01 -04:00
|
|
|
|
2014-12-29 16:21:12 -05:00
|
|
|
@Override
|
|
|
|
public void writeToNBT(NBTTagCompound tag)
|
|
|
|
{
|
|
|
|
super.writeToNBT(tag);
|
|
|
|
|
|
|
|
tag.setBoolean("dropCrystal", this.getDoesDropCrystal());
|
2015-07-29 08:23:01 -04:00
|
|
|
tag.setBoolean("isAggro", isAggro);
|
|
|
|
tag.setString("demonID", demonID);
|
2014-12-29 16:21:12 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void readFromNBT(NBTTagCompound tag)
|
|
|
|
{
|
|
|
|
super.readFromNBT(tag);
|
|
|
|
|
|
|
|
this.setDropCrystal(tag.getBoolean("dropCrystal"));
|
2015-07-29 08:23:01 -04:00
|
|
|
isAggro = tag.getBoolean("isAggro");
|
|
|
|
demonID = tag.getString("demonID");
|
2014-12-29 16:21:12 -05:00
|
|
|
}
|
2014-06-27 19:43:09 -04:00
|
|
|
|
2014-12-05 12:13:10 -05:00
|
|
|
@Override
|
2014-06-27 19:43:09 -04:00
|
|
|
protected void dropFewItems(boolean par1, int par2)
|
|
|
|
{
|
2014-12-04 14:31:31 -05:00
|
|
|
if(this.getDoesDropCrystal())
|
|
|
|
{
|
|
|
|
ItemStack drop = new ItemStack(ModItems.demonPlacer);
|
|
|
|
|
|
|
|
DemonPlacer.setDemonString(drop, this.getDemonID());
|
2014-06-27 19:43:09 -04:00
|
|
|
|
2014-12-04 14:31:31 -05:00
|
|
|
if ((this.getOwner() instanceof EntityPlayer))
|
|
|
|
{
|
|
|
|
DemonPlacer.setOwnerName(drop, SpellHelper.getUsername((EntityPlayer) this.getOwner()));
|
|
|
|
}
|
2014-10-13 22:33:20 +02:00
|
|
|
|
2015-07-29 08:23:01 -04:00
|
|
|
if (this.hasCustomName())
|
2014-12-04 14:31:31 -05:00
|
|
|
{
|
|
|
|
drop.setStackDisplayName(this.getCustomNameTag());
|
|
|
|
}
|
2014-06-27 19:43:09 -04:00
|
|
|
|
2014-12-04 14:31:31 -05:00
|
|
|
this.entityDropItem(drop, 0.0f);
|
|
|
|
}
|
2014-06-27 19:43:09 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
public void onLivingUpdate()
|
|
|
|
{
|
|
|
|
super.onLivingUpdate();
|
|
|
|
|
|
|
|
if (!this.isAggro() && worldObj.getWorldTime() % 100 == 0)
|
|
|
|
{
|
|
|
|
this.heal(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public void sendSittingMessageToPlayer(EntityPlayer owner, boolean isSitting)
|
|
|
|
{
|
|
|
|
if (owner != null && owner.worldObj.isRemote)
|
|
|
|
{
|
2015-04-26 13:50:55 +03:00
|
|
|
ChatComponentTranslation chatmessagecomponent;
|
2014-06-27 19:43:09 -04:00
|
|
|
|
|
|
|
if (isSitting)
|
|
|
|
{
|
2015-04-26 13:50:55 +03:00
|
|
|
chatmessagecomponent = new ChatComponentTranslation("message.demon.willstay");
|
2014-06-27 19:43:09 -04:00
|
|
|
} else
|
|
|
|
{
|
2015-04-26 13:50:55 +03:00
|
|
|
chatmessagecomponent = new ChatComponentTranslation("message.demon.shallfollow");
|
2014-06-27 19:43:09 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
owner.addChatComponentMessage(chatmessagecomponent);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-10-19 19:34:51 -04:00
|
|
|
public String getDemonID()
|
2014-06-27 19:43:09 -04:00
|
|
|
{
|
|
|
|
return this.demonID;
|
|
|
|
}
|
2014-12-04 14:31:31 -05:00
|
|
|
|
|
|
|
protected void setDemonID(String id)
|
|
|
|
{
|
|
|
|
this.demonID = id;
|
|
|
|
}
|
2015-07-29 08:23:01 -04:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns true if the newer Entity AI code should be run
|
|
|
|
*/
|
|
|
|
public boolean isAIEnabled()
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the active target the Task system uses for tracking
|
|
|
|
*/
|
|
|
|
public void setAttackTarget(EntityLivingBase par1EntityLivingBase)
|
|
|
|
{
|
|
|
|
super.setAttackTarget(par1EntityLivingBase);
|
|
|
|
|
|
|
|
if (par1EntityLivingBase == null)
|
|
|
|
{
|
|
|
|
this.setAngry(false);
|
|
|
|
} else if (!this.isTamed())
|
|
|
|
{
|
|
|
|
this.setAngry(true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* main AI tick function, replaces updateEntityActionState
|
|
|
|
*/
|
|
|
|
protected void updateAITick()
|
|
|
|
{
|
|
|
|
this.dataWatcher.updateObject(18, this.getHealth());
|
|
|
|
}
|
|
|
|
|
|
|
|
protected void entityInit()
|
|
|
|
{
|
|
|
|
super.entityInit();
|
|
|
|
this.dataWatcher.addObject(18, this.getHealth());
|
|
|
|
this.dataWatcher.addObject(19, 0);
|
|
|
|
//this.dataWatcher.addObject(20, new Byte((byte) BlockColored.getBlockFromDye(1)));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Plays step sound at given x, y, z for the entity
|
|
|
|
*/
|
|
|
|
protected void playStepSound(int par1, int par2, int par3, int par4)
|
|
|
|
{
|
|
|
|
this.playSound("mob.zombie.step", 0.15F, 1.0F);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* (abstract) Protected helper method to write subclass entity data to NBT.
|
|
|
|
*/
|
|
|
|
public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound)
|
|
|
|
{
|
|
|
|
super.writeEntityToNBT(par1NBTTagCompound);
|
|
|
|
par1NBTTagCompound.setBoolean("Angry", this.isAngry());
|
|
|
|
par1NBTTagCompound.setByte("attackTimer", (byte) attackTimer);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* (abstract) Protected helper method to read subclass entity data from NBT.
|
|
|
|
*/
|
|
|
|
public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound)
|
|
|
|
{
|
|
|
|
super.readEntityFromNBT(par1NBTTagCompound);
|
|
|
|
this.setAngry(par1NBTTagCompound.getBoolean("Angry"));
|
|
|
|
|
|
|
|
attackTimer = par1NBTTagCompound.getByte("attackTimer");
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the sound this mob makes while it's alive.
|
|
|
|
*/
|
|
|
|
protected String getLivingSound()
|
|
|
|
{
|
|
|
|
return "none";
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the sound this mob makes when it is hurt.
|
|
|
|
*/
|
|
|
|
protected String getHurtSound()
|
|
|
|
{
|
|
|
|
return "mob.irongolem.hit";
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the sound this mob makes on death.
|
|
|
|
*/
|
|
|
|
protected String getDeathSound()
|
|
|
|
{
|
|
|
|
return "mob.irongolem.death";
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the volume for the sounds this mob makes.
|
|
|
|
*/
|
|
|
|
protected float getSoundVolume()
|
|
|
|
{
|
|
|
|
return 1.0F;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the item ID for the item the mob drops on death.
|
|
|
|
*/
|
|
|
|
protected int getDropItemId()
|
|
|
|
{
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getAttackTimer()
|
|
|
|
{
|
|
|
|
return attackTimer;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Called to update the entity's position/logic.
|
|
|
|
*/
|
|
|
|
public void onUpdate()
|
|
|
|
{
|
|
|
|
super.onUpdate();
|
|
|
|
}
|
|
|
|
|
|
|
|
public float getEyeHeight()
|
|
|
|
{
|
|
|
|
return this.height * 0.8F;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The speed it takes to move the entityliving's rotationPitch through the faceEntity method. This is only currently
|
|
|
|
* use in wolves.
|
|
|
|
*/
|
|
|
|
public int getVerticalFaceSpeed()
|
|
|
|
{
|
|
|
|
return this.isSitting() ? 20 : super.getVerticalFaceSpeed();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Called when the entity is attacked.
|
|
|
|
*/
|
|
|
|
public boolean attackEntityFrom(DamageSource par1DamageSource, float par2)
|
|
|
|
{
|
|
|
|
// if (this.isEntityInvulnerable())
|
|
|
|
// {
|
|
|
|
// return false;
|
|
|
|
// } else
|
|
|
|
{
|
|
|
|
Entity entity = par1DamageSource.getEntity();
|
|
|
|
this.aiSit.setSitting(false);
|
|
|
|
|
|
|
|
if (entity != null && !(entity instanceof EntityPlayer) && !(entity instanceof EntityArrow))
|
|
|
|
{
|
|
|
|
par2 = (par2 + 1.0F) / 2.0F;
|
|
|
|
}
|
|
|
|
|
|
|
|
return super.attackEntityFrom(par1DamageSource, par2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean attackEntityAsMob(Entity par1Entity)
|
|
|
|
{
|
|
|
|
this.attackTimer = 10;
|
|
|
|
this.worldObj.setEntityState(this, (byte) 4);
|
|
|
|
boolean flag = par1Entity.attackEntityFrom(DamageSource.causeMobDamage(this), (float) (7 + this.rand.nextInt(15)));
|
|
|
|
|
|
|
|
if (flag)
|
|
|
|
{
|
|
|
|
par1Entity.motionY += 0.4000000059604645D;
|
|
|
|
}
|
|
|
|
|
|
|
|
this.playSound("mob.irongolem.throw", 1.0F, 1.0F);
|
|
|
|
return flag;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setTamed(boolean par1)
|
|
|
|
{
|
|
|
|
super.setTamed(par1);
|
|
|
|
|
|
|
|
if (par1)
|
|
|
|
{
|
|
|
|
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxTamedHealth);
|
|
|
|
} else
|
|
|
|
{
|
|
|
|
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxUntamedHealth);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig.
|
|
|
|
*/
|
|
|
|
@Override
|
|
|
|
public boolean interact(EntityPlayer par1EntityPlayer)
|
|
|
|
{
|
|
|
|
ItemStack itemstack = par1EntityPlayer.inventory.getCurrentItem();
|
|
|
|
|
|
|
|
if (this.isTamed())
|
|
|
|
{
|
|
|
|
if (itemstack != null)
|
|
|
|
{
|
|
|
|
if (itemstack.getItem() instanceof ItemFood)
|
|
|
|
{
|
|
|
|
ItemFood itemfood = (ItemFood) itemstack.getItem();
|
|
|
|
|
|
|
|
if (itemfood.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < maxTamedHealth)
|
|
|
|
{
|
|
|
|
if (!par1EntityPlayer.capabilities.isCreativeMode)
|
|
|
|
{
|
|
|
|
--itemstack.stackSize;
|
|
|
|
}
|
|
|
|
|
|
|
|
this.heal((float) itemfood.getHealAmount(itemstack));
|
|
|
|
|
|
|
|
if (itemstack.stackSize <= 0)
|
|
|
|
{
|
|
|
|
par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, null);
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (this.getOwner() instanceof EntityPlayer && SpellHelper.getUsername(par1EntityPlayer).equalsIgnoreCase(SpellHelper.getUsername((EntityPlayer) this.getOwner())) && !this.isBreedingItem(itemstack))
|
|
|
|
{
|
|
|
|
if (!this.worldObj.isRemote)
|
|
|
|
{
|
|
|
|
this.aiSit.setSitting(!this.isSitting());
|
|
|
|
this.isJumping = false;
|
|
|
|
// this.setPathToEntity(null);
|
|
|
|
// this.setTarget(null);
|
|
|
|
this.setAttackTarget(null);
|
|
|
|
}
|
|
|
|
|
|
|
|
this.sendSittingMessageToPlayer(par1EntityPlayer, !this.isSitting());
|
|
|
|
}
|
|
|
|
} else if (itemstack != null && itemstack.getItem().equals(ModItems.weakBloodOrb) && !this.isAngry())
|
|
|
|
{
|
|
|
|
if (!par1EntityPlayer.capabilities.isCreativeMode)
|
|
|
|
{
|
|
|
|
--itemstack.stackSize;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (itemstack.stackSize <= 0)
|
|
|
|
{
|
|
|
|
par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack) null);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!this.worldObj.isRemote)
|
|
|
|
{
|
|
|
|
if (this.rand.nextInt(1) == 0)
|
|
|
|
{
|
|
|
|
this.setTamed(true);
|
|
|
|
// this.setPathToEntity(null);
|
|
|
|
this.setAttackTarget(null);
|
|
|
|
this.aiSit.setSitting(true);
|
|
|
|
this.setHealth(maxTamedHealth);
|
|
|
|
this.func_152115_b(par1EntityPlayer.getUniqueID().toString());
|
|
|
|
this.playTameEffect(true);
|
|
|
|
this.worldObj.setEntityState(this, (byte) 7);
|
|
|
|
} else
|
|
|
|
{
|
|
|
|
this.playTameEffect(false);
|
|
|
|
this.worldObj.setEntityState(this, (byte) 6);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return super.interact(par1EntityPlayer);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on
|
|
|
|
* the animal type)
|
|
|
|
*/
|
|
|
|
public boolean isBreedingItem(ItemStack par1ItemStack)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Determines whether this wolf is angry or not.
|
|
|
|
*/
|
|
|
|
public boolean isAngry()
|
|
|
|
{
|
|
|
|
return (this.dataWatcher.getWatchableObjectByte(16) & 2) != 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets whether this wolf is angry or not.
|
|
|
|
*/
|
|
|
|
public void setAngry(boolean par1)
|
|
|
|
{
|
|
|
|
byte b0 = this.dataWatcher.getWatchableObjectByte(16);
|
|
|
|
|
|
|
|
if (par1)
|
|
|
|
{
|
|
|
|
this.dataWatcher.updateObject(16, b0 | 2);
|
|
|
|
} else
|
|
|
|
{
|
|
|
|
this.dataWatcher.updateObject(16, b0 & -3);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return this wolf's collar color.
|
|
|
|
*/
|
|
|
|
public int getCollarColor()
|
|
|
|
{
|
|
|
|
return this.dataWatcher.getWatchableObjectByte(20) & 15;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set this wolf's collar color.
|
|
|
|
*/
|
|
|
|
public void setCollarColor(int par1)
|
|
|
|
{
|
|
|
|
this.dataWatcher.updateObject(20, par1 & 15);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This function is used when two same-species animals in 'love mode' breed to generate the new baby animal.
|
|
|
|
*/
|
|
|
|
public EntityWolf spawnBabyAnimal(EntityAgeable par1EntityAgeable)
|
|
|
|
{
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void func_70918_i(boolean par1)
|
|
|
|
{
|
|
|
|
if (par1)
|
|
|
|
{
|
|
|
|
this.dataWatcher.updateObject(19, 1);
|
|
|
|
} else
|
|
|
|
{
|
|
|
|
this.dataWatcher.updateObject(19, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns true if the mob is currently able to mate with the specified mob.
|
|
|
|
*/
|
|
|
|
public boolean canMateWith(EntityAnimal par1EntityAnimal)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean func_70922_bv()
|
|
|
|
{
|
|
|
|
return this.dataWatcher.getWatchableObjectByte(19) == 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Determines if an entity can be despawned, used on idle far away entities
|
|
|
|
*/
|
|
|
|
protected boolean canDespawn()
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean func_142018_a(EntityLivingBase par1EntityLivingBase, EntityLivingBase par2EntityLivingBase)
|
|
|
|
{
|
|
|
|
if (!(par1EntityLivingBase instanceof EntityCreeper) && !(par1EntityLivingBase instanceof EntityGhast))
|
|
|
|
{
|
|
|
|
if (par1EntityLivingBase instanceof EntityBileDemon)
|
|
|
|
{
|
|
|
|
EntityBileDemon entitywolf = (EntityBileDemon) par1EntityLivingBase;
|
|
|
|
|
|
|
|
if (entitywolf.isTamed() && entitywolf.getOwner() == par2EntityLivingBase)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return par1EntityLivingBase instanceof EntityPlayer && par2EntityLivingBase instanceof EntityPlayer && !((EntityPlayer) par2EntityLivingBase).canAttackPlayer((EntityPlayer) par1EntityLivingBase) ? false : !(par1EntityLivingBase instanceof EntityHorse) || !((EntityHorse) par1EntityLivingBase).isTame();
|
|
|
|
} else
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2014-06-27 19:43:09 -04:00
|
|
|
}
|