1
0

AnvilStats: Overall statistics and mobspawner statistics.

git-svn-id: http://mc-server.googlecode.com/svn/trunk@899 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
madmaxoft@gmail.com
2012-09-29 13:33:45 +00:00
parent b903b29057
commit cead22a206
8 changed files with 574 additions and 66 deletions

View File

@@ -10,6 +10,47 @@
struct
{
eEntityType Type;
const char * String;
} g_EntityTypes[] =
{
{entBat, "Bat"},
{entBlaze, "Blaze"},
{entCaveSpider, "CaveSpider"},
{entChicken, "Chicken"},
{entCow, "Cow"},
{entCreeper, "Creeper"},
{entEnderDragon, "EnderDragon"},
{entEnderman, "Enderman"},
{entGhast, "Ghast"},
{entGiant, "Giant"},
{entLavaSlime, "LavaSlime"},
{entMushroomCow, "MushroomCow"},
{entOzelot, "Ozelot"},
{entPig, "Pig"},
{entPigZombie, "PigZombie"},
{entSheep, "Sheep"},
{entSilverfish, "Slverfish"},
{entSkeleton, "Skeleton"},
{entSlime, "Slime"},
{entSnowMan, "SnowMan"},
{entSpider, "Spider"},
{entSquid, "Squid"},
{entVillager, "Villager"},
{entVillagerGolem, "VillagerGolem"},
{entWitch, "Witch"},
{entWitherBoss, "WitherBoss"},
{entWolf, "Wolf"},
{entZombie, "Zombie"},
{entUnknown, "Unknown"},
} ;
const char * GetBiomeString(unsigned char a_Biome)
{
static const char * BiomeNames[] = // Biome names, as equivalent to their index
@@ -203,6 +244,31 @@ const char * GetBlockTypeString(unsigned char a_BlockType)
eEntityType GetEntityType(const AString & a_EntityTypeString)
{
for (int i = 0; i < ARRAYCOUNT(g_EntityTypes); i++)
{
if (a_EntityTypeString == g_EntityTypes[i].String)
{
return g_EntityTypes[i].Type;
}
}
return entUnknown;
}
extern const char * GetEntityTypeString(eEntityType a_EntityType)
{
return g_EntityTypes[a_EntityType].String;
}
int GetNumCores(void)
{
// Get number of cores by querying the system process affinity mask (Windows-specific)