From f7e3fc00c2ccfe8b9663fd918498bcdc2154a1da Mon Sep 17 00:00:00 2001 From: DonBatman Date: Mon, 26 Oct 2015 18:11:56 -0700 Subject: [PATCH] fixed climable on ladders before they become ladder modified hammer texture added 32 and 64 px shaddow textures --- hammer.lua | 52 +++++++++++++++++------------ init.lua | 1 + nodes.lua | 4 +-- textures/32mymasonhammer_tint.png | Bin 0 -> 167 bytes textures/32mymasonhammer_tint2.png | Bin 0 -> 185 bytes textures/64mymasonhammer_tint.png | Bin 0 -> 207 bytes textures/64mymasonhammer_tint2.png | Bin 0 -> 246 bytes textures/mymasonhammer_hammer.png | Bin 475 -> 362 bytes 8 files changed, 34 insertions(+), 23 deletions(-) create mode 100644 textures/32mymasonhammer_tint.png create mode 100644 textures/32mymasonhammer_tint2.png create mode 100644 textures/64mymasonhammer_tint.png create mode 100644 textures/64mymasonhammer_tint2.png 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 0000000000000000000000000000000000000000..170b42cc3b1d1a1ddccf859c4e3fccd56704a922 GIT binary patch literal 167 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdzwj^(N7lulPVg|lFeTU8iMK}vQ zB8wRqxP?KOkzv*x37{Z*iKnkC`+Y8HMs}X1iZ%OyLMEOrjv*0;-(K0s%b>u+?AU%( zaQ0?~mlHI0Xb0~+8D3>vzV>n`wuW&U}Sb+=V6e&@#!q9%+6EWegX9}c)I$z JtaD0e0sy7(FH-;j literal 0 HcmV?d00001 diff --git a/textures/32mymasonhammer_tint2.png b/textures/32mymasonhammer_tint2.png new file mode 100644 index 0000000000000000000000000000000000000000..de306751c78caefcf7e6667331a95a0cca5b765c GIT binary patch literal 185 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdzwj^(N7lulPVg|lFeTU8iMK}vQ zB8wRqxP?KOkzv*x37{Z*iKnkC`+Y8HMmCZ4VOLiIh1@({977@wC#NJNY)F@IIB>+^ zK*AM99TS7k3XGM%FKS4X9#~Ms@HoTM;#ET+dyiGZ7F&nRT01G$#e5RE{5@_5S1`Bj aVP^0XXZp`GweT9yL4nJa0`PlBg3pY5H=O_WNAYj2w(H95QEsLNT5$jv*Dd-rm?K$e_T(Y}kI( z(k#8LL}p^vs`X9UwbuF8bB}8u<`iIPSa>S_fTm6Z0~3b=14D!D0l5bvVh#+9ECLJ+ u2jmj?3%IxyK#~j$3H%$_Em~QBoMOGL&1!S_fE-Xg1B0ilpUXO@geCxpRWy|V literal 0 HcmV?d00001 diff --git a/textures/64mymasonhammer_tint2.png b/textures/64mymasonhammer_tint2.png new file mode 100644 index 0000000000000000000000000000000000000000..0e5bb1d6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