From c0e52ec485046f520079381970ecf8101c499bcf Mon Sep 17 00:00:00 2001 From: tenplus1 Date: Thu, 19 Mar 2015 11:21:48 +0000 Subject: [PATCH] shears added --- README.txt | 2 +- sheep.lua | 27 ++++++++++++++++++++++++++- textures/mobs_shears.png | Bin 0 -> 224 bytes 3 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 textures/mobs_shears.png diff --git a/README.txt b/README.txt index 444f4ec..92de41e 100644 --- a/README.txt +++ b/README.txt @@ -29,7 +29,7 @@ This mod contains the following additions: Changelog: beta- Npc mob added, kills monsters, attacks player when punched, right click with food to heal or gold lump for drop -1.05- Added ExeterDad's bunny's which can be picked up and tamed with 4 carrots from farming redo or farming_plus +1.05- Added ExeterDad's bunny's which can be picked up and tamed with 4 carrots from farming redo or farming_plus, also shears added to get wool from sheep 1.04- Added mating for sheep, cows and hogs... feed animals to make horny and hope for a baby which is half size, will grow up quick though :) 1.03- Added mob drop/replace feature so that chickens can drop eggs, cow/sheep can eat grass/wheat etc. 1.02- Sheared sheep are remembered and spawn shaven, Warthogs will attack when threatened, Api additions diff --git a/sheep.lua b/sheep.lua index b931ba8..e658217 100644 --- a/sheep.lua +++ b/sheep.lua @@ -73,10 +73,13 @@ mobs:register_mob("mobs:sheep", { end return end - if clicker:get_inventory() and not self.gotten and self.child == false then + -- need shears to get wool from sheep + if clicker:get_inventory() and item:get_name() == "mobs:shears" and not self.gotten and self.child == false then self.gotten = true -- shaved if minetest.registered_items["wool:white"] then clicker:get_inventory():add_item("main", ItemStack("wool:white "..math.random(1,3))) + item:add_wear(65535/100) + clicker:set_wielded_item(item) end self.object:set_properties({ textures = {"mobs_sheep_shaved.png"}, @@ -89,3 +92,25 @@ mobs:register_mob("mobs:sheep", { mobs:register_spawn("mobs:sheep", {"default:dirt_with_grass", "ethereal:green_dirt_top"}, 20, 8, 9000, 1, 31000) -- register spawn egg mobs:register_egg("mobs:sheep", "Sheep", "wool_white.png", 1) + +-- shears tool (right click sheep to shear) +minetest.register_tool("mobs:shears", { + description = "Steel Shears (right-click sheep to shear)", + inventory_image = "mobs_shears.png", + tool_capabilities = { + full_punch_interval = 1, + max_drop_level=1, + groupcaps={ + snappy={times={[1]=2.5, [2]=1.20, [3]=0.35}, uses=30, maxlevel=2}, + }, + damage_groups = {fleshy=0}, + } +}) + +minetest.register_craft({ + output = 'mobs:shears', + recipe = { + {'', 'default:steel_ingot', ''}, + {'', 'default:stick', 'default:steel_ingot'}, + } +}) diff --git a/textures/mobs_shears.png b/textures/mobs_shears.png new file mode 100644 index 0000000000000000000000000000000000000000..aa16f2ecb7669819952028204beead64104f8102 GIT binary patch literal 224 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!aez;Vs|5ptnzXorqMW6QfQgMo zkcDKfr%+IISWam{X39^ToS5nGi|=UbV0dp*0INP zuFe+i_*k%)OOWlB*S15}RWmJAqcd7L4kf(5nzopr0AoZ@-v9sr literal 0 HcmV?d00001