-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
15769f6
commit b7fe9e5
Showing
50 changed files
with
3,568 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
name = mp_morelights | ||
description = Morelights is a lightweight modpack providing flexible interior and exterior lighting options for different styles of builds. |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
default | ||
dye | ||
unifieddyes? | ||
xpanes? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
morelights = {} | ||
|
||
if minetest.get_modpath("xpanes") then | ||
morelights.glass = "xpanes:pane_flat" | ||
else | ||
morelights.glass = "default:glass" | ||
end | ||
|
||
function morelights.register_variants(variants, fixedDef) | ||
for _,variant in ipairs(variants) do | ||
local name = variant.name | ||
local def = table.copy(fixedDef) | ||
|
||
for k,v in pairs(variant) do | ||
if k ~= "name" then | ||
def[k] = v | ||
end | ||
end | ||
|
||
minetest.register_node(name, def) | ||
end | ||
end | ||
|
||
function morelights.on_place_hanging(itemstack, placer, pointed_thing, replaceName) | ||
local ceiling = minetest.get_node(vector.add(pointed_thing.above, | ||
{x=0, y=1, z=0})) | ||
|
||
if ceiling and ceiling.name ~= "air" | ||
and minetest.get_item_group(ceiling.name, "mounted_ceiling") == 0 | ||
and not (placer and placer:get_player_control().sneak) then | ||
|
||
local name = itemstack:get_name() | ||
local fakestack = itemstack | ||
fakestack:set_name(replaceName) | ||
|
||
minetest.item_place(fakestack, placer, pointed_thing, 0) | ||
itemstack:set_name(name) | ||
|
||
return itemstack | ||
end | ||
|
||
minetest.item_place(itemstack, placer, pointed_thing, 0) | ||
return itemstack | ||
end | ||
|
||
function morelights.rotate_and_place(itemstack, placer, pointed_thing, lookup) | ||
local dir = minetest.dir_to_wallmounted(vector.subtract(pointed_thing.under, pointed_thing.above)) | ||
local fDirs = lookup or {[0] = 20, 0, 16, 12, 8, 4} | ||
minetest.item_place(itemstack, placer, pointed_thing, fDirs[dir] or 0) | ||
return itemstack | ||
end | ||
|
||
local path = minetest.get_modpath("morelights") | ||
|
||
dofile(path .. "/nodes.lua") |
Oops, something went wrong.