summaryrefslogtreecommitdiffstats
path: root/src/BlockEntities
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-11-29 15:20:44 +0100
committerHowaner <franzi.moos@googlemail.com>2014-11-29 15:20:44 +0100
commit2478e290f9f7f6a74bba4ac885cfaef6327bc9ee (patch)
tree54d9f9d97e3a1ed850f63292e002938e3d8d3ff0 /src/BlockEntities
parentMerge branch 'master' into MobSpawner (diff)
downloadcuberite-2478e290f9f7f6a74bba4ac885cfaef6327bc9ee.tar
cuberite-2478e290f9f7f6a74bba4ac885cfaef6327bc9ee.tar.gz
cuberite-2478e290f9f7f6a74bba4ac885cfaef6327bc9ee.tar.bz2
cuberite-2478e290f9f7f6a74bba4ac885cfaef6327bc9ee.tar.lz
cuberite-2478e290f9f7f6a74bba4ac885cfaef6327bc9ee.tar.xz
cuberite-2478e290f9f7f6a74bba4ac885cfaef6327bc9ee.tar.zst
cuberite-2478e290f9f7f6a74bba4ac885cfaef6327bc9ee.zip
Diffstat (limited to 'src/BlockEntities')
-rw-r--r--src/BlockEntities/MobHeadEntity.h12
-rw-r--r--src/BlockEntities/MobSpawnerEntity.cpp47
-rw-r--r--src/BlockEntities/MobSpawnerEntity.h10
3 files changed, 12 insertions, 57 deletions
diff --git a/src/BlockEntities/MobHeadEntity.h b/src/BlockEntities/MobHeadEntity.h
index e26c0bdd0..7f08c5ab2 100644
--- a/src/BlockEntities/MobHeadEntity.h
+++ b/src/BlockEntities/MobHeadEntity.h
@@ -33,22 +33,22 @@ public:
// tolua_begin
- /** Set the Type */
+ /** Set the type of the mob head */
void SetType(const eMobHeadType & a_SkullType);
- /** Set the Rotation */
+ /** Set the rotation of the mob head */
void SetRotation(eMobHeadRotation a_Rotation);
- /** Set the Player Name for Mobheads with Player type */
+ /** Set the player name for mob heads with player type */
void SetOwner(const AString & a_Owner);
- /** Get the Type */
+ /** Returns the type of the mob head */
eMobHeadType GetType(void) const { return m_Type; }
- /** Get the Rotation */
+ /** Returns the rotation of the mob head */
eMobHeadRotation GetRotation(void) const { return m_Rotation; }
- /** Get the setted Player Name */
+ /** Returns the player name of the mob head */
AString GetOwner(void) const { return m_Owner; }
// tolua_end
diff --git a/src/BlockEntities/MobSpawnerEntity.cpp b/src/BlockEntities/MobSpawnerEntity.cpp
index 696a109d1..26499972d 100644
--- a/src/BlockEntities/MobSpawnerEntity.cpp
+++ b/src/BlockEntities/MobSpawnerEntity.cpp
@@ -49,7 +49,7 @@ void cMobSpawnerEntity::UsedBy(cPlayer * a_Player)
{
a_Player->GetInventory().RemoveOneEquippedItem();
}
- LOGD("Changed monster spawner at {%d, %d, %d} to type %s.", GetPosX(), GetPosY(), GetPosZ(), GetEntityName().c_str());
+ LOGD("Changed monster spawner at {%d, %d, %d} to type %s.", GetPosX(), GetPosY(), GetPosZ(), cMonster::MobTypeToString(MonsterType).c_str());
}
}
@@ -195,51 +195,6 @@ void cMobSpawnerEntity::SpawnEntity(void)
-AString cMobSpawnerEntity::GetEntityName() const
-{
- switch (m_Entity)
- {
- case mtBat: return "Bat";
- case mtBlaze: return "Blaze";
- case mtCaveSpider: return "CaveSpider";
- case mtChicken: return "Chicken";
- case mtCow: return "Cow";
- case mtCreeper: return "Creeper";
- case mtEnderDragon: return "EnderDragon";
- case mtEnderman: return "Enderman";
- case mtGhast: return "Ghast";
- case mtGiant: return "Giant";
- case mtHorse: return "EntityHorse";
- case mtIronGolem: return "VillagerGolem";
- case mtMagmaCube: return "LavaSlime";
- case mtMooshroom: return "MushroomCow";
- case mtOcelot: return "Ozelot";
- case mtPig: return "Pig";
- case mtSheep: return "Sheep";
- case mtSilverfish: return "Silverfish";
- case mtSkeleton: return "Skeleton";
- case mtSlime: return "Slime";
- case mtSnowGolem: return "SnowMan";
- case mtSpider: return "Spider";
- case mtSquid: return "Squid";
- case mtVillager: return "Villager";
- case mtWitch: return "Witch";
- case mtWither: return "WitherBoss";
- case mtWolf: return "Wolf";
- case mtZombie: return "Zombie";
- case mtZombiePigman: return "PigZombie";
- default:
- {
- ASSERT(!"Unknown monster type!");
- return "Pig";
- }
- }
-}
-
-
-
-
-
int cMobSpawnerEntity::GetNearbyPlayersNum(void)
{
Vector3d SpawnerPos(m_PosX + 0.5, m_PosY + 0.5, m_PosZ + 0.5);
diff --git a/src/BlockEntities/MobSpawnerEntity.h b/src/BlockEntities/MobSpawnerEntity.h
index 073eb03ab..0a3367c97 100644
--- a/src/BlockEntities/MobSpawnerEntity.h
+++ b/src/BlockEntities/MobSpawnerEntity.h
@@ -35,22 +35,22 @@ public:
/** Spawns the entity. This function automaticly change the spawn delay! */
void SpawnEntity(void);
- /** Returns the entity type who will be spawn by this mob spawner. */
+ /** Returns the entity type that will be spawn by this mob spawner. */
eMonsterType GetEntity(void) const { return m_Entity; }
/** Sets the entity type who will be spawn by this mob spawner. */
void SetEntity(eMonsterType a_EntityType) { m_Entity = a_EntityType; }
- /** Returns the entity name. (Required by the protocol) */
- AString GetEntityName(void) const;
-
- /** Returns the spawn delay. */
+ /** Returns the spawn delay. This is the tick delay that is needed to spawn new monsters. */
short GetSpawnDelay(void) const { return m_SpawnDelay; }
/** Sets the spawn delay. */
void SetSpawnDelay(short a_Delay) { m_SpawnDelay = a_Delay; }
+ /** Returns the amount of the nearby players in a 16-block radius. */
int GetNearbyPlayersNum(void);
+
+ /** Returns the amount of this monster type in a 8-block radius (Y: 4-block radius). */
int GetNearbyMonsterNum(eMonsterType a_EntityType);
// tolua_end