Fixed some small passive mob issues (#4057)
* Chickens can be bred with seeds, beetroot seeds, melon seeds, or pumpkin seeds Ref: https://minecraft.gamepedia.com/Chicken#Baby_chicken * Baby passive mobs don't drop items * Fixed the size of some mobs
This commit is contained in:
parent
744cdb726d
commit
e585595ae6
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
|
|
||||||
cChicken::cChicken(void) :
|
cChicken::cChicken(void) :
|
||||||
super("Chicken", mtChicken, "entity.chicken.hurt", "entity.chicken.death", 0.3, 0.4),
|
super("Chicken", mtChicken, "entity.chicken.hurt", "entity.chicken.death", 0.4, 0.7),
|
||||||
m_EggDropTimer(0)
|
m_EggDropTimer(0)
|
||||||
{
|
{
|
||||||
SetGravity(-2.0f);
|
SetGravity(-2.0f);
|
||||||
@ -34,14 +34,10 @@ void cChicken::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
|
|||||||
return; // Babies don't lay eggs
|
return; // Babies don't lay eggs
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((m_EggDropTimer == 6000) && GetRandomProvider().RandBool())
|
if (
|
||||||
{
|
((m_EggDropTimer == 6000) && GetRandomProvider().RandBool()) ||
|
||||||
cItems Drops;
|
m_EggDropTimer == 12000
|
||||||
m_EggDropTimer = 0;
|
)
|
||||||
Drops.push_back(cItem(E_ITEM_EGG, 1));
|
|
||||||
m_World->SpawnItemPickups(Drops, GetPosX(), GetPosY(), GetPosZ(), 10);
|
|
||||||
}
|
|
||||||
else if (m_EggDropTimer == 12000)
|
|
||||||
{
|
{
|
||||||
cItems Drops;
|
cItems Drops;
|
||||||
m_EggDropTimer = 0;
|
m_EggDropTimer = 0;
|
||||||
@ -60,6 +56,11 @@ void cChicken::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
|
|||||||
|
|
||||||
void cChicken::GetDrops(cItems & a_Drops, cEntity * a_Killer)
|
void cChicken::GetDrops(cItems & a_Drops, cEntity * a_Killer)
|
||||||
{
|
{
|
||||||
|
if (IsBaby())
|
||||||
|
{
|
||||||
|
return; // Babies don't drop items
|
||||||
|
}
|
||||||
|
|
||||||
unsigned int LootingLevel = 0;
|
unsigned int LootingLevel = 0;
|
||||||
if (a_Killer != nullptr)
|
if (a_Killer != nullptr)
|
||||||
{
|
{
|
||||||
|
@ -21,6 +21,9 @@ public:
|
|||||||
|
|
||||||
virtual void GetFollowedItems(cItems & a_Items) override
|
virtual void GetFollowedItems(cItems & a_Items) override
|
||||||
{
|
{
|
||||||
|
a_Items.Add(E_ITEM_BEETROOT_SEEDS);
|
||||||
|
a_Items.Add(E_ITEM_MELON_SEEDS);
|
||||||
|
a_Items.Add(E_ITEM_PUMPKIN_SEEDS);
|
||||||
a_Items.Add(E_ITEM_SEEDS);
|
a_Items.Add(E_ITEM_SEEDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,6 +21,11 @@ cCow::cCow(void) :
|
|||||||
|
|
||||||
void cCow::GetDrops(cItems & a_Drops, cEntity * a_Killer)
|
void cCow::GetDrops(cItems & a_Drops, cEntity * a_Killer)
|
||||||
{
|
{
|
||||||
|
if (IsBaby())
|
||||||
|
{
|
||||||
|
return; // Babies don't drop items
|
||||||
|
}
|
||||||
|
|
||||||
unsigned int LootingLevel = 0;
|
unsigned int LootingLevel = 0;
|
||||||
if (a_Killer != nullptr)
|
if (a_Killer != nullptr)
|
||||||
{
|
{
|
||||||
|
@ -169,6 +169,11 @@ void cHorse::OnRightClicked(cPlayer & a_Player)
|
|||||||
|
|
||||||
void cHorse::GetDrops(cItems & a_Drops, cEntity * a_Killer)
|
void cHorse::GetDrops(cItems & a_Drops, cEntity * a_Killer)
|
||||||
{
|
{
|
||||||
|
if (IsBaby())
|
||||||
|
{
|
||||||
|
return; // Babies don't drop items
|
||||||
|
}
|
||||||
|
|
||||||
unsigned int LootingLevel = 0;
|
unsigned int LootingLevel = 0;
|
||||||
if (a_Killer != nullptr)
|
if (a_Killer != nullptr)
|
||||||
{
|
{
|
||||||
|
@ -24,6 +24,11 @@ cMooshroom::cMooshroom(void) :
|
|||||||
|
|
||||||
void cMooshroom::GetDrops(cItems & a_Drops, cEntity * a_Killer)
|
void cMooshroom::GetDrops(cItems & a_Drops, cEntity * a_Killer)
|
||||||
{
|
{
|
||||||
|
if (IsBaby())
|
||||||
|
{
|
||||||
|
return; // Babies don't drop items
|
||||||
|
}
|
||||||
|
|
||||||
unsigned int LootingLevel = 0;
|
unsigned int LootingLevel = 0;
|
||||||
if (a_Killer != nullptr)
|
if (a_Killer != nullptr)
|
||||||
{
|
{
|
||||||
|
@ -21,6 +21,11 @@ cPig::cPig(void) :
|
|||||||
|
|
||||||
void cPig::GetDrops(cItems & a_Drops, cEntity * a_Killer)
|
void cPig::GetDrops(cItems & a_Drops, cEntity * a_Killer)
|
||||||
{
|
{
|
||||||
|
if (IsBaby())
|
||||||
|
{
|
||||||
|
return; // Babies don't drop items
|
||||||
|
}
|
||||||
|
|
||||||
unsigned int LootingLevel = 0;
|
unsigned int LootingLevel = 0;
|
||||||
if (a_Killer != nullptr)
|
if (a_Killer != nullptr)
|
||||||
{
|
{
|
||||||
|
@ -33,6 +33,11 @@ cRabbit::cRabbit(eRabbitType Type, int MoreCarrotTicks) :
|
|||||||
|
|
||||||
void cRabbit::GetDrops(cItems & a_Drops, cEntity * a_Killer)
|
void cRabbit::GetDrops(cItems & a_Drops, cEntity * a_Killer)
|
||||||
{
|
{
|
||||||
|
if (IsBaby())
|
||||||
|
{
|
||||||
|
return; // Babies don't drop items
|
||||||
|
}
|
||||||
|
|
||||||
unsigned int LootingLevel = 0;
|
unsigned int LootingLevel = 0;
|
||||||
if (a_Killer != nullptr)
|
if (a_Killer != nullptr)
|
||||||
{
|
{
|
||||||
|
@ -35,6 +35,11 @@ cSheep::cSheep(int a_Color) :
|
|||||||
|
|
||||||
void cSheep::GetDrops(cItems & a_Drops, cEntity * a_Killer)
|
void cSheep::GetDrops(cItems & a_Drops, cEntity * a_Killer)
|
||||||
{
|
{
|
||||||
|
if (IsBaby())
|
||||||
|
{
|
||||||
|
return; // Babies don't drop items
|
||||||
|
}
|
||||||
|
|
||||||
if (!m_IsSheared)
|
if (!m_IsSheared)
|
||||||
{
|
{
|
||||||
a_Drops.push_back(cItem(E_BLOCK_WOOL, 1, static_cast<short>(m_WoolColor)));
|
a_Drops.push_back(cItem(E_BLOCK_WOOL, 1, static_cast<short>(m_WoolColor)));
|
||||||
|
@ -14,7 +14,7 @@ class cSilverfish :
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
cSilverfish(void) :
|
cSilverfish(void) :
|
||||||
super("Silverfish", mtSilverfish, "entity.silverfish.hurt", "entity.silverfish.death", 0.3, 0.7)
|
super("Silverfish", mtSilverfish, "entity.silverfish.hurt", "entity.silverfish.death", 0.3, 0.4)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user