Add groups for tools and mushrooms (#2378)
authorAn0n3m0us <abdullaahiqbal@hotmail.com>
Sat, 1 Jun 2019 19:10:30 +0000 (20:10 +0100)
committerSmallJoker <SmallJoker@users.noreply.github.com>
Sat, 1 Jun 2019 19:10:30 +0000 (21:10 +0200)
mods/bucket/init.lua
mods/default/craftitems.lua
mods/default/tools.lua
mods/farming/hoes.lua
mods/flowers/init.lua
mods/screwdriver/init.lua

index 1d37cb427166f6887fd7e534aa0f8d969314b285..7b89e8e440f4834354304e83d9f962f690595cbb 100644 (file)
@@ -114,6 +114,7 @@ minetest.register_craftitem("bucket:bucket_empty", {
        description = "Empty Bucket",
        inventory_image = "bucket.png",
        stack_max = 99,
+       groups = {tool = 1},
        liquids_pointable = true,
        on_use = function(itemstack, user, pointed_thing)
                if pointed_thing.type == "object" then
@@ -186,7 +187,7 @@ bucket.register_liquid(
        "bucket:bucket_water",
        "bucket_water.png",
        "Water Bucket",
-       {water_bucket = 1}
+       {tool = 1, water_bucket = 1}
 )
 
 -- River water source is 'liquid_renewable = false' to avoid horizontal spread
@@ -201,7 +202,7 @@ bucket.register_liquid(
        "bucket:bucket_river_water",
        "bucket_river_water.png",
        "River Water Bucket",
-       {water_bucket = 1},
+       {tool = 1, water_bucket = 1},
        true
 )
 
@@ -210,7 +211,8 @@ bucket.register_liquid(
        "default:lava_flowing",
        "bucket:bucket_lava",
        "bucket_lava.png",
-       "Lava Bucket"
+       "Lava Bucket",
+       {tool = 1}
 )
 
 minetest.register_craft({
index 711e5c1dbcd8ee843cd4bc993af6a4b2b73f18dd..53f4decc5a4ef9a53f21d0a6990688781ecb00af 100644 (file)
@@ -262,17 +262,17 @@ minetest.register_craftitem("default:coal_lump", {
 
 minetest.register_craftitem("default:iron_lump", {
        description = "Iron Lump",
-       inventory_image = "default_iron_lump.png",
+       inventory_image = "default_iron_lump.png"
 })
 
 minetest.register_craftitem("default:copper_lump", {
        description = "Copper Lump",
-       inventory_image = "default_copper_lump.png",
+       inventory_image = "default_copper_lump.png"
 })
 
 minetest.register_craftitem("default:tin_lump", {
        description = "Tin Lump",
-       inventory_image = "default_tin_lump.png",
+       inventory_image = "default_tin_lump.png"
 })
 
 minetest.register_craftitem("default:mese_crystal", {
@@ -282,7 +282,7 @@ minetest.register_craftitem("default:mese_crystal", {
 
 minetest.register_craftitem("default:gold_lump", {
        description = "Gold Lump",
-       inventory_image = "default_gold_lump.png",
+       inventory_image = "default_gold_lump.png"
 })
 
 minetest.register_craftitem("default:diamond", {
@@ -297,22 +297,22 @@ minetest.register_craftitem("default:clay_lump", {
 
 minetest.register_craftitem("default:steel_ingot", {
        description = "Steel Ingot",
-       inventory_image = "default_steel_ingot.png",
+       inventory_image = "default_steel_ingot.png"
 })
 
 minetest.register_craftitem("default:copper_ingot", {
        description = "Copper Ingot",
-       inventory_image = "default_copper_ingot.png",
+       inventory_image = "default_copper_ingot.png"
 })
 
 minetest.register_craftitem("default:tin_ingot", {
        description = "Tin Ingot",
-       inventory_image = "default_tin_ingot.png",
+       inventory_image = "default_tin_ingot.png"
 })
 
 minetest.register_craftitem("default:bronze_ingot", {
        description = "Bronze Ingot",
-       inventory_image = "default_bronze_ingot.png",
+       inventory_image = "default_bronze_ingot.png"
 })
 
 minetest.register_craftitem("default:gold_ingot", {
index 9f503ed45c79bb5b3d804a8a50745a19307afb27..f7981157339f685ceec2e2035e2139ad62af67db 100644 (file)
@@ -32,8 +32,8 @@ minetest.register_tool("default:pick_wood", {
                },
                damage_groups = {fleshy=2},
        },
-       groups = {flammable = 2},
        sound = {breaks = "default_tool_breaks"},
+       groups = {pickaxe = 1, flammable = 2}
 })
 
 minetest.register_tool("default:pick_stone", {
@@ -48,6 +48,7 @@ minetest.register_tool("default:pick_stone", {
                damage_groups = {fleshy=3},
        },
        sound = {breaks = "default_tool_breaks"},
+       groups = {pickaxe = 1}
 })
 
 minetest.register_tool("default:pick_bronze", {
@@ -62,6 +63,7 @@ minetest.register_tool("default:pick_bronze", {
                damage_groups = {fleshy=4},
        },
        sound = {breaks = "default_tool_breaks"},
+       groups = {pickaxe = 1}
 })
 
 minetest.register_tool("default:pick_steel", {
@@ -76,6 +78,7 @@ minetest.register_tool("default:pick_steel", {
                damage_groups = {fleshy=4},
        },
        sound = {breaks = "default_tool_breaks"},
+       groups = {pickaxe = 1}
 })
 
 minetest.register_tool("default:pick_mese", {
@@ -90,6 +93,7 @@ minetest.register_tool("default:pick_mese", {
                damage_groups = {fleshy=5},
        },
        sound = {breaks = "default_tool_breaks"},
+       groups = {pickaxe = 1}
 })
 
 minetest.register_tool("default:pick_diamond", {
@@ -104,6 +108,7 @@ minetest.register_tool("default:pick_diamond", {
                damage_groups = {fleshy=5},
        },
        sound = {breaks = "default_tool_breaks"},
+       groups = {pickaxe = 1}
 })
 
 --
@@ -122,8 +127,8 @@ minetest.register_tool("default:shovel_wood", {
                },
                damage_groups = {fleshy=2},
        },
-       groups = {flammable = 2},
        sound = {breaks = "default_tool_breaks"},
+       groups = {shovel = 1, flammable = 2}
 })
 
 minetest.register_tool("default:shovel_stone", {
@@ -139,6 +144,7 @@ minetest.register_tool("default:shovel_stone", {
                damage_groups = {fleshy=2},
        },
        sound = {breaks = "default_tool_breaks"},
+       groups = {shovel = 1}
 })
 
 minetest.register_tool("default:shovel_bronze", {
@@ -154,6 +160,7 @@ minetest.register_tool("default:shovel_bronze", {
                damage_groups = {fleshy=3},
        },
        sound = {breaks = "default_tool_breaks"},
+       groups = {shovel = 1}
 })
 
 minetest.register_tool("default:shovel_steel", {
@@ -169,6 +176,7 @@ minetest.register_tool("default:shovel_steel", {
                damage_groups = {fleshy=3},
        },
        sound = {breaks = "default_tool_breaks"},
+       groups = {shovel = 1}
 })
 
 minetest.register_tool("default:shovel_mese", {
@@ -184,6 +192,7 @@ minetest.register_tool("default:shovel_mese", {
                damage_groups = {fleshy=4},
        },
        sound = {breaks = "default_tool_breaks"},
+       groups = {shovel = 1}
 })
 
 minetest.register_tool("default:shovel_diamond", {
@@ -199,6 +208,7 @@ minetest.register_tool("default:shovel_diamond", {
                damage_groups = {fleshy=4},
        },
        sound = {breaks = "default_tool_breaks"},
+       groups = {shovel = 1}
 })
 
 --
@@ -216,8 +226,8 @@ minetest.register_tool("default:axe_wood", {
                },
                damage_groups = {fleshy=2},
        },
-       groups = {flammable = 2},
        sound = {breaks = "default_tool_breaks"},
+       groups = {axe = 1, flammable = 2}
 })
 
 minetest.register_tool("default:axe_stone", {
@@ -232,6 +242,7 @@ minetest.register_tool("default:axe_stone", {
                damage_groups = {fleshy=3},
        },
        sound = {breaks = "default_tool_breaks"},
+       groups = {axe = 1}
 })
 
 minetest.register_tool("default:axe_bronze", {
@@ -246,6 +257,7 @@ minetest.register_tool("default:axe_bronze", {
                damage_groups = {fleshy=4},
        },
        sound = {breaks = "default_tool_breaks"},
+       groups = {axe = 1}
 })
 
 minetest.register_tool("default:axe_steel", {
@@ -260,6 +272,7 @@ minetest.register_tool("default:axe_steel", {
                damage_groups = {fleshy=4},
        },
        sound = {breaks = "default_tool_breaks"},
+       groups = {axe = 1}
 })
 
 minetest.register_tool("default:axe_mese", {
@@ -274,6 +287,7 @@ minetest.register_tool("default:axe_mese", {
                damage_groups = {fleshy=6},
        },
        sound = {breaks = "default_tool_breaks"},
+       groups = {axe = 1}
 })
 
 minetest.register_tool("default:axe_diamond", {
@@ -288,6 +302,7 @@ minetest.register_tool("default:axe_diamond", {
                damage_groups = {fleshy=7},
        },
        sound = {breaks = "default_tool_breaks"},
+       groups = {axe = 1}
 })
 
 --
@@ -305,8 +320,8 @@ minetest.register_tool("default:sword_wood", {
                },
                damage_groups = {fleshy=2},
        },
-       groups = {flammable = 2},
        sound = {breaks = "default_tool_breaks"},
+       groups = {sword = 1, flammable = 2}
 })
 
 minetest.register_tool("default:sword_stone", {
@@ -321,6 +336,7 @@ minetest.register_tool("default:sword_stone", {
                damage_groups = {fleshy=4},
        },
        sound = {breaks = "default_tool_breaks"},
+       groups = {sword = 1}
 })
 
 minetest.register_tool("default:sword_bronze", {
@@ -335,6 +351,7 @@ minetest.register_tool("default:sword_bronze", {
                damage_groups = {fleshy=6},
        },
        sound = {breaks = "default_tool_breaks"},
+       groups = {sword = 1}
 })
 
 minetest.register_tool("default:sword_steel", {
@@ -349,6 +366,7 @@ minetest.register_tool("default:sword_steel", {
                damage_groups = {fleshy=6},
        },
        sound = {breaks = "default_tool_breaks"},
+       groups = {sword = 1}
 })
 
 minetest.register_tool("default:sword_mese", {
@@ -363,6 +381,7 @@ minetest.register_tool("default:sword_mese", {
                damage_groups = {fleshy=7},
        },
        sound = {breaks = "default_tool_breaks"},
+       groups = {sword = 1}
 })
 
 minetest.register_tool("default:sword_diamond", {
@@ -377,6 +396,7 @@ minetest.register_tool("default:sword_diamond", {
                damage_groups = {fleshy=8},
        },
        sound = {breaks = "default_tool_breaks"},
+       groups = {sword = 1}
 })
 
 minetest.register_tool("default:key", {
index d6a656507c4c11ca08aa267ad085338c8fae6215..2f47ec07b42a24f713e3bcb4488e089f18fc482a 100644 (file)
@@ -3,21 +3,23 @@ farming.register_hoe(":farming:hoe_wood", {
        inventory_image = "farming_tool_woodhoe.png",
        max_uses = 30,
        material = "group:wood",
-       groups = {flammable = 2},
+       groups = {hoe = 1, flammable = 2},
 })
 
 farming.register_hoe(":farming:hoe_stone", {
        description = "Stone Hoe",
        inventory_image = "farming_tool_stonehoe.png",
        max_uses = 90,
-       material = "group:stone"
+       material = "group:stone",
+       groups = {hoe = 1}
 })
 
 farming.register_hoe(":farming:hoe_steel", {
        description = "Steel Hoe",
        inventory_image = "farming_tool_steelhoe.png",
        max_uses = 500,
-       material = "default:steel_ingot"
+       material = "default:steel_ingot",
+       groups = {hoe = 1}
 })
 
 -- The following are deprecated by removing the 'material' field to prevent
@@ -29,19 +31,19 @@ farming.register_hoe(":farming:hoe_bronze", {
        description = "Bronze Hoe",
        inventory_image = "farming_tool_bronzehoe.png",
        max_uses = 220,
-       groups = {not_in_creative_inventory = 1},
+       groups = {hoe = 1, not_in_creative_inventory = 1},
 })
 
 farming.register_hoe(":farming:hoe_mese", {
        description = "Mese Hoe",
        inventory_image = "farming_tool_mesehoe.png",
        max_uses = 350,
-       groups = {not_in_creative_inventory = 1},
+       groups = {hoe = 1, not_in_creative_inventory = 1},
 })
 
 farming.register_hoe(":farming:hoe_diamond", {
        description = "Diamond Hoe",
        inventory_image = "farming_tool_diamondhoe.png",
        max_uses = 500,
-       groups = {not_in_creative_inventory = 1},
+       groups = {hoe = 1, not_in_creative_inventory = 1},
 })
index 49799cf3537d2f3f1c92f6ca76a42b9a0d57f067..62e4a4a79fabd6ce2c54656dc630ecd5d2566758 100644 (file)
@@ -189,7 +189,7 @@ minetest.register_node("flowers:mushroom_red", {
        sunlight_propagates = true,
        walkable = false,
        buildable_to = true,
-       groups = {snappy = 3, attached_node = 1, flammable = 1},
+       groups = {mushroom = 1, snappy = 3, attached_node = 1, flammable = 1},
        sounds = default.node_sound_leaves_defaults(),
        on_use = minetest.item_eat(-5),
        selection_box = {
@@ -208,7 +208,7 @@ minetest.register_node("flowers:mushroom_brown", {
        sunlight_propagates = true,
        walkable = false,
        buildable_to = true,
-       groups = {food_mushroom = 1, snappy = 3, attached_node = 1, flammable = 1},
+       groups = {mushroom = 1, food_mushroom = 1, snappy = 3, attached_node = 1, flammable = 1},
        sounds = default.node_sound_leaves_defaults(),
        on_use = minetest.item_eat(1),
        selection_box = {
index 634edf85a9ec6295a70ed0d87328cccd024e452e..7fe64a605af8882245ea113f35f64b014c177c28 100644 (file)
@@ -146,6 +146,7 @@ end
 minetest.register_tool("screwdriver:screwdriver", {
        description = "Screwdriver (left-click rotates face, right-click rotates axis)",
        inventory_image = "screwdriver.png",
+       groups = {tool = 1},
        on_use = function(itemstack, user, pointed_thing)
                screwdriver.handler(itemstack, user, pointed_thing, screwdriver.ROTATE_FACE, 200)
                return itemstack