]> git.lizzy.rs Git - Crafter.git/blob - mods/hand/init.lua
Add snow fall, snow, snowballs, and 4 new sounds
[Crafter.git] / mods / hand / init.lua
1 -- The hand
2
3 --Create an initial hand tool
4 minetest.register_item(":", {
5         type = "none",
6         wield_image = "wieldhand.png",
7         wield_scale = {x=1,y=1,z=2.5},
8         tool_capabilities = {
9                 full_punch_interval = 0.9,
10                 max_drop_level = 0,
11                 groupcaps = {
12                         stone = {times={[4]=11.5,[3]=8.5,[2]=6.70,[1]=5.5}, uses=0, maxlevel=1},
13                         dirt = {times={[4]=11.0,[3]=8.4,[2]=6.40,[1]=4.2}, uses=0, maxlevel=1},
14                         sand = {times={[4]=11.0,[3]=8.4,[2]=6.40,[1]=4.2}, uses=0, maxlevel=1},
15                         wood = {times={[4]=11.5,[3]=8.5,[2]=6.70,[1]=5.5}, uses=0, maxlevel=1},
16                         leaves = {times={[4]=4.5,[3]=3.2,[2]=2.20,[1]=1.2}, uses=0, maxlevel=0},
17                         wool = {times={[4]=4.5,[3]=3.2,[2]=2.20,[1]=1.2}, uses=0, maxlevel=0},
18                         instant = {times={[1]=0.1,},uses=0,maxlevel=1},
19                         dig_immediate = {times={[2]=0,[3]=0,[1]=0,},uses=0,maxlevel=1},
20                 },
21                 damage_groups = {fleshy=1},
22         }
23 })
24
25 -- This is a fake node that should never be placed in the world
26 local def = minetest.registered_items[""]
27 minetest.register_node("hand:player", {
28         description = "",
29         tiles = {"player.png"},
30         visual_scale = 1,
31         wield_scale = {x=1,y=1,z=1},
32         paramtype = "light",
33         drawtype = "mesh",
34         mesh = "hand.b3d",
35         -- Prevent construction
36         node_placement_prediction = "",
37         on_construct = function(pos)
38                 minetest.log("error", "Tried to place hand at "..minetest.pos_to_string(pos))
39                 minetest.remove_node(pos)
40         end,
41         drop = "",
42         on_drop = function()
43                 return ""
44         end,
45         groups = { dig_immediate = 3, not_in_creative_inventory = 1 },
46         range = def.range,
47 })
48
49
50 --Create a hand list and then enable the hand node
51 minetest.register_on_joinplayer(function(player)
52         player:get_inventory():set_size("hand", 1)
53         player:get_inventory():set_stack("hand", 1, "hand:player")
54 end)
55