diff options
author | Howaner <franzi.moos@googlemail.com> | 2014-07-31 23:04:00 +0200 |
---|---|---|
committer | Howaner <franzi.moos@googlemail.com> | 2014-07-31 23:04:00 +0200 |
commit | 84462ba8b20c28136c6a7923323f7cde28a86d70 (patch) | |
tree | a568e3ef01c16deff469dd3612023263603cc2f9 /src/Items/ItemHandler.h | |
parent | Merge pull request #1267 from mc-server/RoofedForest (diff) | |
download | cuberite-84462ba8b20c28136c6a7923323f7cde28a86d70.tar cuberite-84462ba8b20c28136c6a7923323f7cde28a86d70.tar.gz cuberite-84462ba8b20c28136c6a7923323f7cde28a86d70.tar.bz2 cuberite-84462ba8b20c28136c6a7923323f7cde28a86d70.tar.lz cuberite-84462ba8b20c28136c6a7923323f7cde28a86d70.tar.xz cuberite-84462ba8b20c28136c6a7923323f7cde28a86d70.tar.zst cuberite-84462ba8b20c28136c6a7923323f7cde28a86d70.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Items/ItemHandler.h | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/Items/ItemHandler.h b/src/Items/ItemHandler.h index 1d5f59f3e..8b554ee34 100644 --- a/src/Items/ItemHandler.h +++ b/src/Items/ItemHandler.h @@ -3,6 +3,7 @@ #include "../Defines.h" #include "../Item.h" +#include "../Entities/EntityEffect.h" @@ -71,23 +72,24 @@ public: struct FoodInfo { - double Saturation; int FoodLevel; - int PoisonChance; // 0 - 100, in percent. 0 = no chance of poisoning, 100 = sure poisoning + double Saturation; FoodInfo(int a_FoodLevel, double a_Saturation, int a_PoisonChance = 0) : - Saturation(a_Saturation), FoodLevel(a_FoodLevel), - PoisonChance(a_PoisonChance) + Saturation(a_Saturation) { } } ; - /** Returns the FoodInfo for this item. (FoodRecovery, Saturation and PoisionChance) */ + /** Returns the FoodInfo for this item. (FoodRecovery and Saturation) */ virtual FoodInfo GetFoodInfo(); - + + /** If this function returns true, it sets the arguments to a effect who will be activated when you eat the item. */ + virtual bool GetEatEffect(cEntityEffect::eType & a_EffectType, int & a_EffectDurationTicks, short & a_EffectIntensity, float & a_Chance); + /** Lets the player eat a selected item. Returns true if the player ate the item */ - virtual bool EatItem(cPlayer *a_Player, cItem *a_Item); + virtual bool EatItem(cPlayer * a_Player, cItem * a_Item); /** Indicates if this item is a tool */ virtual bool IsTool(void); |