Example #1
0
  /** (abstract) Protected helper method to read subclass entity data from NBT. */
  public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) {
    super.readEntityFromNBT(par1NBTTagCompound);
    String var2 = par1NBTTagCompound.getString("Owner");

    if (var2.length() > 0) {
      this.setOwner(var2);
      this.setTamed(true);
    }

    this.aiSit.setSitting(par1NBTTagCompound.getBoolean("Sitting"));
    this.setSitting(par1NBTTagCompound.getBoolean("Sitting"));
  }
Example #2
0
  /** (abstract) Protected helper method to read subclass entity data from NBT. */
  public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) {
    super.readEntityFromNBT(par1NBTTagCompound);
    animalID = par1NBTTagCompound.getLong("Animal ID");
    sex = par1NBTTagCompound.getInteger("Sex");
    size_mod = par1NBTTagCompound.getFloat("Size Modifier");
    hunger = par1NBTTagCompound.getInteger("Hunger");
    pregnant = par1NBTTagCompound.getBoolean("Pregnant");
    mateSizeMod = par1NBTTagCompound.getFloat("MateSize");
    conception = par1NBTTagCompound.getLong("ConceptionTime");
    int m = 0;
    String n = "Child" + m;
    while (par1NBTTagCompound.hasKey(n)) {
      n = "Child" + m;
      m++;
      for (int j = 0; j < worldObj.loadedEntityList.size(); j++) {
        Entity k = (Entity) worldObj.loadedEntityList.get(j);
        if (k instanceof EntityAnimalTFC) {
          long i = par1NBTTagCompound.getLong(n);

          if (i == ((EntityAnimalTFC) k).animalID) {
            children.add((EntityAnimalTFC) k);
          }
        }
      }
    }
    long i = par1NBTTagCompound.getLong("Mate number");
    if (i != -1) {
      for (int j = 0; j < worldObj.loadedEntityList.size(); j++) {
        Entity k = (Entity) worldObj.loadedEntityList.get(j);
        if (k instanceof EntityAnimalTFC) {
          if (i == ((EntityAnimalTFC) k).animalID) {
            mate = (EntityAnimalTFC) k;
            break;
          }
        }
      }
    }
    if (isChild() && par1NBTTagCompound.getLong("Parent") != -1) {
      i = par1NBTTagCompound.getLong("Parent");
      for (int j = 0; j < worldObj.loadedEntityList.size(); j++) {
        Entity k = (Entity) worldObj.loadedEntityList.get(j);
        if (k instanceof EntityAnimalTFC) {
          if (i == ((EntityAnimalTFC) k).animalID) {
            parent = (EntityAnimalTFC) k;
            break;
          }
        }
      }
    }
    adultTime = par1NBTTagCompound.getLong("AdultTime");
    birthTime = par1NBTTagCompound.getLong("BirthTime");
  }
Example #3
0
 /** (abstract) Protected helper method to read subclass entity data from NBT. */
 public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) {
   super.readEntityFromNBT(par1NBTTagCompound);
   this.setSheared(par1NBTTagCompound.getBoolean("Sheared"));
   this.setFleeceColor(par1NBTTagCompound.getByte("Color"));
 }
 public void readEntityFromNBT(NBTTagCompound nbttagcompound) {
   super.readEntityFromNBT(nbttagcompound);
   counterEntity = nbttagcompound.getInteger("CounterEntity");
 }
Example #5
0
 /** (abstract) Protected helper method to read subclass entity data from NBT. */
 public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) {
   super.readEntityFromNBT(par1NBTTagCompound);
   this.setSaddled(par1NBTTagCompound.getBoolean("Saddle"));
 }