summaryrefslogtreecommitdiffstats
path: root/src/Items/ItemHandler.h
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-08-01 17:43:18 +0200
committerMattes D <github@xoft.cz>2014-08-01 17:43:18 +0200
commitd2744713bb69ca7c6211fe9b7bdf6fcadd2cadc8 (patch)
tree20fd08c3d16c6e21bfec17b3252b8cd48c923e59 /src/Items/ItemHandler.h
parentMerge pull request #1269 from Howaner/BlockEntitys (diff)
parentCompile fix. (diff)
downloadcuberite-d2744713bb69ca7c6211fe9b7bdf6fcadd2cadc8.tar
cuberite-d2744713bb69ca7c6211fe9b7bdf6fcadd2cadc8.tar.gz
cuberite-d2744713bb69ca7c6211fe9b7bdf6fcadd2cadc8.tar.bz2
cuberite-d2744713bb69ca7c6211fe9b7bdf6fcadd2cadc8.tar.lz
cuberite-d2744713bb69ca7c6211fe9b7bdf6fcadd2cadc8.tar.xz
cuberite-d2744713bb69ca7c6211fe9b7bdf6fcadd2cadc8.tar.zst
cuberite-d2744713bb69ca7c6211fe9b7bdf6fcadd2cadc8.zip
Diffstat (limited to 'src/Items/ItemHandler.h')
-rw-r--r--src/Items/ItemHandler.h16
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);