From 38cda7566ebcf8d3da7e167526da0b5c6c65f8a3 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Tue, 17 Jan 2017 01:09:11 +0100 Subject: [PATCH] Add milk --- mods/mcl_cake/init.lua | 9 ++++++--- mods/mcl_mobitems/init.lua | 19 ++++++++++-------- .../textures/mcl_mobitems_bucket_milk.png | Bin 0 -> 312 bytes mods/mobs_mc/cow.lua | 6 +++--- 4 files changed, 20 insertions(+), 14 deletions(-) create mode 100644 mods/mcl_mobitems/textures/mcl_mobitems_bucket_milk.png diff --git a/mods/mcl_cake/init.lua b/mods/mcl_cake/init.lua index aa2024c9..9472037d 100644 --- a/mods/mcl_cake/init.lua +++ b/mods/mcl_cake/init.lua @@ -11,15 +11,18 @@ slice_4 = { -7/16, -8/16, -7/16, 3/16, 0/16, 7/16} slice_5 = { -7/16, -8/16, -7/16, 5/16, 0/16, 7/16} slice_6 = { -7/16, -8/16, -7/16, 7/16, 0/16, 7/16} --- FIXME: Recipe. milk instead of water bucket and egg instead of leaves minetest.register_craft({ output = "mcl_cake:cake", recipe = { - {'bucket:bucket_water', 'bucket:bucket_water', 'bucket:bucket_water'}, + {'mcl_mobitems:milk_bucket', 'mcl_mobitems:milk_bucket', 'mcl_mobitems:milk_bucket'}, {'default:sugar', 'mcl_throwing:egg', 'default:sugar'}, {'farming:wheat_harvested', 'farming:wheat_harvested', 'farming:wheat_harvested'}, }, - replacements = {{"bucket:bucket_water", "bucket:bucket_empty"}}, + replacements = { + {"mcl_mobitems:milk_bucket", "bucket:bucket_empty"}, + {"mcl_mobitems:milk_bucket", "bucket:bucket_empty"}, + {"mcl_mobitems:milk_bucket", "bucket:bucket_empty"}, + }, }) minetest.register_node("mcl_cake:cake", { diff --git a/mods/mcl_mobitems/init.lua b/mods/mcl_mobitems/init.lua index 33fe09f4..e20442b4 100644 --- a/mods/mcl_mobitems/init.lua +++ b/mods/mcl_mobitems/init.lua @@ -100,6 +100,17 @@ minetest.register_craftitem("mcl_mobitems:cooked_rabbit", { stack_max = 64, }) +-- TODO: Fix drinking sound +-- TODO: Clear status effects +minetest.register_craftitem("mcl_mobitems:milk_bucket", { + description = "Milk", + inventory_image = "mcl_mobitems_bucket_milk.png", + wield_image = "mcl_mobitems_bucket_milk.png", + on_use = minetest.item_eat(0, "bucket:bucket_empty"), + groups = { food = 3, }, + stack_max = 1, +}) + minetest.register_craftitem("mcl_mobitems:spider_eye", { description = "Spider Eye", inventory_image = "mcl_mobitems_spider_eye.png", @@ -151,14 +162,6 @@ minetest.register_craftitem("mcl_mobitems:leather", { stack_max = 64, }) -minetest.register_craftitem("mcl_mobitems:egg", { - description = "Egg", - inventory_image = "mcl_mobitems_rotten_flesh.png", - wield_image = "mcl_mobitems_rotten_flesh.png", - stack_max = 16, - -}) - minetest.register_craftitem("mcl_mobitems:feather", { description = "Feather", wield_image = "mcl_mobitems_feather.png", diff --git a/mods/mcl_mobitems/textures/mcl_mobitems_bucket_milk.png b/mods/mcl_mobitems/textures/mcl_mobitems_bucket_milk.png new file mode 100644 index 0000000000000000000000000000000000000000..8b46f30eee3cad5118d56ac3fa7d9d5621181689 GIT binary patch literal 312 zcmeAS@N?(olHy`uVBq!ia0y~yU{C;I4mJh`hT^KKFANL}|2~)y?&9m*?@;7 zVA?5#HHQplHk#g0y3Mk4m8y2p13kl4T8SrL@jso%yd`DjR=xdip0fVoRahFbH}3k? zw+0PtQ-fBxDQ-V_ys%~#>w*b+JJ_-}KXp`akhY5!Q+(dWc#)MkW#vBhwrTf*1rB5! zKD0geF+(5+uRN1R63e3dmkT5wC`xqL>OHTK^kZC->##oet}j3H7sE@pzTeHA`NOcm zRe@pmACm>H8yJ4NtotwEAjPO~`7i^^!r*qs8=(OVoB#APT-ZII?Z)wqu3whTXN&o( zq1dqdgFC~SFCU^eDm-~2my}i|^*}LgnfxvBEyCLy?#=eUagO7MdCm8>kohk&)MQUy TyC}@Sz`)??>gTe~DWM4fKuCm4 literal 0 HcmV?d00001 diff --git a/mods/mobs_mc/cow.lua b/mods/mobs_mc/cow.lua index 6d4d414e..6fb45c6a 100644 --- a/mods/mobs_mc/cow.lua +++ b/mods/mobs_mc/cow.lua @@ -107,12 +107,12 @@ mobs:register_mob("mobs_mc:cow", { inv:remove_item("main", "bucket:bucket_empty") - if inv:room_for_item("main", {name = "mcl_mobitems:milk"}) then - clicker:get_inventory():add_item("main", "mcl_mobitems:milk") + if inv:room_for_item("main", {name = "mcl_mobitems:milk_bucket"}) then + clicker:get_inventory():add_item("main", "mcl_mobitems:milk_bucket") else local pos = self.object:getpos() pos.y = pos.y + 0.5 - minetest.add_item(pos, {name = "mcl_mobitems:milk"}) + minetest.add_item(pos, {name = "mcl_mobitems:milk_bucket"}) end self.gotten = true -- milked