From 337e9ca17d85ef8eddee6970db8bc30be30b956d Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Thu, 23 Feb 2017 17:13:27 +0100 Subject: [PATCH] Increase cow viewing range, disable grass eating --- mods/ENTITIES/mobs_mc/cow.lua | 36 +---------------------------------- 1 file changed, 1 insertion(+), 35 deletions(-) diff --git a/mods/ENTITIES/mobs_mc/cow.lua b/mods/ENTITIES/mobs_mc/cow.lua index a8a5c06804..9764070b61 100644 --- a/mods/ENTITIES/mobs_mc/cow.lua +++ b/mods/ENTITIES/mobs_mc/cow.lua @@ -3,9 +3,6 @@ --made for MC like Survival game --License for code WTFPL and otherwise stated in readmes - ---dofile(minetest.get_modpath("mobs").."/api.lua") - mobs:register_mob("mobs_mc:cow", { type = "animal", hp_min = 10, @@ -55,31 +52,9 @@ mobs:register_mob("mobs_mc:cow", { look_start = 78, look_end = 108, }, - --[[ - follow = "farming:wheat", - view_range = 5, - on_rightclick = function(self, clicker) - local item = clicker:get_wielded_item() - if item:get_name() == "bucket:bucket_empty" and clicker:get_inventory() then - local inv = clicker:get_inventory() - inv:remove_item("main", "bucket:bucket_empty") - -- if room add bucket of milk to inventory, otherwise drop as item - if inv:room_for_item("main", {name="mobs:bucket_milk"}) then - clicker:get_inventory():add_item("main", "mobs:bucket_milk") - else - local pos = self.object:getpos() - pos.y = pos.y + 0.5 - minetest.add_item(pos, {name = "mobs:bucket_milk"}) - end - end - end, - ]] --from mobs_animals follow = "mcl_farming:wheat_item", - view_range = 7, - replace_rate = 10, - replace_what = {"mcl_core:tallgrass",}, - replace_with = "air", + view_range = 10, fear_height = 2, on_rightclick = function(self, clicker) @@ -93,17 +68,10 @@ mobs:register_mob("mobs_mc:cow", { -- milk cow with empty bucket if tool:get_name() == "bucket:bucket_empty" then - --if self.gotten == true if self.child == true then return end - if self.gotten == true then - minetest.chat_send_player(clicker:get_player_name(), - "Cow already milked!") - return - end - local inv = clicker:get_inventory() inv:remove_item("main", "bucket:bucket_empty") @@ -116,8 +84,6 @@ mobs:register_mob("mobs_mc:cow", { minetest.add_item(pos, {name = "mcl_mobitems:milk_bucket"}) end - self.gotten = true -- milked - return end end,