3 Commits

24 changed files with 108 additions and 93 deletions

View File

@ -1,4 +1 @@
default default
youngtrees?
woodsoil?
flowers?

View File

@ -13,6 +13,9 @@ local config = Settings(worldpath.."/christmas_craft.conf")
local conf_table = config:to_table() local conf_table = config:to_table()
--look into readme.md how to change settings --look into readme.md how to change settings
local defaults = { local defaults = {
enable_snowing = "true", enable_snowing = "true",
@ -162,5 +165,3 @@ minetest.register_node("christmas_craft:snow", {
}), }),
}) })
]]-- ]]--
minetest.log("action", "[christmas_craft] loaded.")

3
mod.conf Normal file
View File

@ -0,0 +1,3 @@
name = christmas_craft
description = Bring the joy of Christmas to Minetest. This mod adds Christmas related things such as presents, baubles , decorations and more, also the mod can also allows you to cover the grass with snow, and make things such as snowmen. You can even have a snowball fight!
depends = default

View File

@ -84,7 +84,7 @@ minetest.register_node("christmas_craft:glass_bauble",{
}, },
is_ground_content = true, is_ground_content = true,
paramtype = "light", paramtype = "light",
use_texture_alpha = true, use_texture_alpha = "blend",
groups = {crumbly=3}, groups = {crumbly=3},
sounds = default.node_sound_glass_defaults(), sounds = default.node_sound_glass_defaults(),
node_box = { node_box = {

186
snow.lua
View File

@ -1,104 +1,118 @@
print (" ---- Overrider christmas_craft = true! ---- ") print (" ---- Overrider christmas_craft = true! ---- ")
local snowballdrop = {items = {'default:snow'}, rarity = 0} minetest.register_node(":default:dirt_with_grass", {
description = "Dirt with Grass",
local add_drop = function (def) tiles = {"default_snow.png", "default_dirt.png", "default_dirt.png^default_snow_side.png"},
if type(def.drop) == "table" then is_ground_content = true,
if def.drop.max_items then groups = {crumbly=3,soil=1},
def.drop.max_items = def.drop.max_items + 1 drop = {
end max_items = 2, items = {
table.insert(def.drop.items, snowballdrop) {items = {'default:dirt'}, rarity = 0,},
elseif type(def.drop) == "string" then {items = {'christmas_craft:snowball'}, rarity = 0,},
def.drop = { }},
items = { sounds = default.node_sound_dirt_defaults({
{items = {def.drop}, rarity = 0}, footstep = {name="default_grass_footstep", gain=0.4},
snowballdrop }),
}
}
else
def.drop = {
items = {
snowballdrop
}
}
end
end
local data = minetest.registered_nodes["default:dirt_with_snow"]
minetest.override_item(
"default:dirt_with_grass", {
tiles = data.tiles,
sounds = data.sounds,
}) })
minetest.override_item(
"default:dirt_with_dry_grass", {
tiles = data.tiles,
sounds = data.sounds,
})
local nodebox = { minetest.register_node(":default:leaves", {
type = "fixed", description = "Leaves",
fixed = { drawtype = "allfaces_optional",
{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5} waving = 1,
} visual_scale = 1.3,
} tiles = {"christmas_leaves_side.png"},
local leavesoverride = { special_tiles = {"default_leaves_simple.png"},
drawtype = "nodebox",
visual_scale = 1,
tiles = {"snow.png", "christmas_craft_leaves_top.png", "christmas_craft_leaves_side.png"},
paramtype = "light", paramtype = "light",
node_box = nodebox, is_ground_content = false,
selection_box = nodebox groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
} drop = {
max_items = 1,
items = {
{
-- player will get sapling with 1/20 chance
items = {'default:sapling'},
rarity = 20,
},
{
-- player will get leaves only if he get no saplings,
-- this is because max_items is 1
items = {'default:leaves'},
}
}
},
sounds = default.node_sound_leaves_defaults(),
-- replace leaves after_place_node = default.after_place_leaves,
minetest.override_item("default:leaves", leavesoverride) })
minetest.override_item("default:aspen_leaves", leavesoverride)
minetest.override_item("default:jungleleaves", leavesoverride)
minetest.override_item("default:bush_leaves", leavesoverride)
-- replace grass
for i=1,5 do
minetest.override_item("default:grass_" .. i, {tiles = {"christmas_grass_"..i..".png"}})
end
-- Replace junglegrass minetest.register_node(":default:aspen_leaves", {
minetest.override_item("default:junglegrass", {tiles = {"christmas_junglegrass.png"}}) description = "Aspen Leaves",
drawtype = "allfaces_optional",
visual_scale = 1.3,
tiles = {"christmas_aspen_leaves.png"},
waving = 1,
paramtype = "light",
is_ground_content = false,
groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
drop = {
max_items = 1,
items = {
{items = {"default:aspen_sapling"}, rarity = 20},
{items = {"default:aspen_leaves"}}
}
},
sounds = default.node_sound_leaves_defaults(),
-- Replace youngtrees after_place_node = default.after_place_leaves,
if minetest.registered_items["youngtrees:youngtree_top"] then })
minetest.override_item("youngtrees:youngtree_top", {tiles = {"christmas_youngtree16xa.png"}})
minetest.override_item("youngtrees:youngtree_middle", {tiles = {"christmas_youngtree16xb.png"}})
end
-- Replace woodsoils
if minetest.registered_items["woodsoils:grass_with_leaves_1"] then
minetest.override_item("woodsoils:grass_with_leaves_1", {tiles = {"snow.png", "default_dirt.png", "default_dirt.png^grass_w_snow_side.png"}})
add_drop(minetest.registered_items["woodsoils:grass_with_leaves_1"])
end
if minetest.registered_items["woodsoils:grass_with_leaves_2"] then
minetest.override_item("woodsoils:grass_with_leaves_2", {tiles = {"snow.png", "default_dirt.png", "default_dirt.png^grass_w_snow_side.png"}})
add_drop(minetest.registered_items["woodsoils:grass_with_leaves_2"])
end
if minetest.registered_items["woodsoils:dirt_with_leaves_1"] then -- old code
minetest.override_item("woodsoils:dirt_with_leaves_1", {tiles = {"snow.png", "default_dirt.png", "default_dirt.png^grass_w_snow_side.png^woodsoils_ground_cover_side.png"}}) --[[
add_drop(minetest.registered_items["woodsoils:dirt_with_leaves_1"]) minetest.register_node(":default:leaves", {
end description = "Leaves",
drawtype = "nodebox",
visual_scale = 1.3,
tiles = {"default_snow.png", "christmas_leaves_bot.png", "christmas_leaves_side.png"},
paramtype = "light",
groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
drop = {
max_items = 1,
items = {
{
-- player will get sapling with 1/20 chance
items = {'default:sapling'},
rarity = 20,
},
{
-- player will get leaves only if he get no saplings,
-- this is because max_items is 1
items = {'default:leaves'},
}
}
},
sounds = default.node_sound_leaves_defaults(),
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
},
},
selection_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
},
},
})
]]
if minetest.registered_items["woodsoils:dirt_with_leaves_2"] then
minetest.override_item("woodsoils:dirt_with_leaves_2", {tiles = {"snow.png", "default_dirt.png", "default_dirt.png^grass_w_snow_side.png^woodsoils_ground_cover_side.png"}})
add_drop(minetest.registered_items["woodsoils:dirt_with_leaves_2"])
end
-- replace flowers
for _,name in pairs({"dandelion_yellow", "geranium", "rose", "tulip", "dandelion_white", "viola"}) do
local flowername = "flowers:"..name
local tiles = { "snow_" .. name .. ".png" }
minetest.override_item(flowername, { tiles = tiles })
end
print (" ---- Overrider christmas_craft [OK] ---- ") print (" ---- Overrider christmas_craft [OK] ---- ")

Binary file not shown.

Before

Width:  |  Height:  |  Size: 495 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 338 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 151 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 155 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 193 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 170 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 202 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 205 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 205 B

After

Width:  |  Height:  |  Size: 273 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 344 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 277 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 342 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 249 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 122 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 118 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 269 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 117 B