diff --git a/hammer.lua b/hammer.lua index 73e4cf4..e01ffd5 100644 --- a/hammer.lua +++ b/hammer.lua @@ -14,6 +14,12 @@ minetest.register_tool( "mymasonhammer:hammer",{ description = "Mason Hammer", inventory_image = "mymasonhammer_hammer.png", wield_image = "mymasonhammer_hammer.png", + tool_capabilities = { + max_drop_level=3, + groupcaps= { + cracky={times={[1]=4.00, [2]=1.50, [3]=1.00}, uses=70, maxlevel=1} + } + }, on_use = function(itemstack, user, pointed_thing) if pointed_thing.type ~= "node" then return @@ -40,30 +46,34 @@ on_use = function(itemstack, user, pointed_thing) minetest.record_protection_violation(pos, user:get_player_name()) return end - if mode == "1" then - if node.name == item then - minetest.set_node(pos,{name = stair, param2=minetest.dir_to_facedir(user:get_look_dir())}) - parti(pos) + if mode == "1" then + local tuse = 1 + if node.name == item then + tuse = 2 + if tuse == 2 then + minetest.set_node(pos,{name = stair, param2=minetest.dir_to_facedir(user:get_look_dir())}) + parti(pos) + end + end end - end - if mode == "2" then - if node.name == item then - minetest.set_node(pos,{name = "mymasonhammer:"..mat.."_ladder2", param2=minetest.dir_to_facedir(user:get_look_dir())}) - parti(pos) - elseif node.name == "mymasonhammer:"..mat.."_ladder2" then - minetest.set_node(pos,{name = "mymasonhammer:"..mat.."_ladder3", param2=minetest.dir_to_facedir(user:get_look_dir())}) - parti(pos) - elseif node.name == "mymasonhammer:"..mat.."_ladder3" then - minetest.set_node(pos,{name = "mymasonhammer:"..mat.."_ladder", param2=minetest.dir_to_facedir(user:get_look_dir())}) - parti(pos) + if mode == "2" then + if node.name == item then + minetest.set_node(pos,{name = "mymasonhammer:"..mat.."_ladder2", param2=minetest.dir_to_facedir(user:get_look_dir())}) + parti(pos) + elseif node.name == "mymasonhammer:"..mat.."_ladder2" then + minetest.set_node(pos,{name = "mymasonhammer:"..mat.."_ladder3", param2=minetest.dir_to_facedir(user:get_look_dir())}) + parti(pos) + elseif node.name == "mymasonhammer:"..mat.."_ladder3" then + minetest.set_node(pos,{name = "mymasonhammer:"..mat.."_ladder", param2=minetest.dir_to_facedir(user:get_look_dir())}) + parti(pos) + end end - end - if mode == "3" then - if node.name == item then - minetest.set_node(pos,{name = "mymasonhammer:"..mat.."_foot", param2=minetest.dir_to_facedir(user:get_look_dir())}) - parti(pos) + if mode == "3" then + if node.name == item then + minetest.set_node(pos,{name = "mymasonhammer:"..mat.."_foot", param2=minetest.dir_to_facedir(user:get_look_dir())}) + parti(pos) + end end - end end if not minetest.setting_getbool("creative_mode") then itemstack:add_wear(65535 / (USES - 1)) diff --git a/init.lua b/init.lua index 06ba2e4..ba6672c 100644 --- a/init.lua +++ b/init.lua @@ -1,3 +1,4 @@ +mycorners = {} dofile(minetest.get_modpath("mymasonhammer").."/hammer.lua") dofile(minetest.get_modpath("mymasonhammer").."/nodes.lua") diff --git a/nodes.lua b/nodes.lua index 9f3ccea..ec977e8 100644 --- a/nodes.lua +++ b/nodes.lua @@ -60,7 +60,7 @@ minetest.register_node("mymasonhammer:"..mat.."_ladder2", { paramtype = "light", paramtype2 = "facedir", walkable = true, - climbable = true, + --climbable = false, drop = item, groups = gro, node_box = { @@ -90,7 +90,7 @@ minetest.register_node("mymasonhammer:"..mat.."_ladder3", { paramtype = "light", paramtype2 = "facedir", walkable = true, - climbable = true, + --climbable = true, drop = item, groups = gro, node_box = { diff --git a/textures/32mymasonhammer_tint.png b/textures/32mymasonhammer_tint.png new file mode 100644 index 0000000..170b42c Binary files /dev/null and b/textures/32mymasonhammer_tint.png differ diff --git a/textures/32mymasonhammer_tint2.png b/textures/32mymasonhammer_tint2.png new file mode 100644 index 0000000..de30675 Binary files /dev/null and b/textures/32mymasonhammer_tint2.png differ diff --git a/textures/64mymasonhammer_tint.png b/textures/64mymasonhammer_tint.png new file mode 100644 index 0000000..7885288 Binary files /dev/null and b/textures/64mymasonhammer_tint.png differ diff --git a/textures/64mymasonhammer_tint2.png b/textures/64mymasonhammer_tint2.png new file mode 100644 index 0000000..0e5bb1d Binary files /dev/null and b/textures/64mymasonhammer_tint2.png differ diff --git a/textures/mymasonhammer_hammer.png b/textures/mymasonhammer_hammer.png index dfbb746..4e84515 100644 Binary files a/textures/mymasonhammer_hammer.png and b/textures/mymasonhammer_hammer.png differ