- 4
- 0
В кодах у меня нет ошибок, крашится пакет, пишет что из-за того что не может найти serverpox
(pastebin.com/13NBddfg)
(pastebin.com/13NBddfg)
Код:
public class ModMob extends EntityTameable {
public int serverPosX;
public int serverPosY;
public int serverPosZ;
public ModMob(World World){
super(World);
this.setSize(5.0F, 12.0F);
this.tasks.addTask(1, new EntityAISwimming(this));
this.tasks.addTask(6, new EntityAILookIdle(this));
this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
this.tasks.addTask(6, new EntityAIWander(this, 0.8D));
this.tasks.addTask(6, new EntityAILookIdle(this));
this.getNavigator().setAvoidsWater(true);
this.tasks.addTask(3, new EntityAILeapAtTarget(this, 0.4F));
this.tasks.addTask(4, new EntityAIAttackOnCollide(this, 1.0D, true));
this.tasks.addTask(5, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F));
this.targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this));
this.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this));
this.targetTasks.addTask(3, new EntityAIHurtByTarget(this, true));
}
@Override
protected void applyEntityAttributes()
{
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(140.0D);
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.5D);
}
@Override
public EntityAgeable createChild(EntityAgeable var1) {
// TODO Auto-generated method stub
return null;
}
@Override
protected String getLivingSound()
{
return "RevObucnyu";
}
@Override
protected String getHurtSound()
{
return "RevUdar";
}
@Override
protected String getDeathSound()
{
return "RevYmer";
}
@Override
protected float getSoundVolume()
{
return 0.7F;
}
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) < 20.0F)
{
if (!par1EntityPlayer.capabilities.isCreativeMode)
{
--itemstack.stackSize;
}
this.heal((float)itemfood.func_150905_g(itemstack));
if (itemstack.stackSize <= 0)
{
par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack)null);
}
return true;
}
}
}
}
else if (itemstack != null && itemstack.getItem() == Items.chicken)
{
if (!par1EntityPlayer.capabilities.isCreativeMode)
{
--itemstack.stackSize;
}
if (itemstack.stackSize <= 0)
{
par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack)null);
}
if (!this.worldObj.isRemote)
{
this.setTamed(true);
this.setPathToEntity((PathEntity)null);
this.setAttackTarget((EntityLivingBase)null);
this.aiSit.setSitting(true);
this.setHealth(20.0F);
this.setOwner(par1EntityPlayer.getCommandSenderName());
this.playTameEffect(true);
this.worldObj.setEntityState(this, (byte)7);
}
return true;
}
if (this.riddenByEntity == null && this.isTamed() && itemstack == null)
{
this.func_110237_h(par1EntityPlayer);
return true;
}
return super.interact(par1EntityPlayer);
}
private void func_110237_h(EntityPlayer par1EntityPlayer)
{
par1EntityPlayer.rotationYaw = this.rotationYaw;
par1EntityPlayer.rotationPitch = this.rotationPitch;
if (!this.worldObj.isRemote)
{
par1EntityPlayer.mountEntity(this);
}
}
}