예제 #1
0
 public void writeEntityToNBT(NBTTagCompound nbttagcompound) {
   super.writeEntityToNBT(nbttagcompound);
   nbttagcompound.setTag("Inventory", inventory.writeToNBT(new NBTTagList()));
   nbttagcompound.setInteger("Dimension", dimension);
   nbttagcompound.setBoolean("Sleeping", sleeping);
   nbttagcompound.setShort("SleepTimer", (short) sleepTimer);
   nbttagcompound.setFloat("XpP", currentXP);
   nbttagcompound.setInteger("XpLevel", playerLevel);
   nbttagcompound.setInteger("XpTotal", totalXP);
   if (playerSpawnCoordinate != null) {
     nbttagcompound.setInteger("SpawnX", playerSpawnCoordinate.posX);
     nbttagcompound.setInteger("SpawnY", playerSpawnCoordinate.posY);
     nbttagcompound.setInteger("SpawnZ", playerSpawnCoordinate.posZ);
   }
   foodStats.writeStatsToNBT(nbttagcompound);
   capabilities.writeCapabilitiesToNBT(nbttagcompound);
 }
예제 #2
0
  /** (abstract) Protected helper method to write subclass entity data to NBT. */
  public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) {
    super.writeEntityToNBT(par1NBTTagCompound);
    par1NBTTagCompound.setTag("Inventory", this.inventory.writeToNBT(new NBTTagList()));
    par1NBTTagCompound.setInteger("Dimension", this.dimension);
    par1NBTTagCompound.setBoolean("Sleeping", this.sleeping);
    par1NBTTagCompound.setShort("SleepTimer", (short) this.sleepTimer);
    par1NBTTagCompound.setFloat("XpP", this.experience);
    par1NBTTagCompound.setInteger("XpLevel", this.experienceLevel);
    par1NBTTagCompound.setInteger("XpTotal", this.experienceTotal);

    if (this.spawnChunk != null) {
      par1NBTTagCompound.setInteger("SpawnX", this.spawnChunk.posX);
      par1NBTTagCompound.setInteger("SpawnY", this.spawnChunk.posY);
      par1NBTTagCompound.setInteger("SpawnZ", this.spawnChunk.posZ);
    }

    this.foodStats.writeNBT(par1NBTTagCompound);
    this.capabilities.writeCapabilitiesToNBT(par1NBTTagCompound);
  }
 public void writeEntityToNBT(NBTTagCompound nbttagcompound) {
   super.writeEntityToNBT(nbttagcompound);
   nbttagcompound.setInteger("Size", getSlimeSize() - 1);
 }
예제 #4
0
 /** (abstract) Protected helper method to write subclass entity data to NBT. */
 public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) {
   super.writeEntityToNBT(par1NBTTagCompound);
   par1NBTTagCompound.setInteger("Size", getSlimeSize() - 1);
 }