summaryrefslogtreecommitdiffstats
path: root/src/Items/ItemMilk.h
diff options
context:
space:
mode:
authorarchshift <admin@archshift.com>2014-06-07 22:45:00 +0200
committerarchshift <admin@archshift.com>2014-06-17 20:39:19 +0200
commit1eb04a48ee3ec4114adc4334e6fbcc7561834025 (patch)
tree6107d38a80cf4f4584f0d3edb6610f67148fa8e2 /src/Items/ItemMilk.h
parentPawn.cpp: fixed effect iterator BAD_ACCESS (diff)
downloadcuberite-1eb04a48ee3ec4114adc4334e6fbcc7561834025.tar
cuberite-1eb04a48ee3ec4114adc4334e6fbcc7561834025.tar.gz
cuberite-1eb04a48ee3ec4114adc4334e6fbcc7561834025.tar.bz2
cuberite-1eb04a48ee3ec4114adc4334e6fbcc7561834025.tar.lz
cuberite-1eb04a48ee3ec4114adc4334e6fbcc7561834025.tar.xz
cuberite-1eb04a48ee3ec4114adc4334e6fbcc7561834025.tar.zst
cuberite-1eb04a48ee3ec4114adc4334e6fbcc7561834025.zip
Diffstat (limited to '')
-rw-r--r--src/Items/ItemMilk.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/Items/ItemMilk.h b/src/Items/ItemMilk.h
new file mode 100644
index 000000000..8569c8cbe
--- /dev/null
+++ b/src/Items/ItemMilk.h
@@ -0,0 +1,26 @@
+
+#pragma once
+
+class cItemMilkHandler:
+ public cItemHandler
+{
+ typedef cItemHandler super;
+public:
+ cItemMilkHandler():
+ super(E_ITEM_MILK)
+ {
+ }
+
+ virtual bool IsDrinkable(void) override
+ {
+ return true;
+ }
+
+ virtual bool EatItem(cPlayer * a_Player, cItem * a_Item) override
+ {
+ a_Player->ClearEntityEffects();
+ a_Player->GetInventory().RemoveOneEquippedItem();
+ a_Player->GetInventory().AddItem(E_ITEM_BUCKET);
+ return true;
+ }
+};