mirror of
https://github.com/minetest/minetest_game.git
synced 2024-12-22 23:10:17 +01:00
Make flammable: Flowers, grasses and several crafitems
This commit is contained in:
parent
fbac9be51c
commit
3c9d71e6f7
@ -221,6 +221,7 @@ minetest.register_craftitem("boats:boat", {
|
|||||||
wield_image = "boats_wield.png",
|
wield_image = "boats_wield.png",
|
||||||
wield_scale = {x = 2, y = 2, z = 1},
|
wield_scale = {x = 2, y = 2, z = 1},
|
||||||
liquids_pointable = true,
|
liquids_pointable = true,
|
||||||
|
groups = {flammable = 2},
|
||||||
|
|
||||||
on_place = function(itemstack, placer, pointed_thing)
|
on_place = function(itemstack, placer, pointed_thing)
|
||||||
if pointed_thing.type ~= "node" then
|
if pointed_thing.type ~= "node" then
|
||||||
|
@ -3,12 +3,13 @@
|
|||||||
minetest.register_craftitem("default:stick", {
|
minetest.register_craftitem("default:stick", {
|
||||||
description = "Stick",
|
description = "Stick",
|
||||||
inventory_image = "default_stick.png",
|
inventory_image = "default_stick.png",
|
||||||
groups = {stick = 1},
|
groups = {stick = 1, flammable = 2},
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craftitem("default:paper", {
|
minetest.register_craftitem("default:paper", {
|
||||||
description = "Paper",
|
description = "Paper",
|
||||||
inventory_image = "default_paper.png",
|
inventory_image = "default_paper.png",
|
||||||
|
groups = {flammable = 3},
|
||||||
})
|
})
|
||||||
|
|
||||||
local lpp = 14 -- Lines per book's page
|
local lpp = 14 -- Lines per book's page
|
||||||
@ -132,14 +133,14 @@ end)
|
|||||||
minetest.register_craftitem("default:book", {
|
minetest.register_craftitem("default:book", {
|
||||||
description = "Book",
|
description = "Book",
|
||||||
inventory_image = "default_book.png",
|
inventory_image = "default_book.png",
|
||||||
groups = {book = 1},
|
groups = {book = 1, flammable = 3},
|
||||||
on_use = book_on_use,
|
on_use = book_on_use,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craftitem("default:book_written", {
|
minetest.register_craftitem("default:book_written", {
|
||||||
description = "Book With Text",
|
description = "Book With Text",
|
||||||
inventory_image = "default_book_written.png",
|
inventory_image = "default_book_written.png",
|
||||||
groups = {book = 1, not_in_creative_inventory = 1},
|
groups = {book = 1, not_in_creative_inventory = 1, flammable = 3},
|
||||||
stack_max = 1,
|
stack_max = 1,
|
||||||
on_use = book_on_use,
|
on_use = book_on_use,
|
||||||
})
|
})
|
||||||
@ -176,7 +177,7 @@ end)
|
|||||||
minetest.register_craftitem("default:coal_lump", {
|
minetest.register_craftitem("default:coal_lump", {
|
||||||
description = "Coal Lump",
|
description = "Coal Lump",
|
||||||
inventory_image = "default_coal_lump.png",
|
inventory_image = "default_coal_lump.png",
|
||||||
groups = {coal = 1}
|
groups = {coal = 1, flammable = 1}
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craftitem("default:iron_lump", {
|
minetest.register_craftitem("default:iron_lump", {
|
||||||
|
@ -1103,7 +1103,7 @@ minetest.register_node("default:junglegrass", {
|
|||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
walkable = false,
|
walkable = false,
|
||||||
buildable_to = true,
|
buildable_to = true,
|
||||||
groups = {snappy = 3, flora = 1, attached_node = 1, grass = 1},
|
groups = {snappy = 3, flora = 1, attached_node = 1, grass = 1, flammable = 1},
|
||||||
sounds = default.node_sound_leaves_defaults(),
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
selection_box = {
|
selection_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
@ -1124,7 +1124,7 @@ minetest.register_node("default:grass_1", {
|
|||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
walkable = false,
|
walkable = false,
|
||||||
buildable_to = true,
|
buildable_to = true,
|
||||||
groups = {snappy = 3, flora = 1, attached_node = 1, grass = 1},
|
groups = {snappy = 3, flora = 1, attached_node = 1, grass = 1, flammable = 1},
|
||||||
sounds = default.node_sound_leaves_defaults(),
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
selection_box = {
|
selection_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
@ -1154,7 +1154,7 @@ for i = 2, 5 do
|
|||||||
buildable_to = true,
|
buildable_to = true,
|
||||||
drop = "default:grass_1",
|
drop = "default:grass_1",
|
||||||
groups = {snappy = 3, flora = 1, attached_node = 1,
|
groups = {snappy = 3, flora = 1, attached_node = 1,
|
||||||
not_in_creative_inventory = 1, grass = 1},
|
not_in_creative_inventory = 1, grass = 1, flammable = 1},
|
||||||
sounds = default.node_sound_leaves_defaults(),
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
selection_box = {
|
selection_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
|
@ -32,6 +32,7 @@ minetest.register_tool("default:pick_wood", {
|
|||||||
},
|
},
|
||||||
damage_groups = {fleshy=2},
|
damage_groups = {fleshy=2},
|
||||||
},
|
},
|
||||||
|
groups = {flammable = 2},
|
||||||
})
|
})
|
||||||
minetest.register_tool("default:pick_stone", {
|
minetest.register_tool("default:pick_stone", {
|
||||||
description = "Stone Pickaxe",
|
description = "Stone Pickaxe",
|
||||||
@ -110,6 +111,7 @@ minetest.register_tool("default:shovel_wood", {
|
|||||||
},
|
},
|
||||||
damage_groups = {fleshy=2},
|
damage_groups = {fleshy=2},
|
||||||
},
|
},
|
||||||
|
groups = {flammable = 2},
|
||||||
})
|
})
|
||||||
minetest.register_tool("default:shovel_stone", {
|
minetest.register_tool("default:shovel_stone", {
|
||||||
description = "Stone Shovel",
|
description = "Stone Shovel",
|
||||||
@ -192,6 +194,7 @@ minetest.register_tool("default:axe_wood", {
|
|||||||
},
|
},
|
||||||
damage_groups = {fleshy=2},
|
damage_groups = {fleshy=2},
|
||||||
},
|
},
|
||||||
|
groups = {flammable = 2},
|
||||||
})
|
})
|
||||||
minetest.register_tool("default:axe_stone", {
|
minetest.register_tool("default:axe_stone", {
|
||||||
description = "Stone Axe",
|
description = "Stone Axe",
|
||||||
@ -268,7 +271,8 @@ minetest.register_tool("default:sword_wood", {
|
|||||||
snappy={times={[2]=1.6, [3]=0.40}, uses=10, maxlevel=1},
|
snappy={times={[2]=1.6, [3]=0.40}, uses=10, maxlevel=1},
|
||||||
},
|
},
|
||||||
damage_groups = {fleshy=2},
|
damage_groups = {fleshy=2},
|
||||||
}
|
},
|
||||||
|
groups = {flammable = 2},
|
||||||
})
|
})
|
||||||
minetest.register_tool("default:sword_stone", {
|
minetest.register_tool("default:sword_stone", {
|
||||||
description = "Stone Sword",
|
description = "Stone Sword",
|
||||||
|
@ -92,7 +92,8 @@ farming.register_hoe = function(name, def)
|
|||||||
inventory_image = def.inventory_image,
|
inventory_image = def.inventory_image,
|
||||||
on_use = function(itemstack, user, pointed_thing)
|
on_use = function(itemstack, user, pointed_thing)
|
||||||
return farming.hoe_on_use(itemstack, user, pointed_thing, def.max_uses)
|
return farming.hoe_on_use(itemstack, user, pointed_thing, def.max_uses)
|
||||||
end
|
end,
|
||||||
|
groups = def.groups,
|
||||||
})
|
})
|
||||||
-- Register its recipe
|
-- Register its recipe
|
||||||
if def.material == nil then
|
if def.material == nil then
|
||||||
@ -269,7 +270,7 @@ farming.register_plant = function(name, def)
|
|||||||
|
|
||||||
-- Register seed
|
-- Register seed
|
||||||
local lbm_nodes = {mname .. ":seed_" .. pname}
|
local lbm_nodes = {mname .. ":seed_" .. pname}
|
||||||
local g = {seed = 1, snappy = 3, attached_node = 1}
|
local g = {seed = 1, snappy = 3, attached_node = 1, flammable = 2}
|
||||||
for k, v in pairs(def.fertility) do
|
for k, v in pairs(def.fertility) do
|
||||||
g[v] = 1
|
g[v] = 1
|
||||||
end
|
end
|
||||||
@ -307,6 +308,7 @@ farming.register_plant = function(name, def)
|
|||||||
minetest.register_craftitem(":" .. mname .. ":" .. pname, {
|
minetest.register_craftitem(":" .. mname .. ":" .. pname, {
|
||||||
description = pname:gsub("^%l", string.upper),
|
description = pname:gsub("^%l", string.upper),
|
||||||
inventory_image = mname .. "_" .. pname .. ".png",
|
inventory_image = mname .. "_" .. pname .. ".png",
|
||||||
|
groups = {flammable = 2},
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Register growing steps
|
-- Register growing steps
|
||||||
|
@ -2,7 +2,8 @@ farming.register_hoe(":farming:hoe_wood", {
|
|||||||
description = "Wooden Hoe",
|
description = "Wooden Hoe",
|
||||||
inventory_image = "farming_tool_woodhoe.png",
|
inventory_image = "farming_tool_woodhoe.png",
|
||||||
max_uses = 30,
|
max_uses = 30,
|
||||||
material = "group:wood"
|
material = "group:wood",
|
||||||
|
groups = {flammable = 2},
|
||||||
})
|
})
|
||||||
|
|
||||||
farming.register_hoe(":farming:hoe_stone", {
|
farming.register_hoe(":farming:hoe_stone", {
|
||||||
|
@ -14,17 +14,20 @@ farming.register_plant("farming:wheat", {
|
|||||||
steps = 8,
|
steps = 8,
|
||||||
minlight = 13,
|
minlight = 13,
|
||||||
maxlight = default.LIGHT_MAX,
|
maxlight = default.LIGHT_MAX,
|
||||||
fertility = {"grassland"}
|
fertility = {"grassland"},
|
||||||
|
groups = {flammable = 4},
|
||||||
})
|
})
|
||||||
minetest.register_craftitem("farming:flour", {
|
minetest.register_craftitem("farming:flour", {
|
||||||
description = "Flour",
|
description = "Flour",
|
||||||
inventory_image = "farming_flour.png",
|
inventory_image = "farming_flour.png",
|
||||||
|
groups = {flammable = 1},
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craftitem("farming:bread", {
|
minetest.register_craftitem("farming:bread", {
|
||||||
description = "Bread",
|
description = "Bread",
|
||||||
inventory_image = "farming_bread.png",
|
inventory_image = "farming_bread.png",
|
||||||
on_use = minetest.item_eat(5),
|
on_use = minetest.item_eat(5),
|
||||||
|
groups = {flammable = 2},
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
@ -47,7 +50,8 @@ farming.register_plant("farming:cotton", {
|
|||||||
steps = 8,
|
steps = 8,
|
||||||
minlight = 13,
|
minlight = 13,
|
||||||
maxlight = default.LIGHT_MAX,
|
maxlight = default.LIGHT_MAX,
|
||||||
fertility = {"grassland", "desert"}
|
fertility = {"grassland", "desert"},
|
||||||
|
groups = {flammable = 4},
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_alias("farming:string", "farming:cotton")
|
minetest.register_alias("farming:string", "farming:cotton")
|
||||||
|
@ -57,12 +57,12 @@ local function add_simple_flower(name, desc, box, f_groups)
|
|||||||
end
|
end
|
||||||
|
|
||||||
flowers.datas = {
|
flowers.datas = {
|
||||||
{"rose", "Rose", {-0.15, -0.5, -0.15, 0.15, 0.3, 0.15}, {color_red = 1}},
|
{"rose", "Rose", {-0.15, -0.5, -0.15, 0.15, 0.3, 0.15}, {color_red = 1, flammable = 1}},
|
||||||
{"tulip", "Orange Tulip", {-0.15, -0.5, -0.15, 0.15, 0.2, 0.15}, {color_orange = 1}},
|
{"tulip", "Orange Tulip", {-0.15, -0.5, -0.15, 0.15, 0.2, 0.15}, {color_orange = 1, flammable = 1}},
|
||||||
{"dandelion_yellow", "Yellow Dandelion", {-0.15, -0.5, -0.15, 0.15, 0.2, 0.15}, {color_yellow = 1}},
|
{"dandelion_yellow", "Yellow Dandelion", {-0.15, -0.5, -0.15, 0.15, 0.2, 0.15}, {color_yellow = 1, flammable = 1}},
|
||||||
{"geranium", "Blue Geranium", {-0.15, -0.5, -0.15, 0.15, 0.2, 0.15}, {color_blue = 1}},
|
{"geranium", "Blue Geranium", {-0.15, -0.5, -0.15, 0.15, 0.2, 0.15}, {color_blue = 1, flammable = 1}},
|
||||||
{"viola", "Viola", {-0.5, -0.5, -0.5, 0.5, -0.2, 0.5}, {color_violet = 1}},
|
{"viola", "Viola", {-0.5, -0.5, -0.5, 0.5, -0.2, 0.5}, {color_violet = 1, flammable = 1}},
|
||||||
{"dandelion_white", "White dandelion", {-0.5, -0.5, -0.5, 0.5, -0.2, 0.5}, {color_white = 1}}
|
{"dandelion_white", "White dandelion", {-0.5, -0.5, -0.5, 0.5, -0.2, 0.5}, {color_white = 1, flammable = 1}}
|
||||||
}
|
}
|
||||||
|
|
||||||
for _,item in pairs(flowers.datas) do
|
for _,item in pairs(flowers.datas) do
|
||||||
@ -136,7 +136,7 @@ minetest.register_node("flowers:mushroom_red", {
|
|||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
walkable = false,
|
walkable = false,
|
||||||
buildable_to = true,
|
buildable_to = true,
|
||||||
groups = {snappy = 3, attached_node = 1},
|
groups = {snappy = 3, attached_node = 1, flammable = 1},
|
||||||
sounds = default.node_sound_leaves_defaults(),
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
on_use = minetest.item_eat(-5),
|
on_use = minetest.item_eat(-5),
|
||||||
selection_box = {
|
selection_box = {
|
||||||
@ -155,7 +155,7 @@ minetest.register_node("flowers:mushroom_brown", {
|
|||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
walkable = false,
|
walkable = false,
|
||||||
buildable_to = true,
|
buildable_to = true,
|
||||||
groups = {snappy = 3, attached_node = 1},
|
groups = {snappy = 3, attached_node = 1, flammable = 1},
|
||||||
sounds = default.node_sound_leaves_defaults(),
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
on_use = minetest.item_eat(1),
|
on_use = minetest.item_eat(1),
|
||||||
selection_box = {
|
selection_box = {
|
||||||
@ -229,7 +229,7 @@ minetest.register_node("flowers:waterlily", {
|
|||||||
buildable_to = true,
|
buildable_to = true,
|
||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
floodable = true,
|
floodable = true,
|
||||||
groups = {snappy = 3, flower = 1},
|
groups = {snappy = 3, flower = 1, flammable = 1},
|
||||||
sounds = default.node_sound_leaves_defaults(),
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
node_placement_prediction = "",
|
node_placement_prediction = "",
|
||||||
node_box = {
|
node_box = {
|
||||||
|
Loading…
Reference in New Issue
Block a user