summaryrefslogtreecommitdiffstats
path: root/src/Mobs
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2017-10-21 18:55:46 +0200
committerAlexander Harkness <me@bearbin.net>2017-10-21 18:55:46 +0200
commite585595ae64cc5523547c95cb8bebeb8e60f141b (patch)
tree846fb44a8699cf7a739e18c69490e46ab788b382 /src/Mobs
parentFix minecart deceleration (#4059) (diff)
downloadcuberite-e585595ae64cc5523547c95cb8bebeb8e60f141b.tar
cuberite-e585595ae64cc5523547c95cb8bebeb8e60f141b.tar.gz
cuberite-e585595ae64cc5523547c95cb8bebeb8e60f141b.tar.bz2
cuberite-e585595ae64cc5523547c95cb8bebeb8e60f141b.tar.lz
cuberite-e585595ae64cc5523547c95cb8bebeb8e60f141b.tar.xz
cuberite-e585595ae64cc5523547c95cb8bebeb8e60f141b.tar.zst
cuberite-e585595ae64cc5523547c95cb8bebeb8e60f141b.zip
Diffstat (limited to 'src/Mobs')
-rw-r--r--src/Mobs/Chicken.cpp19
-rw-r--r--src/Mobs/Chicken.h3
-rw-r--r--src/Mobs/Cow.cpp5
-rw-r--r--src/Mobs/Horse.cpp5
-rw-r--r--src/Mobs/Mooshroom.cpp5
-rw-r--r--src/Mobs/Pig.cpp5
-rw-r--r--src/Mobs/Rabbit.cpp5
-rw-r--r--src/Mobs/Sheep.cpp5
-rw-r--r--src/Mobs/Silverfish.h2
9 files changed, 44 insertions, 10 deletions
diff --git a/src/Mobs/Chicken.cpp b/src/Mobs/Chicken.cpp
index 1068295e6..e2caa6f67 100644
--- a/src/Mobs/Chicken.cpp
+++ b/src/Mobs/Chicken.cpp
@@ -10,7 +10,7 @@
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)
{
SetGravity(-2.0f);
@@ -34,14 +34,10 @@ void cChicken::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
return; // Babies don't lay eggs
}
- if ((m_EggDropTimer == 6000) && GetRandomProvider().RandBool())
- {
- cItems Drops;
- m_EggDropTimer = 0;
- Drops.push_back(cItem(E_ITEM_EGG, 1));
- m_World->SpawnItemPickups(Drops, GetPosX(), GetPosY(), GetPosZ(), 10);
- }
- else if (m_EggDropTimer == 12000)
+ if (
+ ((m_EggDropTimer == 6000) && GetRandomProvider().RandBool()) ||
+ m_EggDropTimer == 12000
+ )
{
cItems Drops;
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)
{
+ if (IsBaby())
+ {
+ return; // Babies don't drop items
+ }
+
unsigned int LootingLevel = 0;
if (a_Killer != nullptr)
{
diff --git a/src/Mobs/Chicken.h b/src/Mobs/Chicken.h
index 3be338b15..0dfc5e3d6 100644
--- a/src/Mobs/Chicken.h
+++ b/src/Mobs/Chicken.h
@@ -21,6 +21,9 @@ public:
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);
}
diff --git a/src/Mobs/Cow.cpp b/src/Mobs/Cow.cpp
index 9736fe440..003159959 100644
--- a/src/Mobs/Cow.cpp
+++ b/src/Mobs/Cow.cpp
@@ -21,6 +21,11 @@ cCow::cCow(void) :
void cCow::GetDrops(cItems & a_Drops, cEntity * a_Killer)
{
+ if (IsBaby())
+ {
+ return; // Babies don't drop items
+ }
+
unsigned int LootingLevel = 0;
if (a_Killer != nullptr)
{
diff --git a/src/Mobs/Horse.cpp b/src/Mobs/Horse.cpp
index c55acf572..07d3f7481 100644
--- a/src/Mobs/Horse.cpp
+++ b/src/Mobs/Horse.cpp
@@ -169,6 +169,11 @@ void cHorse::OnRightClicked(cPlayer & a_Player)
void cHorse::GetDrops(cItems & a_Drops, cEntity * a_Killer)
{
+ if (IsBaby())
+ {
+ return; // Babies don't drop items
+ }
+
unsigned int LootingLevel = 0;
if (a_Killer != nullptr)
{
diff --git a/src/Mobs/Mooshroom.cpp b/src/Mobs/Mooshroom.cpp
index b6feca76e..fc901e627 100644
--- a/src/Mobs/Mooshroom.cpp
+++ b/src/Mobs/Mooshroom.cpp
@@ -24,6 +24,11 @@ cMooshroom::cMooshroom(void) :
void cMooshroom::GetDrops(cItems & a_Drops, cEntity * a_Killer)
{
+ if (IsBaby())
+ {
+ return; // Babies don't drop items
+ }
+
unsigned int LootingLevel = 0;
if (a_Killer != nullptr)
{
diff --git a/src/Mobs/Pig.cpp b/src/Mobs/Pig.cpp
index 82901b061..c9b276f62 100644
--- a/src/Mobs/Pig.cpp
+++ b/src/Mobs/Pig.cpp
@@ -21,6 +21,11 @@ cPig::cPig(void) :
void cPig::GetDrops(cItems & a_Drops, cEntity * a_Killer)
{
+ if (IsBaby())
+ {
+ return; // Babies don't drop items
+ }
+
unsigned int LootingLevel = 0;
if (a_Killer != nullptr)
{
diff --git a/src/Mobs/Rabbit.cpp b/src/Mobs/Rabbit.cpp
index f4de0ba0c..d6a26f822 100644
--- a/src/Mobs/Rabbit.cpp
+++ b/src/Mobs/Rabbit.cpp
@@ -33,6 +33,11 @@ cRabbit::cRabbit(eRabbitType Type, int MoreCarrotTicks) :
void cRabbit::GetDrops(cItems & a_Drops, cEntity * a_Killer)
{
+ if (IsBaby())
+ {
+ return; // Babies don't drop items
+ }
+
unsigned int LootingLevel = 0;
if (a_Killer != nullptr)
{
diff --git a/src/Mobs/Sheep.cpp b/src/Mobs/Sheep.cpp
index 814c87f5d..190fac241 100644
--- a/src/Mobs/Sheep.cpp
+++ b/src/Mobs/Sheep.cpp
@@ -35,6 +35,11 @@ cSheep::cSheep(int a_Color) :
void cSheep::GetDrops(cItems & a_Drops, cEntity * a_Killer)
{
+ if (IsBaby())
+ {
+ return; // Babies don't drop items
+ }
+
if (!m_IsSheared)
{
a_Drops.push_back(cItem(E_BLOCK_WOOL, 1, static_cast<short>(m_WoolColor)));
diff --git a/src/Mobs/Silverfish.h b/src/Mobs/Silverfish.h
index 90ef5ea5d..c234573ba 100644
--- a/src/Mobs/Silverfish.h
+++ b/src/Mobs/Silverfish.h
@@ -14,7 +14,7 @@ class cSilverfish :
public:
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)
{
}