@Override protected void init(String name) { super.init(name); int r = rand.nextInt(100) + 1; lastOwnerX = lastOwnerY = lastOwnerZ = 0; idleSpot = null; pixelmon.entities.pixelmon.stats.Aggression a = baseStats.aggression; if (a == null) { aggression = Aggression.passive; return; } if (r < a.timid) aggression = Aggression.timid; else if (r < a.timid + a.passive) aggression = Aggression.passive; else if (r < a.timid + a.passive + a.aggressive) aggression = Aggression.aggressive; else aggression = Aggression.passive; }
@Override public void onEntityUpdate() { super.onEntityUpdate(); if (aiHelper == null && baseStats != null) aiHelper = new AIHelper(getName(), this, tasks); }
@Override public void readEntityFromNBT(NBTTagCompound nbt) { super.readEntityFromNBT(nbt); aggression = Aggression.getAggression(nbt.getInteger("Aggression")); }
@Override public void writeEntityToNBT(NBTTagCompound nbt) { super.writeEntityToNBT(nbt); if (aggression == null) aggression = Aggression.passive; nbt.setInteger("Aggression", aggression.index); }