Esempio n. 1
0
 @Override
 public void writeToNBT(NBTTagCompound tag) {
   super.writeToNBT(tag);
   if (playerName != null) {
     tag.setString("playerName", playerName);
   }
   inventory.writeToNBT(tag);
 }
Esempio n. 2
0
 public EntityGhost(World world, String playerName, IInventory playerInvent) {
   this(world);
   this.playerName = playerName;
   // use the dead players skin (ew)
   // if (world.isRemote) {
   // this.skinUrl = "http://skins.minecraft.net/MinecraftSkins/"
   // + StringUtils.stripControlCodes(playerName) + ".png";
   // }
   // copy the inventory from the player inventory
   inventory.copyFrom(playerInvent);
 }
Esempio n. 3
0
 @Override
 public void readFromNBT(NBTTagCompound tag) {
   super.readFromNBT(tag);
   if (tag.hasKey("playerName")) {
     playerName = tag.getString("playerName");
     // Depreciated
     // if (worldObj.isRemote) {
     // skinUrl = "http://skins.minecraft.net/MinecraftSkins/"
     // + StringUtils.stripControlCodes(playerName) + ".png";
     // }
   }
   inventory.readFromNBT(tag);
 }