Ajout du support des mods youngtrees, woodsoils, flowers
@ -1 +1,4 @@
|
||||
default
|
||||
default
|
||||
youngtrees?
|
||||
woodsoil?
|
||||
flowers?
|
||||
|
3
init.lua
@ -13,9 +13,6 @@ 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",
|
||||
|
183
snow.lua
@ -1,118 +1,103 @@
|
||||
|
||||
print (" ---- Overrider christmas_craft = true! ---- ")
|
||||
|
||||
minetest.register_node(":default:dirt_with_grass", {
|
||||
description = "Dirt with Grass",
|
||||
tiles = {"default_snow.png", "default_dirt.png", "default_dirt.png^default_snow_side.png"},
|
||||
is_ground_content = true,
|
||||
groups = {crumbly=3,soil=1},
|
||||
drop = {
|
||||
max_items = 2, items = {
|
||||
{items = {'default:dirt'}, rarity = 0,},
|
||||
{items = {'default:snow'}, rarity = 0,},
|
||||
}},
|
||||
sounds = default.node_sound_dirt_defaults({
|
||||
footstep = {name="default_grass_footstep", gain=0.4},
|
||||
}),
|
||||
})
|
||||
local snowballdrop = {items = {'default:snow'}, rarity = 0}
|
||||
|
||||
|
||||
minetest.register_node(":default:leaves", {
|
||||
description = "Leaves",
|
||||
drawtype = "allfaces_optional",
|
||||
waving = 1,
|
||||
visual_scale = 1.3,
|
||||
tiles = {"christmas_leaves_side.png"},
|
||||
special_tiles = {"default_leaves_simple.png"},
|
||||
paramtype = "light",
|
||||
is_ground_content = false,
|
||||
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'},
|
||||
local add_drop = function (def)
|
||||
if type(def.drop) == "table" then
|
||||
if def.drop.max_items then
|
||||
def.drop.max_items = def.drop.max_items + 1
|
||||
end
|
||||
table.insert(def.drop.items, snowballdrop)
|
||||
elseif type(def.drop) == "string" then
|
||||
def.drop = {
|
||||
items = {
|
||||
{items = {def.drop}, rarity = 0},
|
||||
snowballdrop
|
||||
}
|
||||
}
|
||||
},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
|
||||
after_place_node = default.after_place_leaves,
|
||||
})
|
||||
|
||||
|
||||
minetest.register_node(":default:aspen_leaves", {
|
||||
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"}}
|
||||
else
|
||||
def.drop = {
|
||||
items = {
|
||||
snowballdrop
|
||||
}
|
||||
}
|
||||
},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
end
|
||||
end
|
||||
|
||||
after_place_node = default.after_place_leaves,
|
||||
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,
|
||||
})
|
||||
|
||||
|
||||
-- old code
|
||||
--[[
|
||||
minetest.register_node(":default:leaves", {
|
||||
description = "Leaves",
|
||||
local nodebox = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}
|
||||
}
|
||||
}
|
||||
local leavesoverride = {
|
||||
drawtype = "nodebox",
|
||||
visual_scale = 1.3,
|
||||
tiles = {"default_snow.png", "christmas_leaves_bot.png", "christmas_leaves_side.png"},
|
||||
visual_scale = 1,
|
||||
tiles = {"snow.png", "christmas_craft_leaves_top.png", "christmas_craft_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},
|
||||
},
|
||||
},
|
||||
node_box = nodebox,
|
||||
selection_box = nodebox
|
||||
}
|
||||
|
||||
})
|
||||
-- replace leaves
|
||||
minetest.override_item("default:leaves", leavesoverride)
|
||||
minetest.override_item("default:aspen_leaves", leavesoverride)
|
||||
minetest.override_item("default:jungleleaves", leavesoverride)
|
||||
|
||||
]]
|
||||
-- replace grass
|
||||
for i=1,5 do
|
||||
minetest.override_item("default:grass_" .. i, {tiles = {"christmas_grass_"..i..".png"}})
|
||||
end
|
||||
|
||||
-- Replace junglegrass
|
||||
minetest.override_item("default:junglegrass", {tiles = {"christmas_junglegrass.png"}})
|
||||
|
||||
-- Replace youngtrees
|
||||
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
|
||||
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"])
|
||||
end
|
||||
|
||||
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] ---- ")
|
||||
|
BIN
textures/christmas_craft_leaves_side.png
Normal file
After Width: | Height: | Size: 495 B |
BIN
textures/christmas_craft_leaves_top.png
Normal file
After Width: | Height: | Size: 338 B |
BIN
textures/christmas_grass_1.png
Normal file
After Width: | Height: | Size: 151 B |
BIN
textures/christmas_grass_2.png
Normal file
After Width: | Height: | Size: 155 B |
BIN
textures/christmas_grass_3.png
Normal file
After Width: | Height: | Size: 193 B |
BIN
textures/christmas_grass_4.png
Normal file
After Width: | Height: | Size: 170 B |
BIN
textures/christmas_grass_5.png
Normal file
After Width: | Height: | Size: 202 B |
BIN
textures/christmas_junglegrass.png
Normal file
After Width: | Height: | Size: 205 B |
Before Width: | Height: | Size: 273 B After Width: | Height: | Size: 205 B |
BIN
textures/christmas_youngtree16xa.png
Normal file
After Width: | Height: | Size: 344 B |
BIN
textures/christmas_youngtree16xb.png
Normal file
After Width: | Height: | Size: 277 B |
BIN
textures/snow.png
Executable file
After Width: | Height: | Size: 342 B |
BIN
textures/snow_apple.png
Normal file
After Width: | Height: | Size: 249 B |
BIN
textures/snow_dandelion_white.png
Normal file
After Width: | Height: | Size: 122 B |
BIN
textures/snow_dandelion_yellow.png
Normal file
After Width: | Height: | Size: 118 B |
BIN
textures/snow_geranium.png
Normal file
After Width: | Height: | Size: 269 B |
BIN
textures/snow_rose.png
Normal file
After Width: | Height: | Size: 120 B |
BIN
textures/snow_tulip.png
Normal file
After Width: | Height: | Size: 124 B |
BIN
textures/snow_viola.png
Normal file
After Width: | Height: | Size: 117 B |