Huge update - lots of mods:

areas, biome_lib, blox, bobblocks, boost_cart, homedecor, mobs,
coloredwood, ilights, inbox, item_tweaks, moreblocks, moreores,
pipeworks, plasticbox, signs_lib, stainedglass, roads, unifieddyes,
vines, worldedit, xban2, maybe some others I didn't think about ;-)
This commit is contained in:
Vanessa Ezekowitz
2017-01-31 19:39:31 -05:00
parent 2922421f4a
commit 39f5cba27e
277 changed files with 31735 additions and 8666 deletions

View File

@@ -9,12 +9,11 @@
local modpath = minetest.get_modpath("homedecor")
local S = homedecor_i18n.gettext
homedecor = {
modpath = modpath,
-- Boilerplate to support localized strings if intllib mod is installed.
gettext = rawget(_G, "intllib") and intllib.Getter() or function(s) return s end,
-- infinite stacks
expect_infinite_stacks = minetest.setting_getbool("creative_mode") and not minetest.get_modpath("unified_inventory")
}
@@ -32,9 +31,6 @@ function homedecor.find_ceiling(itemstack, placer, pointed_thing)
itemstack, pointed_thing)
return
end
local pitch = placer:get_look_pitch()
local fdir = core.dir_to_facedir(placer:get_look_dir())
local wield_name = itemstack:get_name()
local above = pointed_thing.above
local under = pointed_thing.under
@@ -50,7 +46,6 @@ function homedecor.find_ceiling(itemstack, placer, pointed_thing)
if undef and undef.buildable_to then
pos = pointed_thing.under
node = unode
iswall = false
end
if core.is_protected(pos, placer:get_player_name()) then
@@ -66,20 +61,46 @@ function homedecor.find_ceiling(itemstack, placer, pointed_thing)
return isceiling, pos
end
-- call this function to reset the rotation of a "wallmounted" object on place
function homedecor.fix_rotation(pos, placer, itemstack, pointed_thing)
local node = minetest.get_node(pos)
local yaw = placer:get_look_yaw()
local dir = minetest.yaw_to_dir(yaw-1.5)
local pitch = placer:get_look_vertical()
local fdir = minetest.dir_to_wallmounted(dir)
if pitch < -(math.pi/4) then
fdir = 0
elseif pitch > math.pi/4 then
fdir = 1
end
minetest.swap_node(pos, { name = node.name, param2 = fdir })
end
-- use this when you have a "wallmounted" node that should never be oriented
-- to floor or ceiling (e.g. a desk lamp)
function homedecor.fix_rotation_nsew(pos, placer, itemstack, pointed_thing)
local node = minetest.get_node(pos)
local yaw = placer:get_look_yaw()
local dir = minetest.yaw_to_dir(yaw)
local fdir = minetest.dir_to_wallmounted(dir)
minetest.swap_node(pos, { name = node.name, param2 = fdir })
end
screwdriver = screwdriver or {}
homedecor.plain_wood = "homedecor_generic_wood_plain.png^"..
"(homedecor_generic_wood_boards_overlay.png^[colorize:#a7682020:100)"
homedecor.mahogany_wood = "(homedecor_generic_wood_plain.png^[colorize:#401010:125)^"..
"(homedecor_generic_wood_boards_overlay.png^[colorize:#66493880:200)"
homedecor.white_wood = "(homedecor_generic_wood_plain.png^[colorize:#e0f0ff:200)^"..
"(homedecor_generic_wood_boards_overlay.png^[colorize:#ffffff:200)"
homedecor.dark_wood = "(homedecor_generic_wood_plain.png^[colorize:#140900:200)^"..
"(homedecor_generic_wood_boards_overlay.png^[colorize:#21110180:180)"
homedecor.plain_wood = { name = "homedecor_generic_wood_plain.png", color = 0xffa76820 }
homedecor.mahogany_wood = { name = "homedecor_generic_wood_plain.png", color = 0xff7d2506 }
homedecor.white_wood = "homedecor_generic_wood_plain.png"
homedecor.dark_wood = { name = "homedecor_generic_wood_plain.png", color = 0xff39240f }
homedecor.lux_wood = { name = "homedecor_generic_wood_luxury.png", color = 0xff643f23 }
homedecor.color_black = 0xff303030
homedecor.color_dark_grey = 0xff606060
homedecor.color_med_grey = 0xffa0a0a0
-- load different handler subsystems
dofile(modpath.."/handlers/init.lua")
@@ -131,4 +152,4 @@ dofile(modpath.."/wardrobe.lua")
dofile(modpath.."/crafts.lua")
print("[HomeDecor] " .. homedecor.gettext("Loaded!"))
print("[HomeDecor] " .. S("Loaded!"))