Compare commits
3 Commits
nalc-1.2.0
...
master
Author | SHA1 | Date | |
---|---|---|---|
9c88d44223 | |||
c6cbae450b | |||
0acdd5435b |
@ -1,4 +1 @@
|
|||||||
default
|
default
|
||||||
youngtrees?
|
|
||||||
woodsoil?
|
|
||||||
flowers?
|
|
5
init.lua
@ -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
@ -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
|
@ -83,7 +83,7 @@ minetest.register_craft({
|
|||||||
output = "christmas_craft:snowman",
|
output = "christmas_craft:snowman",
|
||||||
recipe = {
|
recipe = {
|
||||||
{"default:coal_lump","default:snow","default:coal_lump"},
|
{"default:coal_lump","default:snow","default:coal_lump"},
|
||||||
{"default:snow","default:snow","default:snow"},
|
{"default:snow","christmas_craft:snowball","default:snow"},
|
||||||
{"default:coal_lump","default:coal_lump","default:coal_lump"},
|
{"default:coal_lump","default:coal_lump","default:coal_lump"},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -21,26 +21,9 @@ minetest.register_node("christmas_craft:present_box", {
|
|||||||
|
|
||||||
-- coloured Present --
|
-- coloured Present --
|
||||||
|
|
||||||
local function register_paper(name, description, colorCode, dye)
|
|
||||||
|
|
||||||
minetest.register_craftitem("christmas_craft:paper_".. name, {
|
|
||||||
description = description .."paper",
|
|
||||||
inventory_image = "default_paper.png^[colorize:#" .. colorCode,
|
|
||||||
stack_max = 99,
|
|
||||||
liquids_pointable = false,
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_craft({
|
|
||||||
type = "shapeless",
|
|
||||||
output = 'christmas_craft:paper_'.. name,
|
|
||||||
recipe = {'dye:'..dye,'default:paper'},
|
|
||||||
})
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
local function register_present(name, description, colorCode, dye)
|
local function register_present(name, description, colorCode, dye)
|
||||||
|
|
||||||
minetest.register_node("christmas_craft:christmas_present_"..name, {
|
minetest.register_node("christmas_craft:Christmas_present_"..name, {
|
||||||
description = description .." Christmas Present",
|
description = description .." Christmas Present",
|
||||||
tiles = {
|
tiles = {
|
||||||
"christmas_present.png^[colorize:#" ..colorCode.. "^christmas_bow_top.png",
|
"christmas_present.png^[colorize:#" ..colorCode.. "^christmas_bow_top.png",
|
||||||
@ -101,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 = {
|
||||||
@ -171,6 +154,23 @@ local function register_baubles(name, description, colorCode, dye)
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function register_paper(name, description, colorCode, dye)
|
||||||
|
|
||||||
|
minetest.register_craftitem("christmas_craft:paper_".. name, {
|
||||||
|
description = description .."paper",
|
||||||
|
inventory_image = "default_paper.png^[colorize:#" .. colorCode,
|
||||||
|
stack_max = 99,
|
||||||
|
liquids_pointable = false,
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
type = "shapeless",
|
||||||
|
output = 'christmas_craft:paper_'.. name,
|
||||||
|
recipe = {'dye:'..dye,'default:paper'},
|
||||||
|
})
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
colours = {
|
colours = {
|
||||||
-- RGB Prime Colours --
|
-- RGB Prime Colours --
|
||||||
{name="red", code="FF000099", description="Red", dye="red"},
|
{name="red", code="FF000099", description="Red", dye="red"},
|
||||||
@ -183,7 +183,7 @@ colours = {
|
|||||||
-- RGB Other Colours --
|
-- RGB Other Colours --
|
||||||
{name="orange", code="E5940099", description="Orange", dye="orange"},
|
{name="orange", code="E5940099", description="Orange", dye="orange"},
|
||||||
{name="darkgreen", code="004C0099", description="Dark Green", dye="dark_green"},
|
{name="darkgreen", code="004C0099", description="Dark Green", dye="dark_green"},
|
||||||
{name="violet", code="80008099", description="Violet", dye="violet"},
|
{name="violet", code="80008099", description="Violet", dye="purple"},
|
||||||
{name="pink", code="FFC0CB99", description="Pink", dye="pink"},
|
{name="pink", code="FFC0CB99", description="Pink", dye="pink"},
|
||||||
{name="brown", code="732c0b99", description="Brown", dye="brown"},
|
{name="brown", code="732c0b99", description="Brown", dye="brown"},
|
||||||
-- MonoChrome --
|
-- MonoChrome --
|
||||||
|
@ -6,7 +6,7 @@ minetest.register_alias("christmas_craft:snow_block", "default:snowblock")
|
|||||||
|
|
||||||
minetest.register_alias("christmas_craft:silver_baubles", "christmas_craft:white_baubles")
|
minetest.register_alias("christmas_craft:silver_baubles", "christmas_craft:white_baubles")
|
||||||
|
|
||||||
minetest.register_alias("christmas_craft:Christmas_present", "christmas_craft:christmas_present_white")
|
minetest.register_alias("christmas_craft:Christmas_present", "christmas_craft:Christmas_present_white")
|
||||||
|
|
||||||
-- ========== --
|
-- ========== --
|
||||||
-- misk nodes --
|
-- misk nodes --
|
||||||
@ -329,11 +329,33 @@ minetest.register_node("christmas_craft:candy_cane_tree", {
|
|||||||
on_place = minetest.rotate_node
|
on_place = minetest.rotate_node
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.override_item("default:snow", {
|
minetest.register_node(":default:snow", {
|
||||||
|
description = "Snow",
|
||||||
|
tiles = {"default_snow.png"},
|
||||||
|
inventory_image = "default_snowball.png",
|
||||||
|
wield_image = "default_snowball.png",
|
||||||
|
paramtype = "light",
|
||||||
|
buildable_to = true,
|
||||||
|
walkable = false,
|
||||||
|
floodable = true,
|
||||||
|
drawtype = "nodebox",
|
||||||
node_box = {
|
node_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = {
|
fixed = {
|
||||||
{-0.5, -0.5, -0.5, 0.5, -0.125, 0.5},
|
{-0.5, -0.5, -0.5, 0.5, -0.125, 0.5},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
groups = {crumbly = 3, falling_node = 1, puts_out_fire = 1},
|
||||||
|
sounds = default.node_sound_dirt_defaults({
|
||||||
|
footstep = {name = "default_snow_footstep", gain = 0.15},
|
||||||
|
dug = {name = "default_snow_footstep", gain = 0.2},
|
||||||
|
dig = {name = "default_snow_footstep", gain = 0.2}
|
||||||
|
}),
|
||||||
|
|
||||||
|
on_construct = function(pos)
|
||||||
|
pos.y = pos.y - 1
|
||||||
|
if minetest.get_node(pos).name == "default:dirt_with_grass" then
|
||||||
|
minetest.set_node(pos, {name = "default:dirt_with_snow"})
|
||||||
|
end
|
||||||
|
end,
|
||||||
})
|
})
|
||||||
|
207
snow.lua
@ -1,125 +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,
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.override_item(
|
minetest.register_node(":default:leaves", {
|
||||||
"default:dry_dirt_with_dry_grass", {
|
description = "Leaves",
|
||||||
tiles = {"default_snow.png", "default_dry_dirt.png",
|
drawtype = "allfaces_optional",
|
||||||
{name = "default_dry_dirt.png^default_snow_side.png",
|
waving = 1,
|
||||||
tileable_vertical = false}},
|
visual_scale = 1.3,
|
||||||
sounds = data.sounds,
|
tiles = {"christmas_leaves_side.png"},
|
||||||
})
|
special_tiles = {"default_leaves_simple.png"},
|
||||||
|
|
||||||
minetest.override_item(
|
|
||||||
"default:dirt_with_rainforest_litter", {
|
|
||||||
tiles = data.tiles,
|
|
||||||
sounds = data.sounds,
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.override_item(
|
|
||||||
"default:dirt_with_coniferous_litter", {
|
|
||||||
tiles = data.tiles,
|
|
||||||
sounds = data.sounds,
|
|
||||||
})
|
|
||||||
|
|
||||||
local nodebox = {
|
|
||||||
type = "fixed",
|
|
||||||
fixed = {
|
|
||||||
{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
local leavesoverride = {
|
|
||||||
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"}})
|
|
||||||
minetest.override_item("default:dry_grass_" .. i, {tiles = {"christmas_dry_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", "chrysanthemum_green", "tulip_black"}) 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] ---- ")
|
||||||
|
Before Width: | Height: | Size: 219 B After Width: | Height: | Size: 304 B |
Before Width: | Height: | Size: 208 B After Width: | Height: | Size: 238 B |
Before Width: | Height: | Size: 235 B After Width: | Height: | Size: 440 B |
Before Width: | Height: | Size: 271 B After Width: | Height: | Size: 755 B |
Before Width: | Height: | Size: 295 B After Width: | Height: | Size: 301 B |
Before Width: | Height: | Size: 187 B After Width: | Height: | Size: 380 B |
Before Width: | Height: | Size: 205 B After Width: | Height: | Size: 209 B |
Before Width: | Height: | Size: 187 B After Width: | Height: | Size: 311 B |
Before Width: | Height: | Size: 187 B After Width: | Height: | Size: 309 B |
Before Width: | Height: | Size: 261 B |
Before Width: | Height: | Size: 261 B |
Before Width: | Height: | Size: 177 B After Width: | Height: | Size: 332 B |
Before Width: | Height: | Size: 156 B |
Before Width: | Height: | Size: 194 B |
Before Width: | Height: | Size: 222 B |
Before Width: | Height: | Size: 249 B |
Before Width: | Height: | Size: 271 B |
Before Width: | Height: | Size: 210 B After Width: | Height: | Size: 262 B |
Before Width: | Height: | Size: 151 B |
Before Width: | Height: | Size: 155 B |
Before Width: | Height: | Size: 193 B |
Before Width: | Height: | Size: 170 B |
Before Width: | Height: | Size: 202 B |
Before Width: | Height: | Size: 205 B |
Before Width: | Height: | Size: 205 B After Width: | Height: | Size: 273 B |
Before Width: | Height: | Size: 261 B After Width: | Height: | Size: 434 B |
Before Width: | Height: | Size: 261 B After Width: | Height: | Size: 602 B |
Before Width: | Height: | Size: 222 B After Width: | Height: | Size: 355 B |
Before Width: | Height: | Size: 165 B After Width: | Height: | Size: 181 B |
Before Width: | Height: | Size: 186 B After Width: | Height: | Size: 403 B |
Before Width: | Height: | Size: 201 B After Width: | Height: | Size: 264 B |
Before Width: | Height: | Size: 178 B After Width: | Height: | Size: 407 B |
Before Width: | Height: | Size: 173 B After Width: | Height: | Size: 382 B |
Before Width: | Height: | Size: 186 B After Width: | Height: | Size: 464 B |
Before Width: | Height: | Size: 172 B After Width: | Height: | Size: 343 B |
Before Width: | Height: | Size: 205 B After Width: | Height: | Size: 808 B |
Before Width: | Height: | Size: 227 B |
Before Width: | Height: | Size: 277 B |
Before Width: | Height: | Size: 210 B After Width: | Height: | Size: 548 B |
Before Width: | Height: | Size: 242 B After Width: | Height: | Size: 536 B |
Before Width: | Height: | Size: 214 B After Width: | Height: | Size: 635 B |
Before Width: | Height: | Size: 200 B |
Before Width: | Height: | Size: 249 B |
Before Width: | Height: | Size: 178 B |
Before Width: | Height: | Size: 122 B |
Before Width: | Height: | Size: 118 B |
Before Width: | Height: | Size: 203 B After Width: | Height: | Size: 342 B |
Before Width: | Height: | Size: 269 B |
Before Width: | Height: | Size: 120 B |
Before Width: | Height: | Size: 124 B |
Before Width: | Height: | Size: 180 B |
Before Width: | Height: | Size: 117 B |