mirror of
https://bitbucket.org/kingarthursteam/christmas_craft.git
synced 2025-07-21 09:20:30 +02:00
Version MFF.
This commit is contained in:
762
init.lua
Normal file → Executable file
762
init.lua
Normal file → Executable file
@ -1,63 +1,709 @@
|
||||
|
||||
dofile(minetest.get_modpath("christmas_craft").."/mod_files/multi-node.lua")
|
||||
|
||||
dofile(minetest.get_modpath("christmas_craft").."/mod_files/node.lua")
|
||||
|
||||
dofile(minetest.get_modpath("christmas_craft").."/mod_files/items.lua")
|
||||
|
||||
|
||||
--load configuration file from world folder
|
||||
local MODPATH = minetest.get_modpath("christmas_craft")
|
||||
local worldpath = minetest.get_worldpath()
|
||||
local config = Settings(worldpath.."/christmas_craft.conf")
|
||||
|
||||
local conf_table = config:to_table()
|
||||
|
||||
|
||||
|
||||
|
||||
--look into readme.md how to change settings
|
||||
local defaults = {
|
||||
enable_snowing = "true",
|
||||
enable_crafts = "true",
|
||||
}
|
||||
|
||||
--if not in conf file, create it.
|
||||
for k, v in pairs(defaults) do
|
||||
if conf_table[k] == nil then
|
||||
config:set(k, v)
|
||||
config:write();
|
||||
end
|
||||
--dofile(minetest.get_modpath("christmas_craft").."/mods.lua")--disabled because 4seasons is not installed
|
||||
dofile(minetest.get_modpath("christmas_craft").."/crafts.lua") --temporary disabled because cristmas is over--
|
||||
if minetest.setting_getbool("is_winter") then
|
||||
dofile(minetest.get_modpath("christmas_craft").."/settings.lua") -- makes it snow
|
||||
end
|
||||
|
||||
-- if mtfood is installed
|
||||
if minetest.get_modpath("mtfoods") ~=nil then
|
||||
minetest.log("info", "found mtfoods mod. execute mtfoods.lua")
|
||||
dofile(MODPATH .."/mod_support/mtfoods.lua")--if the 4seasons mod is installed execute this file
|
||||
end
|
||||
-- blocks --
|
||||
|
||||
minetest.register_node("christmas_craft:snowman", {
|
||||
description = "Snowman",
|
||||
tiles = {"snow.png", "snow.png", "snow.png",
|
||||
"snow.png", "snow.png", "Snowman_F.png"},
|
||||
is_ground_content = true,
|
||||
paramtype2 = "facedir",
|
||||
groups = {crumbly=3},
|
||||
sounds = default.node_sound_sand_defaults(),
|
||||
})
|
||||
|
||||
|
||||
--if snow enabled, let it snow
|
||||
if config:get("enable_snowing") == "true" then
|
||||
minetest.log("info","let it snow, let it snow, let it snow.")
|
||||
dofile(MODPATH .."/snow.lua")--if snow enabled, execute this file
|
||||
end
|
||||
|
||||
--if crafts enabled, register the craft recieps
|
||||
if config:get("enable_crafts") == "true" then
|
||||
minetest.log("info","registering craft rezieps for snow mod")
|
||||
dofile(MODPATH .."/mod_files/crafts.lua")--if snow enabled, execute this file
|
||||
end
|
||||
minetest.register_node("christmas_craft:christmas_lights", {
|
||||
description = "christmas lights",
|
||||
drawtype = "signlike",
|
||||
light_source = 10,
|
||||
walkable = false,
|
||||
tiles = {
|
||||
{name="lights_animated.png", animation={type="vertical_frames", aspect_w=32, aspect_h=32, length=3.0}},
|
||||
},
|
||||
inventory_image = "c_lights.png",
|
||||
wield_image = "c_lights.png",
|
||||
paramtype = "light",
|
||||
paramtype2 = "wallmounted",
|
||||
selection_box = {
|
||||
type = "wallmounted",
|
||||
},
|
||||
groups = {oddly_breakable_by_hand = 3},
|
||||
})
|
||||
|
||||
--overwrite the default stick
|
||||
minetest.register_node("christmas_craft:christmas_wreath", {
|
||||
description = "Christmas Wreath",
|
||||
drawtype = "signlike",
|
||||
walkable = false,
|
||||
tiles = {
|
||||
{name="Wreath.png", animation={type="vertical_frames", aspect_w=32, aspect_h=32, length=3.0}},
|
||||
},
|
||||
inventory_image = "Wreath.png",
|
||||
paramtype = "light",
|
||||
paramtype2 = "wallmounted",
|
||||
selection_box = {
|
||||
type = "wallmounted",
|
||||
},
|
||||
groups = {oddly_breakable_by_hand = 3},
|
||||
})
|
||||
|
||||
minetest.register_node(":default:stick", {
|
||||
minetest.register_node("christmas_craft:christmas_star", {
|
||||
description = "christmas Star",
|
||||
drawtype = "plantlike",
|
||||
light_source = 10,
|
||||
tiles = {"star.png"},
|
||||
is_ground_content = true,
|
||||
groups = {crumbly=3},
|
||||
sounds = default.node_sound_sand_defaults(),
|
||||
})
|
||||
|
||||
--[[minetest.register_node("christmas_craft:snow_block", {
|
||||
description = "snow block",
|
||||
tiles = {"snow.png"},
|
||||
is_ground_content = true,
|
||||
groups = {crumbly=3},
|
||||
sounds = default.node_sound_sand_defaults(),
|
||||
})]]
|
||||
minetest.register_alias("christmas_craft:snow_block", "default:snowblock")
|
||||
|
||||
minetest.register_node("christmas_craft:christmas_leaves", {
|
||||
description = "Christmas leaves",
|
||||
drawtype = "allfaces_optional",
|
||||
tiles = {"christmas_leaves.png"},
|
||||
is_ground_content = false,
|
||||
paramtype = "light",
|
||||
groups = {crumbly=3},
|
||||
sounds = default.node_sound_sand_defaults(),
|
||||
})
|
||||
|
||||
|
||||
|
||||
minetest.register_node("christmas_craft:red_baubles", {
|
||||
description = "Red Baubles",
|
||||
drawtype = "nodebox",
|
||||
tiles = {"christmas_craft_baubles_top_re.png^christmas_craft_baubles_top.png","christmas_craft_baubles_top_re.png","christmas_craft_baubles_side_re.png"},
|
||||
is_ground_content = true,
|
||||
paramtype = "light",
|
||||
groups = {crumbly=3},
|
||||
sounds = default.node_sound_sand_defaults(),
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.25, 0.438, -0.25, 0.25, -0.05, 0.25},
|
||||
{-0.08, 0.5, -0.08, 0.08, -0.0, 0.08},
|
||||
|
||||
-- side , top , side , side , bottom, side,
|
||||
|
||||
},
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.25, 0.438, -0.25, 0.25, -0.05, 0.25},
|
||||
{-0.08, 0.5, -0.08, 0.08, -0.0, 0.08},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_node("christmas_craft:yellow_baubles", {
|
||||
description = "Yellow Baubles",
|
||||
drawtype = "nodebox",
|
||||
tiles = {"christmas_craft_baubles_top_ye.png^christmas_craft_baubles_top.png","christmas_craft_baubles_top_ye.png","christmas_craft_baubles_side_ye.png"},
|
||||
is_ground_content = true,
|
||||
paramtype = "light",
|
||||
groups = {crumbly=3},
|
||||
sounds = default.node_sound_sand_defaults(),
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.25, 0.438, -0.25, 0.25, -0.05, 0.25},
|
||||
{-0.08, 0.5, -0.08, 0.08, -0.0, 0.08},
|
||||
|
||||
-- side , top , side , side , bottom, side,
|
||||
|
||||
},
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.25, 0.438, -0.25, 0.25, -0.05, 0.25},
|
||||
{-0.08, 0.5, -0.08, 0.08, -0.0, 0.08},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_node("christmas_craft:green_baubles", {
|
||||
description = "Green Baubles",
|
||||
drawtype = "nodebox",
|
||||
tiles = {"christmas_craft_baubles_top_gr.png^christmas_craft_baubles_top.png","christmas_craft_baubles_top_gr.png","christmas_craft_baubles_side_gr.png"},
|
||||
is_ground_content = true,
|
||||
paramtype = "light",
|
||||
groups = {crumbly=3},
|
||||
sounds = default.node_sound_sand_defaults(),
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.25, 0.438, -0.25, 0.25, -0.05, 0.25},
|
||||
{-0.08, 0.5, -0.08, 0.08, -0.0, 0.08},
|
||||
|
||||
-- side , top , side , side , bottom, side,
|
||||
|
||||
},
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.25, 0.438, -0.25, 0.25, -0.05, 0.25},
|
||||
{-0.08, 0.5, -0.08, 0.08, -0.0, 0.08},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
minetest.register_node("christmas_craft:blue_baubles", {
|
||||
description = "Blue Baubles",
|
||||
drawtype = "nodebox",
|
||||
tiles = {"christmas_craft_baubles_top_bl.png^christmas_craft_baubles_top.png","christmas_craft_baubles_top_bl.png","christmas_craft_baubles_side_bl.png"},
|
||||
is_ground_content = true,
|
||||
paramtype = "light",
|
||||
groups = {crumbly=3},
|
||||
sounds = default.node_sound_sand_defaults(),
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.25, 0.438, -0.25, 0.25, -0.05, 0.25},
|
||||
{-0.08, 0.5, -0.08, 0.08, -0.0, 0.08},
|
||||
|
||||
-- side , top , side , side , bottom, side,
|
||||
|
||||
},
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.25, 0.438, -0.25, 0.25, -0.05, 0.25},
|
||||
{-0.08, 0.5, -0.08, 0.08, -0.0, 0.08},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_node("christmas_craft:orange_baubles", {
|
||||
description = "Orange Baubles",
|
||||
drawtype = "nodebox",
|
||||
tiles = {"christmas_craft_baubles_top_or.png^christmas_craft_baubles_top.png","christmas_craft_baubles_top_or.png","christmas_craft_baubles_side_or.png"},
|
||||
is_ground_content = true,
|
||||
paramtype = "light",
|
||||
groups = {crumbly=3},
|
||||
sounds = default.node_sound_sand_defaults(),
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.25, 0.438, -0.25, 0.25, -0.05, 0.25},
|
||||
{-0.08, 0.5, -0.08, 0.08, -0.0, 0.08},
|
||||
|
||||
-- side , top , side , side , bottom, side,
|
||||
|
||||
},
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.25, 0.438, -0.25, 0.25, -0.05, 0.25},
|
||||
{-0.08, 0.5, -0.08, 0.08, -0.0, 0.08},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_node("christmas_craft:violet_baubles", {
|
||||
description = "Violet Baubles",
|
||||
drawtype = "nodebox",
|
||||
tiles = {"christmas_craft_baubles_top_vi.png^christmas_craft_baubles_top.png","christmas_craft_baubles_top_vi.png","christmas_craft_baubles_side_vi.png"},
|
||||
is_ground_content = true,
|
||||
paramtype = "light",
|
||||
groups = {crumbly=3},
|
||||
sounds = default.node_sound_sand_defaults(),
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.25, 0.438, -0.25, 0.25, -0.05, 0.25},
|
||||
{-0.08, 0.5, -0.08, 0.08, -0.0, 0.08},
|
||||
|
||||
-- side , top , side , side , bottom, side,
|
||||
|
||||
},
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.25, 0.438, -0.25, 0.25, -0.05, 0.25},
|
||||
{-0.08, 0.5, -0.08, 0.08, -0.0, 0.08},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_node("christmas_craft:pink_baubles", {
|
||||
description = "Pink Baubles",
|
||||
drawtype = "nodebox",
|
||||
tiles = {"christmas_craft_baubles_top_pi.png^christmas_craft_baubles_top.png","christmas_craft_baubles_top_pi.png","christmas_craft_baubles_side_pi.png"},
|
||||
is_ground_content = true,
|
||||
paramtype = "light",
|
||||
groups = {crumbly=3},
|
||||
sounds = default.node_sound_sand_defaults(),
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.25, 0.438, -0.25, 0.25, -0.05, 0.25},
|
||||
{-0.08, 0.5, -0.08, 0.08, -0.0, 0.08},
|
||||
|
||||
-- side , top , side , side , bottom, side,
|
||||
|
||||
},
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.25, 0.438, -0.25, 0.25, -0.05, 0.25},
|
||||
{-0.08, 0.5, -0.08, 0.08, -0.0, 0.08},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_node("christmas_craft:silver_baubles", {
|
||||
description = "Silver Baubles",
|
||||
drawtype = "nodebox",
|
||||
tiles = {"christmas_craft_baubles_top_si.png^christmas_craft_baubles_top.png","christmas_craft_baubles_top_si.png","christmas_craft_baubles_side_si.png"},
|
||||
is_ground_content = true,
|
||||
paramtype = "light",
|
||||
groups = {crumbly=3},
|
||||
sounds = default.node_sound_sand_defaults(),
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.25, 0.438, -0.25, 0.25, -0.05, 0.25},
|
||||
{-0.08, 0.5, -0.08, 0.08, -0.0, 0.08},
|
||||
|
||||
-- side , top , side , side , bottom, side,
|
||||
|
||||
},
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.25, 0.438, -0.25, 0.25, -0.05, 0.25},
|
||||
{-0.08, 0.5, -0.08, 0.08, -0.0, 0.08},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
------------
|
||||
--nodes--
|
||||
|
||||
-- presents --
|
||||
|
||||
minetest.register_node("christmas_craft:present_box", {
|
||||
description = "Present Box",
|
||||
tiles = {"christmas_craft_present_box.png"},
|
||||
is_ground_content = true,
|
||||
paramtype = "light",
|
||||
groups = {crumbly=3},
|
||||
sounds = default.node_sound_sand_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("christmas_craft:Christmas_present", {
|
||||
description = "Christmas Present",
|
||||
tiles = {"christmas_craft_present_wh.png^christmas_craft_bow_top.png", "christmas_craft_present_wh.png^christmas_craft_bow_bottom.png", "christmas_craft_present_wh.png^christmas_craft_bow_side.png"},
|
||||
is_ground_content = true,
|
||||
groups = {crumbly=3},
|
||||
drop = {
|
||||
max_items = 1, min_items = 1, items = {
|
||||
{items = {'default:bookshelf'}, rarity = 90,},
|
||||
{items = {'default:pick_mese'}, rarity = 80,},
|
||||
{items = {'default:shovel_steel'}, rarity = 90,},
|
||||
{items = {'default:axe_steel'}, rarity = 90,},
|
||||
{items = {'default:pick_steel'}, rarity = 90,},
|
||||
{items = {'default:sign_wall'}, rarity = 80,},
|
||||
{items = {'default:chest'}, rarity = 80,},
|
||||
{items = {'default:furnace'}, rarity = 80,},
|
||||
{items = {'default:steelblock'}, rarity = 80,},
|
||||
{items = {'default:coal_lump'}, rarity = 80,},
|
||||
{items = {'default:pick_diamond'}, rarity = 75,},
|
||||
{items = {'default:shovel_diamond'}, rarity = 75,},
|
||||
{items = {'default:axe_diamond'}, rarity = 75,},
|
||||
{items = {'default:diamondblock'}, rarity = 75},
|
||||
{items = {'fire:flint_and_steel'}, rarity = 90,},
|
||||
{items = {'default:chest_locked'}, rarity = 80,},
|
||||
{items = {'default:brick'}, rarity = 80,},
|
||||
{items = {'default:dirt_with_grass'}, rarity = 80,},
|
||||
{items = {'christmas_craft:Christmas_present'}, rarity = 1,},
|
||||
}},
|
||||
sounds = default.node_sound_dirt_defaults({
|
||||
footstep = {name="default_grass_footstep", gain=0.4},
|
||||
}),
|
||||
})
|
||||
|
||||
minetest.register_node("christmas_craft:Christmas_present_green", {
|
||||
description = "Christmas Present Green ",
|
||||
tiles = {"christmas_craft_present_gr.png^christmas_craft_bow_top.png", "christmas_craft_present_gr.png^christmas_craft_bow_bottom.png", "christmas_craft_present_gr.png^christmas_craft_bow_side.png"},
|
||||
is_ground_content = true,
|
||||
groups = {crumbly=3},
|
||||
drop = {
|
||||
max_items = 2, items = {
|
||||
{items = {'default:bookshelf'}, rarity = 15,},
|
||||
{items = {'default:pick_mese'}, rarity = 20,},
|
||||
{items = {'default:shovel_steel'}, rarity = 15,},
|
||||
{items = {'default:axe_steel'}, rarity = 15,},
|
||||
{items = {'default:pick_steel'}, rarity = 15,},
|
||||
{items = {'default:sign_wall'}, rarity = 20,},
|
||||
{items = {'default:chest'}, rarity = 20,},
|
||||
{items = {'default:furnace'}, rarity = 20,},
|
||||
{items = {'default:steelblock'}, rarity = 25,},
|
||||
{items = {'default:coal_lump'}, rarity = 25,},
|
||||
{items = {'default:pick_diamond'}, rarity = 30,},
|
||||
{items = {'default:shovel_diamond'}, rarity = 30,},
|
||||
{items = {'default:axe_diamond'}, rarity = 30,},
|
||||
{items = {'default:diamondblock'}, rarity = 30,},
|
||||
{items = {'fire:flint_and_steel'}, rarity = 15,},
|
||||
{items = {'default:chest_locked'}, rarity = 20,},
|
||||
{items = {'default:brick'}, rarity = 25,},
|
||||
{items = {'default:dirt_with_grass'}, rarity = 30,},
|
||||
{items = {'christmas_craft:Christmas_present_green'}, rarity = 1,},
|
||||
}},
|
||||
sounds = default.node_sound_dirt_defaults({
|
||||
footstep = {name="default_grass_footstep", gain=0.4},
|
||||
}),
|
||||
})
|
||||
|
||||
minetest.register_node("christmas_craft:Christmas_present_red", {
|
||||
description = "Christmas Present Red ",
|
||||
tiles = {"christmas_craft_present_re.png^christmas_craft_bow_top.png", "christmas_craft_present_re.png^christmas_craft_bow_bottom.png", "christmas_craft_present_re.png^christmas_craft_bow_side.png"},
|
||||
is_ground_content = true,
|
||||
groups = {crumbly=3},
|
||||
drop = {
|
||||
max_items = 2, items = {
|
||||
{items = {'default:bookshelf'}, rarity = 15,},
|
||||
{items = {'default:pick_mese'}, rarity = 20,},
|
||||
{items = {'default:shovel_steel'}, rarity = 15,},
|
||||
{items = {'default:axe_steel'}, rarity = 15,},
|
||||
{items = {'default:pick_steel'}, rarity = 15,},
|
||||
{items = {'default:sign_wall'}, rarity = 20,},
|
||||
{items = {'default:chest'}, rarity = 20,},
|
||||
{items = {'default:furnace'}, rarity = 20,},
|
||||
{items = {'default:steelblock'}, rarity = 25,},
|
||||
{items = {'default:coal_lump'}, rarity = 25,},
|
||||
{items = {'default:pick_diamond'}, rarity = 30,},
|
||||
{items = {'default:shovel_diamond'}, rarity = 30,},
|
||||
{items = {'default:axe_diamond'}, rarity = 30,},
|
||||
{items = {'default:diamondblock'}, rarity = 30,},
|
||||
{items = {'fire:flint_and_steel'}, rarity = 15,},
|
||||
{items = {'default:chest_locked'}, rarity = 20,},
|
||||
{items = {'default:brick'}, rarity = 25,},
|
||||
{items = {'default:dirt_with_grass'}, rarity = 30,},
|
||||
{items = {'christmas_craft:Christmas_present_red'}, rarity = 1,},
|
||||
}},
|
||||
sounds = default.node_sound_dirt_defaults({
|
||||
footstep = {name="default_grass_footstep", gain=0.4},
|
||||
}),
|
||||
})
|
||||
|
||||
minetest.register_node("christmas_craft:Christmas_present_blue", {
|
||||
description = "Christmas Present Blue ",
|
||||
tiles = {"christmas_craft_present_bl.png^christmas_craft_bow_top.png", "christmas_craft_present_bl.png^christmas_craft_bow_bottom.png", "christmas_craft_present_bl.png^christmas_craft_bow_side.png"},
|
||||
is_ground_content = true,
|
||||
groups = {crumbly=3},
|
||||
drop = {
|
||||
max_items = 2, items = {
|
||||
{items = {'default:bookshelf'}, rarity = 15,},
|
||||
{items = {'default:pick_mese'}, rarity = 20,},
|
||||
{items = {'default:shovel_steel'}, rarity = 15,},
|
||||
{items = {'default:axe_steel'}, rarity = 15,},
|
||||
{items = {'default:pick_steel'}, rarity = 15,},
|
||||
{items = {'default:sign_wall'}, rarity = 20,},
|
||||
{items = {'default:chest'}, rarity = 20,},
|
||||
{items = {'default:furnace'}, rarity = 20,},
|
||||
{items = {'default:steelblock'}, rarity = 25,},
|
||||
{items = {'default:coal_lump'}, rarity = 25,},
|
||||
{items = {'default:pick_diamond'}, rarity = 30,},
|
||||
{items = {'default:shovel_diamond'}, rarity = 30,},
|
||||
{items = {'default:axe_diamond'}, rarity = 30,},
|
||||
{items = {'default:diamondblock'}, rarity = 30,},
|
||||
{items = {'fire:flint_and_steel'}, rarity = 15,},
|
||||
{items = {'default:chest_locked'}, rarity = 20,},
|
||||
{items = {'default:brick'}, rarity = 25,},
|
||||
{items = {'default:dirt_with_grass'}, rarity = 30,},
|
||||
{items = {'christmas_craft:Christmas_present_blue'}, rarity = 1,},
|
||||
}},
|
||||
sounds = default.node_sound_dirt_defaults({
|
||||
footstep = {name="default_grass_footstep", gain=0.4},
|
||||
}),
|
||||
})
|
||||
|
||||
minetest.register_node("christmas_craft:Christmas_present_yellow", {
|
||||
description = "Christmas Present Yellow ",
|
||||
tiles = {"christmas_craft_present_ye.png^christmas_craft_bow_top.png", "christmas_craft_present_ye.png^christmas_craft_bow_bottom.png", "christmas_craft_present_ye.png^christmas_craft_bow_side.png"},
|
||||
is_ground_content = true,
|
||||
groups = {crumbly=3},
|
||||
drop = {
|
||||
max_items = 2, items = {
|
||||
{items = {'default:bookshelf'}, rarity = 15,},
|
||||
{items = {'default:pick_mese'}, rarity = 20,},
|
||||
{items = {'default:shovel_steel'}, rarity = 15,},
|
||||
{items = {'default:axe_steel'}, rarity = 15,},
|
||||
{items = {'default:pick_steel'}, rarity = 15,},
|
||||
{items = {'default:sign_wall'}, rarity = 20,},
|
||||
{items = {'default:chest'}, rarity = 20,},
|
||||
{items = {'default:furnace'}, rarity = 20,},
|
||||
{items = {'default:steelblock'}, rarity = 25,},
|
||||
{items = {'default:coal_lump'}, rarity = 25,},
|
||||
{items = {'default:pick_diamond'}, rarity = 30,},
|
||||
{items = {'default:shovel_diamond'}, rarity = 30,},
|
||||
{items = {'default:axe_diamond'}, rarity = 30,},
|
||||
{items = {'default:diamondblock'}, rarity = 30,},
|
||||
{items = {'fire:flint_and_steel'}, rarity = 15,},
|
||||
{items = {'default:chest_locked'}, rarity = 20,},
|
||||
{items = {'default:brick'}, rarity = 25,},
|
||||
{items = {'default:dirt_with_grass'}, rarity = 30,},
|
||||
{items = {'christmas_craft:Christmas_present_yellow'}, rarity = 1,},
|
||||
}},
|
||||
sounds = default.node_sound_dirt_defaults({
|
||||
footstep = {name="default_grass_footstep", gain=0.4},
|
||||
}),
|
||||
})
|
||||
|
||||
minetest.register_node("christmas_craft:Christmas_present_red", {
|
||||
description = "Christmas Present Red ",
|
||||
tiles = {"christmas_craft_present_re.png^christmas_craft_bow_top.png", "christmas_craft_present_re.png^christmas_craft_bow_bottom.png", "christmas_craft_present_re.png^christmas_craft_bow_side.png"},
|
||||
is_ground_content = true,
|
||||
groups = {crumbly=3},
|
||||
drop = {
|
||||
max_items = 2, items = {
|
||||
{items = {'default:bookshelf'}, rarity = 15,},
|
||||
{items = {'default:pick_mese'}, rarity = 20,},
|
||||
{items = {'default:shovel_steel'}, rarity = 15,},
|
||||
{items = {'default:axe_steel'}, rarity = 15,},
|
||||
{items = {'default:pick_steel'}, rarity = 15,},
|
||||
{items = {'default:sign_wall'}, rarity = 20,},
|
||||
{items = {'default:chest'}, rarity = 20,},
|
||||
{items = {'default:furnace'}, rarity = 20,},
|
||||
{items = {'default:steelblock'}, rarity = 25,},
|
||||
{items = {'default:coal_lump'}, rarity = 25,},
|
||||
{items = {'default:pick_diamond'}, rarity = 30,},
|
||||
{items = {'default:shovel_diamond'}, rarity = 30,},
|
||||
{items = {'default:axe_diamond'}, rarity = 30,},
|
||||
{items = {'default:diamondblock'}, rarity = 30,},
|
||||
{items = {'fire:flint_and_steel'}, rarity = 15,},
|
||||
{items = {'default:chest_locked'}, rarity = 20,},
|
||||
{items = {'default:brick'}, rarity = 25,},
|
||||
{items = {'default:dirt_with_grass'}, rarity = 30,},
|
||||
{items = {'christmas_craft:Christmas_present_red'}, rarity = 1,},
|
||||
}},
|
||||
sounds = default.node_sound_dirt_defaults({
|
||||
footstep = {name="default_grass_footstep", gain=0.4},
|
||||
}),
|
||||
})
|
||||
|
||||
minetest.register_node("christmas_craft:Christmas_present_violet", {
|
||||
description = "Christmas Present Violet ",
|
||||
tiles = {"christmas_craft_present_vi.png^christmas_craft_bow_top.png", "christmas_craft_present_vi.png^christmas_craft_bow_bottom.png", "christmas_craft_present_vi.png^christmas_craft_bow_side.png"},
|
||||
is_ground_content = true,
|
||||
groups = {crumbly=3},
|
||||
drop = {
|
||||
max_items = 2, items = {
|
||||
{items = {'default:bookshelf'}, rarity = 15,},
|
||||
{items = {'default:pick_mese'}, rarity = 20,},
|
||||
{items = {'default:shovel_steel'}, rarity = 15,},
|
||||
{items = {'default:axe_steel'}, rarity = 15,},
|
||||
{items = {'default:pick_steel'}, rarity = 15,},
|
||||
{items = {'default:sign_wall'}, rarity = 20,},
|
||||
{items = {'default:chest'}, rarity = 20,},
|
||||
{items = {'default:furnace'}, rarity = 20,},
|
||||
{items = {'default:steelblock'}, rarity = 25,},
|
||||
{items = {'default:coal_lump'}, rarity = 25,},
|
||||
{items = {'default:pick_diamond'}, rarity = 30,},
|
||||
{items = {'default:shovel_diamond'}, rarity = 30,},
|
||||
{items = {'default:axe_diamond'}, rarity = 30,},
|
||||
{items = {'default:diamondblock'}, rarity = 30,},
|
||||
{items = {'fire:flint_and_steel'}, rarity = 15,},
|
||||
{items = {'default:chest_locked'}, rarity = 20,},
|
||||
{items = {'default:brick'}, rarity = 25,},
|
||||
{items = {'default:dirt_with_grass'}, rarity = 30,},
|
||||
{items = {'christmas_craft:Christmas_present_violet'}, rarity = 1,},
|
||||
}},
|
||||
sounds = default.node_sound_dirt_defaults({
|
||||
footstep = {name="default_grass_footstep", gain=0.4},
|
||||
}),
|
||||
})
|
||||
|
||||
minetest.register_node("christmas_craft:Christmas_present_orange", {
|
||||
description = "Christmas Present Orange ",
|
||||
tiles = {"christmas_craft_present_or.png^christmas_craft_bow_top.png", "christmas_craft_present_or.png^christmas_craft_bow_bottom.png", "christmas_craft_present_or.png^christmas_craft_bow_side.png"},
|
||||
is_ground_content = true,
|
||||
groups = {crumbly=3},
|
||||
drop = {
|
||||
max_items = 2, items = {
|
||||
{items = {'default:bookshelf'}, rarity = 15,},
|
||||
{items = {'default:pick_mese'}, rarity = 20,},
|
||||
{items = {'default:shovel_steel'}, rarity = 15,},
|
||||
{items = {'default:axe_steel'}, rarity = 15,},
|
||||
{items = {'default:pick_steel'}, rarity = 15,},
|
||||
{items = {'default:sign_wall'}, rarity = 20,},
|
||||
{items = {'default:chest'}, rarity = 20,},
|
||||
{items = {'default:furnace'}, rarity = 20,},
|
||||
{items = {'default:steelblock'}, rarity = 25,},
|
||||
{items = {'default:coal_lump'}, rarity = 25,},
|
||||
{items = {'default:pick_diamond'}, rarity = 30,},
|
||||
{items = {'default:shovel_diamond'}, rarity = 30,},
|
||||
{items = {'default:axe_diamond'}, rarity = 30,},
|
||||
{items = {'default:diamondblock'}, rarity = 30,},
|
||||
{items = {'fire:flint_and_steel'}, rarity = 15,},
|
||||
{items = {'default:chest_locked'}, rarity = 20,},
|
||||
{items = {'default:brick'}, rarity = 25,},
|
||||
{items = {'default:dirt_with_grass'}, rarity = 30,},
|
||||
{items = {'christmas_craft:Christmas_present_orange'}, rarity = 1,},
|
||||
}},
|
||||
sounds = default.node_sound_dirt_defaults({
|
||||
footstep = {name="default_grass_footstep", gain=0.4},
|
||||
}),
|
||||
})
|
||||
|
||||
minetest.register_node("christmas_craft:Christmas_present_pink", {
|
||||
description = "Christmas Present Pink ",
|
||||
tiles = {"christmas_craft_present_pi.png^christmas_craft_bow_top.png", "christmas_craft_present_pi.png^christmas_craft_bow_bottom.png", "christmas_craft_present_pi.png^christmas_craft_bow_side.png"},
|
||||
is_ground_content = true,
|
||||
groups = {crumbly=3},
|
||||
drop = {
|
||||
max_items = 2, items = {
|
||||
{items = {'default:bookshelf'}, rarity = 15,},
|
||||
{items = {'default:pick_mese'}, rarity = 20,},
|
||||
{items = {'default:shovel_steel'}, rarity = 15,},
|
||||
{items = {'default:axe_steel'}, rarity = 15,},
|
||||
{items = {'default:pick_steel'}, rarity = 15,},
|
||||
{items = {'default:sign_wall'}, rarity = 20,},
|
||||
{items = {'default:chest'}, rarity = 20,},
|
||||
{items = {'default:furnace'}, rarity = 20,},
|
||||
{items = {'default:steelblock'}, rarity = 25,},
|
||||
{items = {'default:coal_lump'}, rarity = 25,},
|
||||
{items = {'default:pick_diamond'}, rarity = 30,},
|
||||
{items = {'default:shovel_diamond'}, rarity = 30,},
|
||||
{items = {'default:axe_diamond'}, rarity = 30,},
|
||||
{items = {'default:diamondblock'}, rarity = 30,},
|
||||
{items = {'fire:flint_and_steel'}, rarity = 15,},
|
||||
{items = {'default:chest_locked'}, rarity = 20,},
|
||||
{items = {'default:brick'}, rarity = 25,},
|
||||
{items = {'default:dirt_with_grass'}, rarity = 30,},
|
||||
{items = {'christmas_craft:Christmas_present_pink'}, rarity = 1,},
|
||||
}},
|
||||
sounds = default.node_sound_dirt_defaults({
|
||||
footstep = {name="default_grass_footstep", gain=0.4},
|
||||
}),
|
||||
})
|
||||
------------
|
||||
|
||||
------------
|
||||
--Items--
|
||||
|
||||
-- paper --
|
||||
|
||||
minetest.register_craftitem("christmas_craft:paper_blue", {
|
||||
description = "Blue paper",
|
||||
inventory_image = "christmas_craft_paper_bl.png",
|
||||
stack_max = 99,
|
||||
liquids_pointable = false,
|
||||
})
|
||||
|
||||
minetest.register_craftitem("christmas_craft:paper_yellow", {
|
||||
description = "Yellow paper",
|
||||
inventory_image = "christmas_craft_paper_ye.png",
|
||||
stack_max = 99,
|
||||
liquids_pointable = false,
|
||||
})
|
||||
|
||||
minetest.register_craftitem("christmas_craft:paper_green", {
|
||||
description = "Green paper",
|
||||
inventory_image = "christmas_craft_paper_gr.png",
|
||||
stack_max = 99,
|
||||
liquids_pointable = false,
|
||||
})
|
||||
|
||||
minetest.register_craftitem("christmas_craft:paper_red", {
|
||||
description = "Red paper",
|
||||
inventory_image = "christmas_craft_paper_re.png",
|
||||
stack_max = 99,
|
||||
liquids_pointable = false,
|
||||
})
|
||||
|
||||
minetest.register_craftitem("christmas_craft:paper_violet", {
|
||||
description = "Violet paper",
|
||||
inventory_image = "christmas_craft_paper_vi.png",
|
||||
stack_max = 99,
|
||||
liquids_pointable = false,
|
||||
})
|
||||
|
||||
minetest.register_craftitem("christmas_craft:paper_orange", {
|
||||
description = "Orange paper",
|
||||
inventory_image = "christmas_craft_paper_or.png",
|
||||
stack_max = 99,
|
||||
liquids_pointable = false,
|
||||
})
|
||||
|
||||
minetest.register_craftitem("christmas_craft:paper_pink", {
|
||||
description = "Pink paper",
|
||||
inventory_image = "christmas_craft_paper_pi.png",
|
||||
stack_max = 99,
|
||||
liquids_pointable = false,
|
||||
})
|
||||
|
||||
-- string --
|
||||
|
||||
minetest.register_craftitem("christmas_craft:red_ribbon", {
|
||||
description = "Red Ribbon",
|
||||
inventory_image = "christmas_craft_red_ribbon.png",
|
||||
stack_max = 99,
|
||||
liquids_pointable = false,
|
||||
})
|
||||
|
||||
-- wish list --
|
||||
|
||||
minetest.register_craftitem("christmas_craft:wish_list", {
|
||||
description = "Wish list",
|
||||
inventory_image = "christmas_craft_which_list.png",
|
||||
stack_max = 99,
|
||||
liquids_pointable = false,
|
||||
})
|
||||
|
||||
------------
|
||||
|
||||
-- minetest.register_craftitem("christmas_craft:snow_ball", {
|
||||
-- description = "Snow ball",
|
||||
-- inventory_image = "snow_ball.png",
|
||||
-- stack_max = 16,
|
||||
-- liquids_pointable = false,
|
||||
--})
|
||||
|
||||
|
||||
-- crafts --
|
||||
|
||||
--for craft see in craft.lua
|
||||
|
||||
-- override --
|
||||
--minetest.registered_nodes["default:stick"].drawtype="torchlike";
|
||||
--minetest.registered_nodes["default:stick"].selection_box = {
|
||||
-- type = "wallmounted",
|
||||
-- wall_side = {-0.5, -0.3, -0.1, -0.5+0.3, 0.3, 0.1},
|
||||
-- }
|
||||
|
||||
--OMG pourquoi override le stick normal !!!
|
||||
--[[minetest.register_node(":default:stick", {
|
||||
description = "stick",
|
||||
drawtype = "torchlike",
|
||||
--tiles = {"default_torch_on_floor.png", "default_torch_on_ceiling.png", "default_torch.png"},
|
||||
tiles = {"side_stick.png"},
|
||||
inventory_image = "side_stick.png",
|
||||
wield_image = "side_stick.png",
|
||||
inventory_image = "default_stick.png",
|
||||
wield_image = "default_stick.png",
|
||||
paramtype = "light",
|
||||
paramtype2 = "wallmounted",
|
||||
sunlight_propagates = true,
|
||||
@ -66,11 +712,16 @@ minetest.register_node(":default:stick", {
|
||||
type = "wallmounted",
|
||||
wall_side = {-0.5, -0.3, -0.1, -0.5+0.3, 0.3, 0.1},
|
||||
},
|
||||
groups = {choppy=2,dig_immediate=3,flammable=1,stick=1},
|
||||
groups = {choppy=2,dig_immediate=3,flammable=1},
|
||||
legacy_wallmounted = true,
|
||||
sounds = default.node_sound_defaults(),
|
||||
})
|
||||
--]]
|
||||
|
||||
-- complex node --
|
||||
|
||||
-- disable christmas_craft:snowball and make alias to default:snow
|
||||
minetest.register_alias("christmas_craft:snowball", "default:snow")
|
||||
--[[
|
||||
snowball_DAMAGE=0.5
|
||||
snowball_GRAVITY=9
|
||||
@ -79,7 +730,7 @@ snowball_VELOCITY=19
|
||||
--Shoot snowball.
|
||||
local snow_shoot_snowball=function (item, player, pointed_thing)
|
||||
local playerpos=player:getpos()
|
||||
local obj=minetest.env:add_entity({x=playerpos.x,y=playerpos.y+1.5,z=playerpos.z}, "christmas_craft:snowball_entity")
|
||||
local obj=minetest.add_entity({x=playerpos.x,y=playerpos.y+1.5,z=playerpos.z}, "christmas_craft:snowball_entity")
|
||||
local dir=player:get_look_dir()
|
||||
obj:setvelocity({x=dir.x*snowball_VELOCITY, y=dir.y*snowball_VELOCITY, z=dir.z*snowball_VELOCITY})
|
||||
obj:setacceleration({x=dir.x*-3, y=-snowball_GRAVITY, z=dir.z*-3})
|
||||
@ -104,11 +755,10 @@ snow_snowball_ENTITY={
|
||||
|
||||
|
||||
--Snowball_entity.on_step()--> called when snowball is moving.
|
||||
|
||||
snow_snowball_ENTITY.on_step = function(self, dtime)
|
||||
self.timer=self.timer+dtime
|
||||
local pos = self.object:getpos()
|
||||
local node = minetest.env:get_node(pos)
|
||||
local node = minetest.get_node(pos)
|
||||
|
||||
--Become item when hitting a node.
|
||||
if self.lastpos.x~=nil then --If there is no lastpos for some reason.
|
||||
@ -116,7 +766,7 @@ snow_snowball_ENTITY.on_step = function(self, dtime)
|
||||
self.object:remove()
|
||||
end
|
||||
if node.name == "default:water_source" then
|
||||
minetest.sound_play("snowball_splash",
|
||||
minetest.sound_play("cannons_splash",
|
||||
{pos = pos, gain = 1.0, max_hear_distance = 32,})
|
||||
self.object:remove()
|
||||
end
|
||||
@ -134,6 +784,7 @@ minetest.register_craftitem("christmas_craft:snowball", {
|
||||
inventory_image = "snowball.png",
|
||||
on_use = snow_shoot_snowball,
|
||||
})
|
||||
--]]
|
||||
|
||||
--Snow.
|
||||
minetest.register_node("christmas_craft:snow", {
|
||||
@ -147,7 +798,7 @@ minetest.register_node("christmas_craft:snow", {
|
||||
--1 = Moss
|
||||
groups = {crumbly=3,melts=1,falling_node=1},
|
||||
buildable_to = true,
|
||||
drop = 'christmas_craft:snowball',
|
||||
drop = 'default:snow',
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
@ -164,4 +815,3 @@ minetest.register_node("christmas_craft:snow", {
|
||||
footstep = {name="default_gravel_footstep", gain=0.45},
|
||||
}),
|
||||
})
|
||||
]]--
|
||||
|
Reference in New Issue
Block a user