From bef84b4821724c7119a3cb007d9e1265a56a27f0 Mon Sep 17 00:00:00 2001 From: Howaner Date: Sat, 28 Jun 2014 12:59:09 +0200 Subject: Fix sheep color's, add shear sound. --- src/Mobs/Sheep.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Mobs/Sheep.h') diff --git a/src/Mobs/Sheep.h b/src/Mobs/Sheep.h index 402e8e61c..14da81364 100644 --- a/src/Mobs/Sheep.h +++ b/src/Mobs/Sheep.h @@ -13,7 +13,7 @@ class cSheep : typedef cPassiveMonster super; public: - cSheep(int a_Color); + cSheep(int a_Color = -1); CLASS_PROTODEF(cSheep); -- cgit v1.2.3 From 11d02a447e45e96e4652f25afc6d040597ad2064 Mon Sep 17 00:00:00 2001 From: Howaner Date: Sat, 28 Jun 2014 13:19:32 +0200 Subject: Save IsSheared from Sheep. --- src/Mobs/Sheep.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/Mobs/Sheep.h') diff --git a/src/Mobs/Sheep.h b/src/Mobs/Sheep.h index 14da81364..21dca7787 100644 --- a/src/Mobs/Sheep.h +++ b/src/Mobs/Sheep.h @@ -24,7 +24,10 @@ public: virtual const cItem GetFollowedItem(void) const override { return cItem(E_ITEM_WHEAT); } bool IsSheared(void) const { return m_IsSheared; } + void SetSheared(bool a_IsSheared) { m_IsSheared = a_IsSheared; } + int GetFurColor(void) const { return m_WoolColor; } + void SetFurColor(bool a_WoolColor) { m_WoolColor = a_WoolColor; } private: -- cgit v1.2.3 From c3cde6232fae96a1c196d6bdf63b17ae996aee24 Mon Sep 17 00:00:00 2001 From: Howaner Date: Mon, 30 Jun 2014 20:23:17 +0200 Subject: Moved the random code to a function (cSheep::GenerateNaturalRandomColor()) --- src/Mobs/Sheep.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/Mobs/Sheep.h') diff --git a/src/Mobs/Sheep.h b/src/Mobs/Sheep.h index 21dca7787..41de7924f 100644 --- a/src/Mobs/Sheep.h +++ b/src/Mobs/Sheep.h @@ -13,24 +13,27 @@ class cSheep : typedef cPassiveMonster super; public: + + /** Use -1 for random color. */ cSheep(int a_Color = -1); - + CLASS_PROTODEF(cSheep); - + virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override; virtual void OnRightClicked(cPlayer & a_Player) override; virtual void Tick(float a_Dt, cChunk & a_Chunk) override; virtual const cItem GetFollowedItem(void) const override { return cItem(E_ITEM_WHEAT); } + static NIBBLETYPE GenerateNaturalRandomColor(void); + bool IsSheared(void) const { return m_IsSheared; } void SetSheared(bool a_IsSheared) { m_IsSheared = a_IsSheared; } int GetFurColor(void) const { return m_WoolColor; } - void SetFurColor(bool a_WoolColor) { m_WoolColor = a_WoolColor; } + void SetFurColor(int a_WoolColor) { m_WoolColor = a_WoolColor; } private: - bool m_IsSheared; int m_WoolColor; int m_TimeToStopEating; -- cgit v1.2.3 From 68007ab3e5aba33fb3a8e34c0301401aef594737 Mon Sep 17 00:00:00 2001 From: Howaner Date: Tue, 1 Jul 2014 20:42:23 +0200 Subject: Add doxy-comments. --- src/Mobs/Sheep.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/Mobs/Sheep.h') diff --git a/src/Mobs/Sheep.h b/src/Mobs/Sheep.h index 41de7924f..36d7df826 100644 --- a/src/Mobs/Sheep.h +++ b/src/Mobs/Sheep.h @@ -14,7 +14,9 @@ class cSheep : public: - /** Use -1 for random color. */ + /** The number is the color of the sheep. + 0-15 are the normal colors, if you type -1 the server + automatically chooses the right color for the sheep when spawned. */ cSheep(int a_Color = -1); CLASS_PROTODEF(cSheep); @@ -25,6 +27,7 @@ public: virtual const cItem GetFollowedItem(void) const override { return cItem(E_ITEM_WHEAT); } + /** Generates a random color for the sheep, like Mojang it does. */ static NIBBLETYPE GenerateNaturalRandomColor(void); bool IsSheared(void) const { return m_IsSheared; } -- cgit v1.2.3 From dc5c43c0aa3ffb8ddaa0871ccf76d872d2393cdb Mon Sep 17 00:00:00 2001 From: Howaner Date: Sun, 13 Jul 2014 01:04:43 +0200 Subject: Changed comments. --- src/Mobs/Sheep.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/Mobs/Sheep.h') diff --git a/src/Mobs/Sheep.h b/src/Mobs/Sheep.h index 36d7df826..5ffd3e4fe 100644 --- a/src/Mobs/Sheep.h +++ b/src/Mobs/Sheep.h @@ -15,8 +15,9 @@ class cSheep : public: /** The number is the color of the sheep. - 0-15 are the normal colors, if you type -1 the server - automatically chooses the right color for the sheep when spawned. */ + Use E_META_WOOL_* constants for the wool color. + If you type -1, the server will generate a random color + with the GenerateNaturalRandomColor() function. */ cSheep(int a_Color = -1); CLASS_PROTODEF(cSheep); @@ -27,7 +28,8 @@ public: virtual const cItem GetFollowedItem(void) const override { return cItem(E_ITEM_WHEAT); } - /** Generates a random color for the sheep, like Mojang it does. */ + /** Generates a random color for the sheep like the vanilla server. + The percent's where used are from the wiki: http://minecraft.gamepedia.com/Sheep#Breeding */ static NIBBLETYPE GenerateNaturalRandomColor(void); bool IsSheared(void) const { return m_IsSheared; } -- cgit v1.2.3 From 4191be7ddba820af4ed0c505a8d62416c2b7a8b4 Mon Sep 17 00:00:00 2001 From: archshift Date: Tue, 22 Jul 2014 15:36:13 -0700 Subject: Removed redundant semicolons and re-added warning --- src/Mobs/Sheep.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Mobs/Sheep.h') diff --git a/src/Mobs/Sheep.h b/src/Mobs/Sheep.h index 5ffd3e4fe..28e1c7254 100644 --- a/src/Mobs/Sheep.h +++ b/src/Mobs/Sheep.h @@ -20,7 +20,7 @@ public: with the GenerateNaturalRandomColor() function. */ cSheep(int a_Color = -1); - CLASS_PROTODEF(cSheep); + CLASS_PROTODEF(cSheep) virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override; virtual void OnRightClicked(cPlayer & a_Player) override; -- cgit v1.2.3