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()
|
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",
|
||||||
|
183
snow.lua
@ -1,118 +1,103 @@
|
|||||||
|
|
||||||
print (" ---- Overrider christmas_craft = true! ---- ")
|
print (" ---- Overrider christmas_craft = true! ---- ")
|
||||||
|
|
||||||
minetest.register_node(":default:dirt_with_grass", {
|
local snowballdrop = {items = {'default:snow'}, rarity = 0}
|
||||||
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 add_drop = function (def)
|
||||||
minetest.register_node(":default:leaves", {
|
if type(def.drop) == "table" then
|
||||||
description = "Leaves",
|
if def.drop.max_items then
|
||||||
drawtype = "allfaces_optional",
|
def.drop.max_items = def.drop.max_items + 1
|
||||||
waving = 1,
|
end
|
||||||
visual_scale = 1.3,
|
table.insert(def.drop.items, snowballdrop)
|
||||||
tiles = {"christmas_leaves_side.png"},
|
elseif type(def.drop) == "string" then
|
||||||
special_tiles = {"default_leaves_simple.png"},
|
def.drop = {
|
||||||
paramtype = "light",
|
items = {
|
||||||
is_ground_content = false,
|
{items = {def.drop}, rarity = 0},
|
||||||
groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
|
snowballdrop
|
||||||
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'},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
else
|
||||||
sounds = default.node_sound_leaves_defaults(),
|
def.drop = {
|
||||||
|
items = {
|
||||||
after_place_node = default.after_place_leaves,
|
snowballdrop
|
||||||
})
|
}
|
||||||
|
|
||||||
|
|
||||||
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"}}
|
|
||||||
}
|
}
|
||||||
},
|
end
|
||||||
sounds = default.node_sound_leaves_defaults(),
|
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,
|
||||||
|
})
|
||||||
|
|
||||||
|
local nodebox = {
|
||||||
-- old code
|
type = "fixed",
|
||||||
--[[
|
fixed = {
|
||||||
minetest.register_node(":default:leaves", {
|
{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}
|
||||||
description = "Leaves",
|
}
|
||||||
|
}
|
||||||
|
local leavesoverride = {
|
||||||
drawtype = "nodebox",
|
drawtype = "nodebox",
|
||||||
visual_scale = 1.3,
|
visual_scale = 1,
|
||||||
tiles = {"default_snow.png", "christmas_leaves_bot.png", "christmas_leaves_side.png"},
|
tiles = {"snow.png", "christmas_craft_leaves_top.png", "christmas_craft_leaves_side.png"},
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
|
node_box = nodebox,
|
||||||
drop = {
|
selection_box = nodebox
|
||||||
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},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
})
|
-- 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] ---- ")
|
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 |