forked from mtcontrib/christmas_craft
158 lines
4.6 KiB
Lua
158 lines
4.6 KiB
Lua
|
|
print (" ---- Overrider christmas_craft = true! ---- ")
|
|
|
|
local snowballdrop = {items = {'default:snow'}, rarity = 0}
|
|
|
|
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
|
|
}
|
|
}
|
|
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(
|
|
"default:dry_dirt_with_dry_grass", {
|
|
tiles = {"default_snow.png", "default_dry_dirt.png",
|
|
{name = "default_dry_dirt.png^default_snow_side.png",
|
|
tileable_vertical = false}},
|
|
sounds = data.sounds,
|
|
})
|
|
|
|
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,
|
|
})
|
|
|
|
-- Replace woodsoils
|
|
local woodsoils = {
|
|
"woodsoils:grass_with_leaves_1",
|
|
"woodsoils:grass_with_leaves_2",
|
|
"woodsoils:dirt_with_leaves_1",
|
|
"woodsoils:dirt_with_leaves_2"
|
|
}
|
|
|
|
for _,woodsoil in pairs(woodsoils) do
|
|
if minetest.registered_nodes[woodsoil] then
|
|
minetest.override_item(
|
|
woodsoil, {
|
|
tiles = { "default_snow.png", "default_dirt.png", "grass_w_snow_side.png" },
|
|
sounds = data.sounds
|
|
})
|
|
add_drop(minetest.registered_nodes[woodsoil])
|
|
end
|
|
end
|
|
|
|
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"},
|
|
tiles = {"christmas_craft_leaves_side.png"},
|
|
-- paramtype = "light",
|
|
-- 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)
|
|
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.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 bushes
|
|
if minetest.registered_items["bushes:BushLeaves1"] then
|
|
minetest.override_item("bushes:BushLeaves1", {tiles = {"christmas_bushes_leaves.png"}})
|
|
minetest.override_item("bushes:BushLeaves2", {tiles = {"christmas_bushes_leaves.png"}})
|
|
minetest.override_item("bushes:bushbranches1",
|
|
{tiles = {"christmas_bushes_leaves.png", "christmas_bushes_branches_center.png"}})
|
|
minetest.override_item("bushes:bushbranches3",
|
|
{tiles = {"christmas_bushes_leaves.png", "christmas_bushes_branches_center.png"}})
|
|
minetest.override_item("bushes:bushbranches2", {
|
|
tiles = {
|
|
"christmas_bushes_leaves.png",
|
|
"christmas_bushes_branches_center.png",
|
|
"christmas_bushes_branches_left.png",
|
|
"christmas_bushes_branches_right.png",
|
|
"christmas_bushes_branches_center.png",
|
|
"christmas_bushes_branches_right.png"
|
|
}})
|
|
minetest.override_item("bushes:bushbranches4", {
|
|
tiles = {
|
|
"christmas_bushes_leaves.png",
|
|
"christmas_bushes_branches_center.png",
|
|
"christmas_bushes_branches_left.png",
|
|
"christmas_bushes_branches_right.png",
|
|
"christmas_bushes_branches_center.png",
|
|
"christmas_bushes_branches_right.png"
|
|
}})
|
|
minetest.override_item("bushes:youngtree2_bottom", {
|
|
tiles = {"christmas_bushes_youngtree2trunk.png"},
|
|
inventory_image = "christmas_bushes_youngtree2trunk_inv.png",
|
|
wield_image = "christmas_bushes_youngtree2trunk_inv.png"
|
|
})
|
|
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] ---- ")
|