void cNBTChunkSerializer::AddTNTEntity(cTNTEntity * a_TNT)
{
	m_Writer.BeginCompound("");
		AddBasicEntity(a_TNT, "PrimedTnt");
		m_Writer.AddByte("Fuse", static_cast<unsigned char>(a_TNT->GetFuseTicks()));
	m_Writer.EndCompound();
}
void cNBTChunkSerializer::AddPaintingEntity(cPainting * a_Painting)
{
	m_Writer.BeginCompound("");
		AddBasicEntity(a_Painting, "Painting");
		AddHangingEntity(a_Painting);
		m_Writer.AddString("Motive", a_Painting->GetName());
	m_Writer.EndCompound();
}
void cNBTChunkSerializer::AddExpOrbEntity(cExpOrb * a_ExpOrb)
{
	m_Writer.BeginCompound("");
		AddBasicEntity(a_ExpOrb, "XPOrb");
		m_Writer.AddShort("Age", static_cast<Int16>(a_ExpOrb->GetAge()));
		m_Writer.AddShort("Value", static_cast<Int16>(a_ExpOrb->GetReward()));
	m_Writer.EndCompound();
}
void cNBTChunkSerializer::AddPickupEntity(cPickup * a_Pickup)
{
	m_Writer.BeginCompound("");
		AddBasicEntity(a_Pickup, "Item");
		AddItem(a_Pickup->GetItem(), -1, "Item");
		m_Writer.AddShort("Age",    static_cast<Int16>(a_Pickup->GetAge()));
	m_Writer.EndCompound();
}
void cNBTChunkSerializer::AddExpOrbEntity(cExpOrb * a_ExpOrb)
{
	m_Writer.BeginCompound("");
		AddBasicEntity(a_ExpOrb, "XPOrb");
		m_Writer.AddShort("Health", (Int16)(unsigned char)a_ExpOrb->GetHealth());
		m_Writer.AddShort("Age", (Int16)a_ExpOrb->GetAge());
		m_Writer.AddShort("Value", (Int16)a_ExpOrb->GetReward());
	m_Writer.EndCompound();
}
void cNBTChunkSerializer::AddPickupEntity(cPickup * a_Pickup)
{
	m_Writer.BeginCompound("");
		AddBasicEntity(a_Pickup, "Item");
		AddItem(a_Pickup->GetItem(), -1, "Item");
		m_Writer.AddShort("Health", (Int16)(unsigned char)a_Pickup->GetHealth());
		m_Writer.AddShort("Age",    (Int16)a_Pickup->GetAge());
	m_Writer.EndCompound();
}
void cNBTChunkSerializer::AddItemFrameEntity(cItemFrame * a_ItemFrame)
{
	m_Writer.BeginCompound("");
		AddBasicEntity(a_ItemFrame, "ItemFrame");
		AddHangingEntity(a_ItemFrame);
		AddItem(a_ItemFrame->GetItem(), -1, "Item");
		m_Writer.AddByte("ItemRotation", static_cast<Byte>(a_ItemFrame->GetItemRotation()));
		m_Writer.AddFloat("ItemDropChance", 1.0F);
	m_Writer.EndCompound();
}
void cNBTChunkSerializer::AddFallingBlockEntity(cFallingBlock * a_FallingBlock)
{
	m_Writer.BeginCompound("");
		AddBasicEntity(a_FallingBlock, "FallingSand");
		m_Writer.AddInt("TileID", a_FallingBlock->GetBlockType());
		m_Writer.AddByte("Data", a_FallingBlock->GetBlockMeta());
		m_Writer.AddByte("Time", 1);  // Unused in Cuberite, Vanilla said to need nonzero
		m_Writer.AddByte("DropItem", 1);
		m_Writer.AddByte("HurtEntities", a_FallingBlock->GetBlockType() == E_BLOCK_ANVIL);
	m_Writer.EndCompound();
}
void cNBTChunkSerializer::AddProjectileEntity(cProjectileEntity * a_Projectile)
{
	m_Writer.BeginCompound("");
		AddBasicEntity(a_Projectile, a_Projectile->GetMCAClassName());
		m_Writer.AddByte("inGround", a_Projectile->IsInGround() ? 1 : 0);
		
		switch (a_Projectile->GetProjectileKind())
		{
			case cProjectileEntity::pkArrow:
			{
				cArrowEntity * Arrow = reinterpret_cast<cArrowEntity *>(a_Projectile);

				m_Writer.AddShort("xTile", static_cast<Int16>(Arrow->GetBlockHit().x));
				m_Writer.AddShort("yTile", static_cast<Int16>(Arrow->GetBlockHit().y));
				m_Writer.AddShort("zTile", static_cast<Int16>(Arrow->GetBlockHit().z));
				m_Writer.AddByte("pickup",   Arrow->GetPickupState());
				m_Writer.AddDouble("damage", Arrow->GetDamageCoeff());
				break;
			}
			case cProjectileEntity::pkSplashPotion:
			{
				cSplashPotionEntity * Potion = reinterpret_cast<cSplashPotionEntity *>(a_Projectile);
				
				m_Writer.AddInt("EffectType",                static_cast<Int16>(Potion->GetEntityEffectType()));
				m_Writer.AddInt("EffectDuration",            static_cast<Int16>(Potion->GetEntityEffect().GetDuration()));
				m_Writer.AddShort("EffectIntensity",         Potion->GetEntityEffect().GetIntensity());
				m_Writer.AddDouble("EffectDistanceModifier", Potion->GetEntityEffect().GetDistanceModifier());
				m_Writer.AddInt("PotionName",                Potion->GetPotionColor());
				break;
			}
			case cProjectileEntity::pkGhastFireball:
			{
				m_Writer.AddInt("ExplosionPower", 1);
				break;
			}
			case cProjectileEntity::pkFireCharge:
			case cProjectileEntity::pkWitherSkull:
			case cProjectileEntity::pkEnderPearl:
			{
				break;
			}
			default:
			{
				ASSERT(!"Unsaved projectile entity!");
			}
		}  // switch (ProjectileKind)

		if (!a_Projectile->GetCreatorName().empty())
		{
			m_Writer.AddString("ownerName", a_Projectile->GetCreatorName());
		}
	m_Writer.EndCompound();
}
void cNBTChunkSerializer::AddProjectileEntity(cProjectileEntity * a_Projectile)
{
	m_Writer.BeginCompound("");
		AddBasicEntity(a_Projectile, a_Projectile->GetMCAClassName());
		Vector3d Pos = a_Projectile->GetPosition();
		m_Writer.AddShort("xTile",  (Int16)floor(Pos.x));
		m_Writer.AddShort("yTile",  (Int16)floor(Pos.y));
		m_Writer.AddShort("zTile",  (Int16)floor(Pos.z));
		m_Writer.AddShort("inTile", 0);  // TODO: Query the block type
		m_Writer.AddShort("shake",  0);  // TODO: Any shake?
		m_Writer.AddByte ("inGround", a_Projectile->IsInGround() ? 1 : 0);
		
		switch (a_Projectile->GetProjectileKind())
		{
			case cProjectileEntity::pkArrow:
			{
				m_Writer.AddByte("inData",   0);  // TODO: Query the block meta (is it needed?)
				m_Writer.AddByte("pickup",   ((cArrowEntity *)a_Projectile)->GetPickupState());
				m_Writer.AddDouble("damage", ((cArrowEntity *)a_Projectile)->GetDamageCoeff());
				break;
			}
			case cProjectileEntity::pkGhastFireball:
			{
				m_Writer.AddInt("ExplosionPower", 1);
				// fall-through:
			}
			case cProjectileEntity::pkFireCharge:
			case cProjectileEntity::pkWitherSkull:
			case cProjectileEntity::pkEnderPearl:
			{
				m_Writer.BeginList("Motion", TAG_Double);
					m_Writer.AddDouble("", a_Projectile->GetSpeedX());
					m_Writer.AddDouble("", a_Projectile->GetSpeedY());
					m_Writer.AddDouble("", a_Projectile->GetSpeedZ());
				m_Writer.EndList();
				break;
			}
			default:
			{
				ASSERT(!"Unsaved projectile entity!");
			}
		}  // switch (ProjectileKind)
		cEntity * Creator = a_Projectile->GetCreator();
		if (Creator != NULL)
		{
			if (Creator->GetEntityType() == cEntity::etPlayer)
			{
				m_Writer.AddString("ownerName", ((cPlayer *)Creator)->GetName());
			}
		}
	m_Writer.EndCompound();
}
void cNBTChunkSerializer::AddMinecartEntity(cMinecart * a_Minecart)
{
	m_Writer.BeginCompound("");
	
		switch (a_Minecart->GetPayload())
		{
			case cMinecart::mpChest:
			{
				AddBasicEntity(a_Minecart, "MinecartChest");
				// Add chest contents into the Items tag:
				AddMinecartChestContents(reinterpret_cast<cMinecartWithChest *>(a_Minecart));
				break;
			}
			case cMinecart::mpFurnace:
			{
				AddBasicEntity(a_Minecart, "MinecartFurnace");
				// TODO: Add "Push" and "Fuel" tags
				break;
			}
			case cMinecart::mpHopper:
			{
				AddBasicEntity(a_Minecart, "MinecartHopper");
				// TODO: Add hopper contents?
				break;
			}
			case cMinecart::mpTNT:
			{
				AddBasicEntity(a_Minecart, "MinecartTNT");
				break;
			}
			case cMinecart::mpNone:
			{
				AddBasicEntity(a_Minecart, "MinecartRideable");
				break;
			}
		}  // switch (Payload)
	
	m_Writer.EndCompound();
}
Beispiel #12
0
void cNBTChunkSerializer::AddMinecartEntity(cMinecart * a_Minecart)
{
	const char * EntityClass = NULL;
	switch (a_Minecart->GetPayload())
	{
		case cMinecart::mpNone:    EntityClass = "MinecartRideable"; break;
		case cMinecart::mpChest:   EntityClass = "MinecartChest";    break;
		case cMinecart::mpFurnace: EntityClass = "MinecartFurnace";  break;
		case cMinecart::mpTNT:     EntityClass = "MinecartTNT";      break;
		case cMinecart::mpHopper:  EntityClass = "MinecartHopper";   break;
		default:
		{
			ASSERT(!"Unhandled minecart payload type");
			return;
		}
	}  // switch (payload)
	
	m_Writer.BeginCompound("");
		AddBasicEntity(a_Minecart, EntityClass);
		switch (a_Minecart->GetPayload())
		{
			case cMinecart::mpChest:
			{
				// Add chest contents into the Items tag:
				AddMinecartChestContents((cMinecartWithChest *)a_Minecart);
				break;
			}
			
			case cMinecart::mpFurnace:
			{
				// TODO: Add "Push" and "Fuel" tags
				break;
			}
		}  // switch (Payload)
	m_Writer.EndCompound();
}
void cNBTChunkSerializer::AddMonsterEntity(cMonster * a_Monster)
{
	const char * EntityClass = nullptr;
	switch (a_Monster->GetMobType())
	{
		case mtBat:           EntityClass = "Bat";            break;
		case mtBlaze:         EntityClass = "Blaze";          break;
		case mtCaveSpider:    EntityClass = "CaveSpider";     break;
		case mtChicken:       EntityClass = "Chicken";        break;
		case mtCow:           EntityClass = "Cow";            break;
		case mtCreeper:       EntityClass = "Creeper";        break;
		case mtEnderDragon:   EntityClass = "EnderDragon";    break;
		case mtEnderman:      EntityClass = "Enderman";       break;
		case mtGhast:         EntityClass = "Ghast";          break;
		case mtGiant:         EntityClass = "Giant";          break;
		case mtGuardian:      EntityClass = "Guardian";       break;
		case mtHorse:         EntityClass = "Horse";          break;
		case mtIronGolem:     EntityClass = "VillagerGolem";  break;
		case mtMagmaCube:     EntityClass = "LavaSlime";      break;
		case mtMooshroom:     EntityClass = "MushroomCow";    break;
		case mtOcelot:        EntityClass = "Ozelot";         break;
		case mtPig:           EntityClass = "Pig";            break;
		case mtRabbit:        EntityClass = "Rabbit";         break;
		case mtSheep:         EntityClass = "Sheep";          break;
		case mtSilverfish:    EntityClass = "Silverfish";     break;
		case mtSkeleton:      EntityClass = "Skeleton";       break;
		case mtSlime:         EntityClass = "Slime";          break;
		case mtSnowGolem:     EntityClass = "SnowMan";        break;
		case mtSpider:        EntityClass = "Spider";         break;
		case mtSquid:         EntityClass = "Squid";          break;
		case mtVillager:      EntityClass = "Villager";       break;
		case mtWitch:         EntityClass = "Witch";          break;
		case mtWither:        EntityClass = "WitherBoss";     break;
		case mtWolf:          EntityClass = "Wolf";           break;
		case mtZombie:        EntityClass = "Zombie";         break;
		case mtZombiePigman:  EntityClass = "PigZombie";      break;
		default:
		{
			ASSERT(!"Unhandled monster type");
			return;
		}
	}  // switch (payload)

	m_Writer.BeginCompound("");
		AddBasicEntity(a_Monster, EntityClass);
		m_Writer.BeginList("DropChances", TAG_Float);
			m_Writer.AddFloat("", a_Monster->GetDropChanceWeapon());
			m_Writer.AddFloat("", a_Monster->GetDropChanceHelmet());
			m_Writer.AddFloat("", a_Monster->GetDropChanceChestplate());
			m_Writer.AddFloat("", a_Monster->GetDropChanceLeggings());
			m_Writer.AddFloat("", a_Monster->GetDropChanceBoots());
		m_Writer.EndList();
		m_Writer.AddByte("CanPickUpLoot", (a_Monster->CanPickUpLoot())? 1 : 0);
		m_Writer.AddString("CustomName", a_Monster->GetCustomName());
		m_Writer.AddByte("CustomNameVisible", static_cast<Byte>(a_Monster->IsCustomNameAlwaysVisible()));
		switch (a_Monster->GetMobType())
		{
			case mtBat:
			{
				m_Writer.AddByte("BatFlags", reinterpret_cast<const cBat *>(a_Monster)->IsHanging());
				break;
			}
			case mtCreeper:
			{
				const cCreeper *Creeper = reinterpret_cast<const cCreeper *>(a_Monster);
				m_Writer.AddByte("powered", Creeper->IsCharged());
				m_Writer.AddByte("ignited", Creeper->IsBlowing());
				break;
			}
			case mtEnderman:
			{
				const cEnderman *Enderman = reinterpret_cast<const cEnderman *>(a_Monster);
				m_Writer.AddShort("carried",     static_cast<Int16>(Enderman->GetCarriedBlock()));
				m_Writer.AddShort("carriedData", static_cast<Int16>(Enderman->GetCarriedMeta()));
				break;
			}
			case mtHorse:
			{
				const cHorse *Horse = reinterpret_cast<const cHorse *>(a_Monster);
				m_Writer.AddByte("ChestedHorse",   Horse->IsChested()? 1 : 0);
				m_Writer.AddByte("EatingHaystack", Horse->IsEating()? 1 : 0);
				m_Writer.AddByte("Tame",           Horse->IsTame()? 1: 0);
				m_Writer.AddInt ("Type",           Horse->GetHorseType());
				m_Writer.AddInt ("Color",          Horse->GetHorseColor());
				m_Writer.AddInt ("Style",          Horse->GetHorseStyle());
				m_Writer.AddInt ("ArmorType",      Horse->GetHorseArmour());
				m_Writer.AddByte("Saddle",         Horse->IsSaddled()? 1 : 0);
				m_Writer.AddInt ("Age",            Horse->GetAge());
				break;
			}
			case mtMagmaCube:
			{
				m_Writer.AddInt("Size", reinterpret_cast<const cMagmaCube *>(a_Monster)->GetSize());
				break;
			}
			case mtSheep:
			{
				const cSheep *Sheep = reinterpret_cast<const cSheep *>(a_Monster);
				m_Writer.AddByte("Sheared", Sheep->IsSheared()? 1 : 0);
				m_Writer.AddByte("Color",   static_cast<Byte>(Sheep->GetFurColor()));
				m_Writer.AddInt ("Age",     Sheep->GetAge());
				break;
			}
			case mtSlime:
			{
				m_Writer.AddInt("Size", reinterpret_cast<const cSlime *>(a_Monster)->GetSize());
				break;
			}
			case mtSkeleton:
			{
				m_Writer.AddByte("SkeletonType", (reinterpret_cast<const cSkeleton *>(a_Monster)->IsWither() ? 1 : 0));
				break;
			}
			case mtVillager:
			{
				const cVillager *Villager = reinterpret_cast<const cVillager *>(a_Monster);
				m_Writer.AddInt("Profession", Villager->GetVilType());
				m_Writer.AddInt("Age",        Villager->GetAge());
				break;
			}
			case mtWither:
			{
				m_Writer.AddInt("Invul", static_cast<Int32>(reinterpret_cast<const cWither *>(a_Monster)->GetWitherInvulnerableTicks()));
				break;
			}
			case mtWolf:
			{
				const cWolf *Wolf = reinterpret_cast<const cWolf *>(a_Monster);
				if (!Wolf->GetOwnerName().empty())
				{
					m_Writer.AddString("Owner", Wolf->GetOwnerName());
				}
				if (!Wolf->GetOwnerUUID().empty())
				{
					m_Writer.AddString("OwnerUUID", Wolf->GetOwnerUUID());
				}
				m_Writer.AddByte("Sitting",     Wolf->IsSitting() ? 1 : 0);
				m_Writer.AddByte("Angry",       Wolf->IsAngry() ? 1 : 0);
				m_Writer.AddByte("CollarColor", static_cast<Byte>(Wolf->GetCollarColor()));
				m_Writer.AddInt ("Age",         Wolf->GetAge());
				break;
			}
			case mtZombie:
			{
				const cZombie *Zombie = reinterpret_cast<const cZombie *>(a_Monster);
				m_Writer.AddByte("IsVillager",   Zombie->IsVillagerZombie() ? 1 : 0);
				m_Writer.AddByte("IsConverting", Zombie->IsConverting() ? 1 : 0);
				m_Writer.AddInt ("Age",          Zombie->GetAge());
				break;
			}
			case mtZombiePigman:
			{
				m_Writer.AddInt("Age", reinterpret_cast<const cZombiePigman *>(a_Monster)->GetAge());
				break;
			}
			case mtOcelot:
			{
				m_Writer.AddInt("Age", reinterpret_cast<const cOcelot *>(a_Monster)->GetAge());
				break;
			}
			case mtPig:
			{
				m_Writer.AddInt("Age", reinterpret_cast<const cPig *>(a_Monster)->GetAge());
				break;
			}
			case mtRabbit:
			{
				const cRabbit *Rabbit = reinterpret_cast<const cRabbit *>(a_Monster);
				m_Writer.AddInt("RabbitType",      Rabbit->GetRabbitTypeAsNumber());
				m_Writer.AddInt("MoreCarrotTicks", Rabbit->GetMoreCarrotTicks());
				m_Writer.AddInt("Age",             Rabbit->GetAge());
				break;
			}
			case mtInvalidType:
			case mtBlaze:
			case mtCaveSpider:
			case mtChicken:
			case mtCow:
			case mtEnderDragon:
			case mtGhast:
			case mtGiant:
			case mtGuardian:
			case mtIronGolem:
			case mtMooshroom:
			case mtSilverfish:
			case mtSnowGolem:
			case mtSpider:
			case mtSquid:
			case mtWitch:
			{
				// Other mobs have no special tags.
				break;
			}
		}
	m_Writer.EndCompound();
}
void cNBTChunkSerializer::AddEnderCrystalEntity(cEnderCrystal * a_EnderCrystal)
{
	m_Writer.BeginCompound("");
		AddBasicEntity(a_EnderCrystal, "EnderCrystal");
	m_Writer.EndCompound();
}
void cNBTChunkSerializer::AddBoatEntity(cBoat * a_Boat)
{
	m_Writer.BeginCompound("");
		AddBasicEntity(a_Boat, "Boat");
	m_Writer.EndCompound();
}
void cNBTChunkSerializer::AddMonsterEntity(cMonster * a_Monster)
{
	const char * EntityClass = NULL;
	switch (a_Monster->GetMobType())
	{
		case cMonster::mtBat:           EntityClass = "Bat";            break;
		case cMonster::mtBlaze:         EntityClass = "Blaze";          break;
		case cMonster::mtCaveSpider:    EntityClass = "CaveSpider";     break;
		case cMonster::mtChicken:       EntityClass = "Chicken";        break;
		case cMonster::mtCow:           EntityClass = "Cow";            break;
		case cMonster::mtCreeper:       EntityClass = "Creeper";        break;
		case cMonster::mtEnderDragon:   EntityClass = "EnderDragon";    break;
		case cMonster::mtEnderman:      EntityClass = "Enderman";       break;
		case cMonster::mtGhast:         EntityClass = "Ghast";          break;
		case cMonster::mtGiant:         EntityClass = "Giant";          break;
		case cMonster::mtHorse:         EntityClass = "Horse";          break;
		case cMonster::mtIronGolem:     EntityClass = "VillagerGolem";  break;
		case cMonster::mtMagmaCube:     EntityClass = "LavaSlime";      break;
		case cMonster::mtMooshroom:     EntityClass = "MushroomCow";    break;
		case cMonster::mtOcelot:        EntityClass = "Ozelot";         break;
		case cMonster::mtPig:           EntityClass = "Pig";            break;
		case cMonster::mtSheep:         EntityClass = "Sheep";          break;
		case cMonster::mtSilverfish:    EntityClass = "Silverfish";     break;
		case cMonster::mtSkeleton:      EntityClass = "Skeleton";       break;
		case cMonster::mtSlime:         EntityClass = "Slime";          break;
		case cMonster::mtSnowGolem:     EntityClass = "SnowMan";        break;
		case cMonster::mtSpider:        EntityClass = "Spider";         break;
		case cMonster::mtSquid:         EntityClass = "Squid";          break;
		case cMonster::mtVillager:      EntityClass = "Villager";       break;
		case cMonster::mtWitch:         EntityClass = "Witch";          break;
		case cMonster::mtWither:        EntityClass = "WitherBoss";     break;
		case cMonster::mtWolf:          EntityClass = "Wolf";           break;
		case cMonster::mtZombie:        EntityClass = "Zombie";         break;
		case cMonster::mtZombiePigman:  EntityClass = "PigZombie";      break;
		default:
		{
			ASSERT(!"Unhandled monster type");
			return;
		}
	}  // switch (payload)

	m_Writer.BeginCompound("");
		AddBasicEntity(a_Monster, EntityClass);
		m_Writer.BeginList("DropChances", TAG_Float);
			m_Writer.AddFloat("", a_Monster->GetDropChanceWeapon());
			m_Writer.AddFloat("", a_Monster->GetDropChanceHelmet());
			m_Writer.AddFloat("", a_Monster->GetDropChanceChestplate());
			m_Writer.AddFloat("", a_Monster->GetDropChanceLeggings());
			m_Writer.AddFloat("", a_Monster->GetDropChanceBoots());
		m_Writer.EndList();
		m_Writer.AddByte("CanPickUpLoot", (char)a_Monster->CanPickUpLoot());
		switch (a_Monster->GetMobType())
		{
			case cMonster::mtBat:
			{
				m_Writer.AddByte("BatFlags", ((const cBat *)a_Monster)->IsHanging());
				break;
			}
			case cMonster::mtCreeper:
			{
				m_Writer.AddByte("powered", ((const cCreeper *)a_Monster)->IsCharged());
				m_Writer.AddByte("ignited", ((const cCreeper *)a_Monster)->IsBlowing());
				break;
			}
			case cMonster::mtEnderman:
			{
				m_Writer.AddShort("carried",     (Int16)((const cEnderman *)a_Monster)->GetCarriedBlock());
				m_Writer.AddShort("carriedData", (Int16)((const cEnderman *)a_Monster)->GetCarriedMeta());
				break;
			}
			case cMonster::mtHorse:
			{
				const cHorse & Horse = *((const cHorse *)a_Monster);
				m_Writer.AddByte("ChestedHorse",   Horse.IsChested());
				m_Writer.AddByte("EatingHaystack", Horse.IsEating());
				m_Writer.AddByte("Tame",           Horse.IsTame());
				m_Writer.AddInt ("Type",           Horse.GetHorseType());
				m_Writer.AddInt ("Color",          Horse.GetHorseColor());
				m_Writer.AddInt ("Style",          Horse.GetHorseStyle());
				m_Writer.AddInt ("ArmorType",      Horse.GetHorseArmour());
				m_Writer.AddByte("Saddle",         Horse.IsSaddled());
				break;
			}
			case cMonster::mtMagmaCube:
			{
				m_Writer.AddInt("Size", ((const cMagmaCube *)a_Monster)->GetSize());
				break;
			}
			case cMonster::mtSheep:
			{
				m_Writer.AddByte("Sheared", ((const cSheep *)a_Monster)->IsSheared());
				m_Writer.AddByte("Color",   ((const cSheep *)a_Monster)->GetFurColor());
				break;
			}
			case cMonster::mtSlime:
			{
				m_Writer.AddInt("Size", ((const cSlime *)a_Monster)->GetSize());
				break;
			}
			case cMonster::mtSkeleton:
			{
				m_Writer.AddByte("SkeletonType", (((const cSkeleton *)a_Monster)->IsWither() ? 1 : 0));
				break;
			}
			case cMonster::mtVillager:
			{
				m_Writer.AddInt("Profession", ((const cVillager *)a_Monster)->GetVilType());
				break;
			}
			case cMonster::mtWither:
			{
				m_Writer.AddInt("Invul", ((const cWither *)a_Monster)->GetWitherInvulnerableTicks());
				break;
			}
			case cMonster::mtWolf:
			{
				m_Writer.AddString("Owner", ((const cWolf *)a_Monster)->GetOwner());
				m_Writer.AddByte("Sitting", (((const cWolf *)a_Monster)->IsSitting() ? 1 : 0));
				m_Writer.AddByte("Angry", (((const cWolf *)a_Monster)->IsAngry() ? 1 : 0));
				m_Writer.AddInt("CollarColor", ((const cWolf *)a_Monster)->GetCollarColor());
				break;
			}
			case cMonster::mtZombie:
			{
				m_Writer.AddByte("IsVillager",   (((const cZombie *)a_Monster)->IsVillagerZombie() ? 1 : 0));
				m_Writer.AddByte("IsBaby",       (((const cZombie *)a_Monster)->IsBaby() ? 1 : 0));
				m_Writer.AddByte("IsConverting", (((const cZombie *)a_Monster)->IsConverting() ? 1 : 0));
				break;
			}
		}
	m_Writer.EndCompound();
}