예제 #1
0
 /** (abstract) Protected helper method to read subclass entity data from NBT. */
 public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) {
   super.readEntityFromNBT(par1NBTTagCompound);
   this.setAngry(par1NBTTagCompound.getBoolean("Angry"));
   setName(par1NBTTagCompound.getString("WolfName"));
   if (par1NBTTagCompound.hasKey("CollarColor")) {
     this.setCollarColor(par1NBTTagCompound.getByte("CollarColor"));
   }
 }
  /** (abstract) Protected helper method to read subclass entity data from NBT. */
  public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) {
    super.readEntityFromNBT(par1NBTTagCompound);

    if (par1NBTTagCompound.getBoolean("IsBaby")) {
      this.setChild(true);
    }

    if (par1NBTTagCompound.getBoolean("IsVillager")) {
      this.setVillager(true);
    }

    if (par1NBTTagCompound.hasKey("ConversionTime", 99)
        && par1NBTTagCompound.getInteger("ConversionTime") > -1) {
      this.startConversion(par1NBTTagCompound.getInteger("ConversionTime"));
    }

    this.func_146070_a(par1NBTTagCompound.getBoolean("CanBreakDoors"));
  }
 @Override
 public void readEntityFromNBT(NBTTagCompound nbt) {
   super.readEntityFromNBT(nbt);
   this.slimelingInventory.readFromNBT(nbt.getTagList("SlimelingInventory"));
   this.colorRed = nbt.getFloat("SlimeRed");
   this.colorGreen = nbt.getFloat("SlimeGreen");
   this.colorBlue = nbt.getFloat("SlimeBlue");
   this.age = nbt.getInteger("SlimelingAge");
   this.slimelingName = nbt.getString("SlimelingName");
   this.favFoodID = nbt.getInteger("FavFoodID");
   this.attackDamage = nbt.getFloat("SlimelingDamage");
   this.kills = nbt.getInteger("SlimelingKills");
   this.setColorRed(this.colorRed);
   this.setColorGreen(this.colorGreen);
   this.setColorBlue(this.colorBlue);
   this.setAge(this.age);
   this.setName(this.slimelingName);
   this.setKillCount(this.kills);
 }
예제 #4
0
  @Override
  public void readEntityFromNBT(NBTTagCompound tagCompound) {
    super.readEntityFromNBT(tagCompound);

    // Load Personality
    Personality personality =
        GsonHelper.fromJson(tagCompound.getString("Personality"), Personality.class);
    if (personality != null) {
      this.personality = personality;
      System.out.println(this.personality);
    }

    // Load parts list
    NBTTagList tagList = tagCompound.getTagList("Parts", 8);
    String s = "";
    for (int i = 0; i < tagList.tagCount(); i++) {
      s += tagList.getStringTagAt(i) + ",";
    }
    this.dataWatcher.updateObject(18, s);
    this.setCombatAI();
    this.inventory.func_110133_a(this.getCommandSenderName());
  }
예제 #5
0
 /** (abstract) Protected helper method to read subclass entity data from NBT. */
 public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) {
   super.readEntityFromNBT(par1NBTTagCompound);
   this.setAngry(par1NBTTagCompound.getBoolean("Angry"));
   setStone(par1NBTTagCompound.getInteger("Stoneform"));
   switch (isStone()) {
     case 0:
       setStone(3);
     case 1:
       this.tasks.addTask(2, leapTask);
       this.tasks.addTask(3, attackTaskA);
       this.tasks.addTask(4, wanderTaskA);
       this.tasks.addTask(5, navTaskA);
       this.tasks.addTask(7, trackTask);
       break;
     case 2:
       this.tasks.addTask(2, leapTask);
       this.tasks.addTask(3, attackTaskB);
       this.tasks.addTask(4, wanderTaskB);
       this.tasks.addTask(5, navTaskB);
       this.tasks.addTask(7, trackTask);
       break;
   }
 }