mirror of
https://github.com/random-geek/morelights.git
synced 2024-11-27 01:23:44 +01:00
MineClone 2 support, translation support, switch to MTv5, other improvements
This commit is contained in:
parent
a7f40b1042
commit
460819178f
18
README.md
18
README.md
@ -1,15 +1,21 @@
|
||||
# morelights
|
||||
|
||||
Minetest mod adding additional lighting nodes.
|
||||
|
||||
![Screenshot](https://raw.githubusercontent.com/random-geek/morelights/master/screenshot.png "Screenshot")
|
||||
![Screenshot](screenshot.png)
|
||||
|
||||
The Morelights Modpack adds over 30 high-quality lighting nodes for your Minetest world.
|
||||
The Morelights modpack adds over 30 lighting and accessory nodes to suit various styles of builds, both interior and exterior.
|
||||
Includes basic light blocks, modern and historical-style lighting, and customizable street lamps.
|
||||
|
||||
Some nodes (ceiling lights, bar lights, poles) can be rotated to serve different purposes.
|
||||
|
||||
The modpack currently supports both Minetest Game and MineClone 2.
|
||||
|
||||
## Craft Recipes
|
||||
|
||||
Recipes for dark-variant nodes are the same as those of the light variants, except with dark grey dye instead of white dye.
|
||||
|
||||
![Craft Recipes](https://raw.githubusercontent.com/random-geek/morelights/master/crafts.png "Craft Recipes")
|
||||
Craft recipes for all items can be found in [crafts.md](crafts.md).
|
||||
|
||||
## Licenses
|
||||
Source code is licensed under the LGPL v3.0 license. All other media and assets are licensed under the CC BY-SA 4.0 license.
|
||||
|
||||
Source code is licensed under the LGPL v3.0 license.
|
||||
All other media and assets are licensed under the CC BY-SA 4.0 license.
|
||||
|
352
crafts.md
Normal file
352
crafts.md
Normal file
@ -0,0 +1,352 @@
|
||||
# Craft recipes for Morelights items
|
||||
|
||||
Copper = copper ingot (Minetest Game) or redstone (MineClone 2)
|
||||
|
||||
Dye = white or dark grey dye, depending on the desired color of the item.
|
||||
For MineClone 2, use bone meal or grey dye.
|
||||
|
||||
Dark Wood = jungle wood planks (Minetest Game) or spruce wood (MineClone 2).
|
||||
|
||||
Glass = regular, non-stained glass block.
|
||||
|
||||
Glass Pane = regular, non-stained glass pane.
|
||||
|
||||
Steel = steel ingot (Minetest Game) or iron ingot (MineClone 2).
|
||||
|
||||
## Basic items
|
||||
|
||||
### Light Bulb
|
||||
|
||||
Used for most other recipes.
|
||||
|
||||
```
|
||||
+--------+
|
||||
| Glass |
|
||||
+--------+
|
||||
| Copper |
|
||||
+--------+
|
||||
| Steel |
|
||||
+--------+
|
||||
```
|
||||
|
||||
### Metal Pole
|
||||
|
||||
```
|
||||
+-----+-------+
|
||||
| Dye | Steel |
|
||||
+-----+-------+
|
||||
| | Steel |
|
||||
+-----+-------+
|
||||
| | Steel |
|
||||
+-----+-------+
|
||||
```
|
||||
|
||||
### Metal Chain
|
||||
|
||||
```
|
||||
+-----+-------+
|
||||
| Dye | Steel |
|
||||
+-----+-------+
|
||||
| | |
|
||||
+-----+-------+
|
||||
| | Steel |
|
||||
+-----+-------+
|
||||
```
|
||||
|
||||
## Modern
|
||||
|
||||
### Modern Light Block
|
||||
|
||||
```
|
||||
+-------+-------+-------+
|
||||
| | Steel | |
|
||||
+-------+-------+-------+
|
||||
| Glass | Bulb | Glass |
|
||||
| Pane | | Pane |
|
||||
+-------+-------+-------+
|
||||
| | Steel | |
|
||||
+-------+-------+-------+
|
||||
```
|
||||
|
||||
### Modern Light Block (small)
|
||||
|
||||
```
|
||||
+-------+-------+-------+
|
||||
| | Steel | |
|
||||
+-------+-------+-------+
|
||||
| Glass | Bulb | Glass |
|
||||
| Pane | | Pane |
|
||||
+-------+-------+-------+
|
||||
```
|
||||
|
||||
### Modern Post Light
|
||||
|
||||
```
|
||||
+-----+-------+
|
||||
| Dye | Steel |
|
||||
+-----+-------+
|
||||
| | Bulb |
|
||||
+-----+-------+
|
||||
| | Steel |
|
||||
+-----+-------+
|
||||
```
|
||||
|
||||
### Street Lamp Post
|
||||
|
||||
```
|
||||
+-----+-------+-------+
|
||||
| Dye | Steel | Steel |
|
||||
+-----+-------+-------+
|
||||
| | Steel | |
|
||||
+-----+-------+-------+
|
||||
| | Steel | |
|
||||
+-----+-------+-------+
|
||||
```
|
||||
|
||||
### Ceiling Bar Light (connecting)
|
||||
|
||||
```
|
||||
+--------+-------+--------+
|
||||
| Steel | Steel | Steel |
|
||||
+--------+-------+--------+
|
||||
| Copper | Glass | Copper |
|
||||
+--------+-------+--------+
|
||||
```
|
||||
|
||||
Also can be crafted from one straight bar light.
|
||||
|
||||
### Ceiling Bar Light (straight)
|
||||
|
||||
Craft from one connecting bar light.
|
||||
|
||||
### Modern Ceiling Light
|
||||
|
||||
```
|
||||
+-------+-------+-------+
|
||||
| Steel | Bulb | Steel |
|
||||
+-------+-------+-------+
|
||||
| | Glass | |
|
||||
| | Pane | |
|
||||
+-------+-------+-------+
|
||||
```
|
||||
|
||||
### Modern Can Light
|
||||
|
||||
```
|
||||
+-------+-------+-------+
|
||||
| Dye | Steel | |
|
||||
+-------+-------+-------+
|
||||
| Steel | Bulb | Steel |
|
||||
+-------+-------+-------+
|
||||
```
|
||||
|
||||
### Modern Wall Lamp
|
||||
|
||||
```
|
||||
+-------+-------+-------+
|
||||
| | Glass | |
|
||||
| | Pane | |
|
||||
+-------+-------+-------+
|
||||
| Glass | Bulb | Steel |
|
||||
| Pane | | |
|
||||
+-------+-------+-------+
|
||||
| | Dark | Steel |
|
||||
| | Dye | |
|
||||
+-------+-------+-------+
|
||||
```
|
||||
|
||||
### Modern Table Lamp
|
||||
|
||||
```
|
||||
+------+-------+------+
|
||||
| | Steel | |
|
||||
+------+-------+------+
|
||||
| Wool | Bulb | Wool |
|
||||
+------+-------+------+
|
||||
| | Steel | |
|
||||
+------+-------+------+
|
||||
```
|
||||
|
||||
Use light/dark grey wool.
|
||||
|
||||
### Modern Path Light
|
||||
|
||||
```
|
||||
+-----+-------+
|
||||
| Dye | Bulb |
|
||||
+-----+-------+
|
||||
| | Steel |
|
||||
+-----+-------+
|
||||
| | Steel |
|
||||
+-----+-------+
|
||||
```
|
||||
|
||||
## Vintage
|
||||
|
||||
### Brass Ingot
|
||||
|
||||
Minetest Game: Craft from one steel and one tin ingot.
|
||||
|
||||
MineClone 2: Craft from one iron ingot and one redstone.
|
||||
|
||||
### Brass Chain
|
||||
|
||||
```
|
||||
+-------+
|
||||
| Brass |
|
||||
+-------+
|
||||
| |
|
||||
+-------+
|
||||
| Brass |
|
||||
+-------+
|
||||
```
|
||||
|
||||
### Vintage Light Block
|
||||
|
||||
```
|
||||
+-------+------+-------+
|
||||
| | Dark | |
|
||||
| | Wood | |
|
||||
+-------+------+-------+
|
||||
| Glass | Bulb | Glass |
|
||||
| Pane | | Pane |
|
||||
+-------+------+-------+
|
||||
| | Dark | |
|
||||
| | Wood | |
|
||||
+-------+------+-------+
|
||||
```
|
||||
|
||||
### Vintage Light Block (small)
|
||||
|
||||
```
|
||||
+-------+------+-------+
|
||||
| | Dark | |
|
||||
| | Wood | |
|
||||
+-------+------+-------+
|
||||
| Glass | Bulb | Glass |
|
||||
| Pane | | Pane |
|
||||
+-------+------+-------+
|
||||
```
|
||||
|
||||
### Vintage Lantern (floor, wall, or ceiling)
|
||||
|
||||
```
|
||||
+-------+-------+-------+
|
||||
| | Steel | |
|
||||
+-------+-------+-------+
|
||||
| Glass | Bulb | Glass |
|
||||
| Pane | | Pane |
|
||||
+-------+-------+-------+
|
||||
| Stick | Steel | Stick |
|
||||
+-------+-------+-------+
|
||||
```
|
||||
|
||||
### Vintage Hanging Light Bulb
|
||||
|
||||
```
|
||||
+--------+
|
||||
| Steel |
|
||||
+--------+
|
||||
| Copper |
|
||||
+--------+
|
||||
| Bulb |
|
||||
+--------+
|
||||
```
|
||||
|
||||
### Vintage Oil Lamp
|
||||
|
||||
```
|
||||
+--------+
|
||||
| Glass |
|
||||
+--------+
|
||||
| Cotton |
|
||||
+--------+
|
||||
| Brass |
|
||||
+--------+
|
||||
```
|
||||
|
||||
For MineClone 2, use string instead of cotton.
|
||||
|
||||
### Vintage Chandelier
|
||||
|
||||
```
|
||||
+-------+-------+-------+
|
||||
| | Brass | |
|
||||
+-------+-------+-------+
|
||||
| Bulb | Brass | Bulb |
|
||||
+-------+-------+-------+
|
||||
| Steel | Brass | Steel |
|
||||
+-------+-------+-------+
|
||||
```
|
||||
|
||||
# Extras
|
||||
|
||||
### Futuristic Light Block
|
||||
|
||||
```
|
||||
+---------+-------+---------+
|
||||
| Crystal | Steel | Crystal |
|
||||
+---------+-------+---------+
|
||||
| Glass | Bulb | Glass |
|
||||
| Pane | | Pane |
|
||||
+---------+-------+---------+
|
||||
| Crystal | Steel | Crystal |
|
||||
+---------+-------+---------+
|
||||
```
|
||||
|
||||
Crystal = mese fragment (Minetest Game) or nether quartz (MineClone 2).
|
||||
|
||||
### Grass Light
|
||||
|
||||
```
|
||||
+-------+-------+
|
||||
| | Glass |
|
||||
| | Pane |
|
||||
+-------+-------+
|
||||
| | Bulb |
|
||||
+-------+-------+
|
||||
| Grass | Dirt |
|
||||
+-------+-------+
|
||||
```
|
||||
|
||||
Note: use regular grass, NOT a grass block.
|
||||
|
||||
### Stone Block Light
|
||||
|
||||
```
|
||||
+-------+
|
||||
| Glass |
|
||||
| Pane |
|
||||
+-------+
|
||||
| Bulb |
|
||||
+-------+
|
||||
| Stone |
|
||||
| Block |
|
||||
+-------+
|
||||
```
|
||||
|
||||
For MineClone 2, use polished stone.
|
||||
|
||||
### Sandstone Block Light
|
||||
|
||||
```
|
||||
+-----------+
|
||||
| Glass |
|
||||
| Pane |
|
||||
+-----------+
|
||||
| Bulb |
|
||||
+-----------+
|
||||
| Sandstone |
|
||||
| Block |
|
||||
+-----------+
|
||||
```
|
||||
|
||||
For MineClone 2, use cut sandstone.
|
||||
|
||||
### Stair Light
|
||||
|
||||
```
|
||||
+-------+------+-------+
|
||||
| Steel | Bulb | Steel |
|
||||
+-------+------+-------+
|
||||
```
|
BIN
crafts.png
BIN
crafts.png
Binary file not shown.
Before Width: | Height: | Size: 98 KiB |
2
mod.conf
2
mod.conf
@ -1,2 +0,0 @@
|
||||
name = mp_morelights
|
||||
description = Morelights is a lightweight modpack providing flexible interior and exterior lighting options for different styles of builds.
|
2
modpack.conf
Normal file
2
modpack.conf
Normal file
@ -0,0 +1,2 @@
|
||||
name = mp_morelights
|
||||
description = A lightweight modpack providing flexible interior and exterior lighting options for different styles of builds.
|
@ -1,3 +0,0 @@
|
||||
default
|
||||
dye
|
||||
xpanes?
|
@ -1,5 +1,7 @@
|
||||
morelights = {}
|
||||
|
||||
-- TODO: Change node definition based on game if groups get too unwieldy.
|
||||
|
||||
function morelights.register_variants(variants, fixedDef)
|
||||
for _, variant in ipairs(variants) do
|
||||
local name = variant.name
|
||||
@ -16,21 +18,21 @@ function morelights.register_variants(variants, fixedDef)
|
||||
end
|
||||
|
||||
function morelights.on_place_hanging(itemstack, placer, pointed_thing,
|
||||
replaceName)
|
||||
ceilingName)
|
||||
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)
|
||||
if ceiling.name ~= "air"
|
||||
and minetest.get_item_group(ceiling.name, "mounted_ceiling") == 0
|
||||
and not (placer and placer:get_player_control().sneak) then
|
||||
-- Create a dummy itemstack with the ceiling variant's name.
|
||||
local fakeStack = ItemStack(itemstack)
|
||||
fakeStack:set_name(ceilingName)
|
||||
|
||||
minetest.item_place(fakeStack, placer, pointed_thing, 0)
|
||||
itemstack:set_name(name)
|
||||
|
||||
-- Subtract an item from the real itemstack if a node was placed.
|
||||
itemstack:set_count(fakeStack:get_count())
|
||||
return itemstack
|
||||
end
|
||||
|
||||
@ -47,33 +49,76 @@ function morelights.rotate_and_place(itemstack, placer, pointed_thing, lookup)
|
||||
end
|
||||
|
||||
|
||||
if minetest.get_modpath("mcl_core") then
|
||||
morelights.game = "mineclone2"
|
||||
elseif minetest.get_modpath("default") then
|
||||
morelights.game = "minetest_game"
|
||||
else
|
||||
error("Morelights requires a compatible game " ..
|
||||
"(Minetest Game or MineClone 2).")
|
||||
end
|
||||
|
||||
if morelights.game == "minetest_game" then
|
||||
morelights.sounds = {
|
||||
default = default.node_sound_defaults(),
|
||||
glass = default.node_sound_glass_defaults(),
|
||||
metal = default.node_sound_metal_defaults()
|
||||
}
|
||||
elseif morelights.game == "mineclone2" then
|
||||
morelights.sounds = {
|
||||
default = mcl_sounds.node_sound_defaults(),
|
||||
glass = mcl_sounds.node_sound_glass_defaults(),
|
||||
metal = mcl_sounds.node_sound_metal_defaults()
|
||||
}
|
||||
end
|
||||
|
||||
morelights.craft_items = {
|
||||
glass = "default:glass",
|
||||
glass_pane = "default:glass",
|
||||
glass_pane = "xpanes:pane_flat",
|
||||
steel = "default:steel_ingot",
|
||||
copper = "default:copper_ingot",
|
||||
mese_fragment = "default:mese_crystal_fragment",
|
||||
tin = "default:tin_ingot",
|
||||
crystal_fragment = "default:mese_crystal_fragment",
|
||||
dye_dark = "dye:dark_grey",
|
||||
dye_light = "dye:white",
|
||||
wool_dark = "wool:dark_grey",
|
||||
wool_light = "wool:white",
|
||||
wood_dark = "default:junglewood",
|
||||
cotton = "farming:cotton",
|
||||
dirt = "default:dirt",
|
||||
stone_block = "default:stone_block",
|
||||
sandstone_block = "default:sandstone_block",
|
||||
dirt = "default:dirt",
|
||||
grass = "default:grass_1",
|
||||
cotton = "farming:cotton",
|
||||
stick = "default:stick",
|
||||
}
|
||||
|
||||
if minetest.get_modpath("xpanes") then
|
||||
morelights.craft_items.glass_pane = "xpanes:pane_flat"
|
||||
local a = morelights.craft_items
|
||||
|
||||
if morelights.game == "mineclone2" then
|
||||
a.glass = "mcl_core:glass"
|
||||
a.glass_pane = "xpanes:pane_natural_flat"
|
||||
a.steel = "mcl_core:iron_ingot"
|
||||
-- MCL has neither copper nor tin. :(
|
||||
a.copper = "mesecons:redstone"
|
||||
a.tin = "mcl_core:iron_ingot"
|
||||
a.crystal_fragment = "mcl_nether:quartz"
|
||||
a.dye_dark = "mcl_dye:dark_grey"
|
||||
a.dye_light = "mcl_dye:white"
|
||||
a.wool_dark = "mcl_wool:dark_grey"
|
||||
a.wool_light = "mcl_wool:white"
|
||||
a.wood_dark = "mcl_core:sprucewood"
|
||||
a.stone_block = "mcl_core:stone_smooth"
|
||||
a.sandstone_block = "mcl_core:sandstonesmooth"
|
||||
a.dirt = "mcl_core:dirt"
|
||||
a.grass = "mcl_flowers:tallgrass"
|
||||
a.cotton = "mcl_mobitems:string"
|
||||
a.stick = "mcl_core:stick"
|
||||
end
|
||||
|
||||
-- Use basic_materials brass if available, otherwise register our own.
|
||||
if minetest.get_modpath("basic_materials") then
|
||||
morelights.craft_items.brass = "basic_materials:brass_ingot"
|
||||
a.brass = "basic_materials:brass_ingot"
|
||||
end
|
||||
|
||||
local path = minetest.get_modpath("morelights")
|
||||
|
||||
dofile(path .. DIR_DELIM .. "nodes.lua")
|
||||
|
7
morelights/locale/template.txt
Normal file
7
morelights/locale/template.txt
Normal file
@ -0,0 +1,7 @@
|
||||
# textdomain:morelights
|
||||
|
||||
dark=
|
||||
light=
|
||||
Light Bulb=
|
||||
Metal Pole (@1)=
|
||||
Metal Chain (@1)=
|
3
morelights/mod.conf
Normal file
3
morelights/mod.conf
Normal file
@ -0,0 +1,3 @@
|
||||
name = morelights
|
||||
description = Base mod providing basic items, which the rest of the modpack depends on.
|
||||
optional_depends = default, mcl_core
|
@ -1,12 +1,15 @@
|
||||
local S = minetest.get_translator("morelights")
|
||||
|
||||
|
||||
minetest.register_craftitem("morelights:bulb", {
|
||||
description = "Light Bulb",
|
||||
description = S("Light Bulb"),
|
||||
inventory_image = "morelights_bulb.png"
|
||||
})
|
||||
|
||||
morelights.register_variants({
|
||||
{
|
||||
name = "morelights:pole_d",
|
||||
description = "Metal Pole (dark)",
|
||||
description = S("Metal Pole (@1)", S("dark")),
|
||||
tiles = {"morelights_metal_dark_32.png"},
|
||||
inventory_image = "morelights_pole_d_inv.png",
|
||||
wield_image = "morelights_pole_d_inv.png",
|
||||
@ -18,7 +21,7 @@ morelights.register_variants({
|
||||
},
|
||||
{
|
||||
name = "morelights:pole_l",
|
||||
description = "Metal Pole (light)",
|
||||
description = S("Metal Pole (@1)", S("light")),
|
||||
tiles = {"morelights_metal_light_32.png"},
|
||||
inventory_image = "morelights_pole_l_inv.png",
|
||||
wield_image = "morelights_pole_l_inv.png",
|
||||
@ -36,16 +39,16 @@ morelights.register_variants({
|
||||
fixed = {-1/32, -1/2, -1/32, 1/32, 1/2, 1/32}
|
||||
},
|
||||
selection_box = {
|
||||
type = "wallmounted",
|
||||
wall_bottom = {-1/16, -1/2, -1/16, 1/16, 1/2, 1/16},
|
||||
wall_side = {-1/2, -1/16, -1/16, 1/2, 1/16, 1/16},
|
||||
wall_top = {-1/16, -1/2, -1/16, 1/16, 1/2, 1/16}
|
||||
type = "fixed",
|
||||
fixed = {-1/16, -1/2, -1/16, 1/16, 1/2, 1/16}
|
||||
},
|
||||
paramtype = "light",
|
||||
paramtype2 = "wallmounted",
|
||||
sunlight_propagates = true,
|
||||
groups = {cracky = 3, oddly_breakable_by_hand = 3, mounted_ceiling = 1},
|
||||
sounds = default.node_sound_metal_defaults(),
|
||||
groups = {cracky = 3, oddly_breakable_by_hand = 3, handy = 1,
|
||||
mounted_ceiling = 1},
|
||||
_mcl_hardness = 0.2,
|
||||
sounds = morelights.sounds.metal
|
||||
})
|
||||
|
||||
morelights.register_variants({
|
||||
@ -64,45 +67,50 @@ morelights.register_variants({
|
||||
drawtype = "nodebox",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {{-3/16, -7/16, -3/16, 3/16, -1/2, 3/16},
|
||||
{-1/32, 1/2, -1/32, 1/32, -7/16, 1/32}}
|
||||
fixed = {
|
||||
{-3/16, -7/16, -3/16, 3/16, -1/2, 3/16},
|
||||
{-1/32, 1/2, -1/32, 1/32, -7/16, 1/32}
|
||||
}
|
||||
},
|
||||
selection_box = {
|
||||
type = "wallmounted",
|
||||
wall_bottom = {-1/16, -1/2, -1/16, 1/16, 1/2, 1/16},
|
||||
wall_side = {-1/2, -1/16, -1/16, 1/2, 1/16, 1/16},
|
||||
wall_top = {-1/16, -1/2, -1/16, 1/16, 1/2, 1/16}
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-3/16, -7/16, -3/16, 3/16, -1/2, 3/16},
|
||||
{-1/16, 1/2, -1/16, 1/16, -7/16, 1/16}
|
||||
}
|
||||
},
|
||||
paramtype = "light",
|
||||
paramtype2 = "wallmounted",
|
||||
sunlight_propagates = true,
|
||||
groups = {cracky = 3, oddly_breakable_by_hand = 3,
|
||||
not_in_creative_inventory = 1, mounted_ceiling = 1},
|
||||
sounds = default.node_sound_metal_defaults(),
|
||||
groups = {cracky = 3, oddly_breakable_by_hand = 3, handy = 1,
|
||||
mounted_ceiling = 1, not_in_creative_inventory = 1},
|
||||
_mcl_hardness = 0.2,
|
||||
sounds = morelights.sounds.metal
|
||||
})
|
||||
|
||||
morelights.register_variants({
|
||||
{
|
||||
name = "morelights:chain_d",
|
||||
description = "Metal Chain (dark)",
|
||||
description = S("Metal Chain (@1)", S("dark")),
|
||||
tiles = {"morelights_metal_dark_32.png"},
|
||||
inventory_image = "morelights_chain_d_inv.png",
|
||||
wield_image = "morelights_chain_d_inv.png",
|
||||
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
return morelights.on_place_hanging(itemstack, placer, pointed_thing,
|
||||
"morelights:chain_ceiling_d")
|
||||
end},
|
||||
return morelights.on_place_hanging(itemstack, placer,
|
||||
pointed_thing, "morelights:chain_ceiling_d")
|
||||
end
|
||||
},
|
||||
{
|
||||
name = "morelights:chain_l",
|
||||
description = "Metal Chain (light)",
|
||||
description = S("Metal Chain (@1)", S("light")),
|
||||
tiles = {"morelights_metal_light_32.png"},
|
||||
inventory_image = "morelights_chain_l_inv.png",
|
||||
wield_image = "morelights_chain_l_inv.png",
|
||||
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
return morelights.on_place_hanging(itemstack, placer, pointed_thing,
|
||||
"morelights:chain_ceiling_l")
|
||||
return morelights.on_place_hanging(itemstack, placer,
|
||||
pointed_thing, "morelights:chain_ceiling_l")
|
||||
end
|
||||
}
|
||||
},
|
||||
@ -119,8 +127,10 @@ morelights.register_variants({
|
||||
},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
groups = {cracky = 3, oddly_breakable_by_hand = 3, mounted_ceiling = 1},
|
||||
sounds = default.node_sound_metal_defaults(),
|
||||
groups = {cracky = 3, oddly_breakable_by_hand = 3, handy = 1,
|
||||
mounted_ceiling = 1},
|
||||
_mcl_hardness = 0.2,
|
||||
sounds = morelights.sounds.metal
|
||||
})
|
||||
|
||||
morelights.register_variants({
|
||||
@ -140,19 +150,24 @@ morelights.register_variants({
|
||||
mesh = "morelights_chain_ceiling.obj",
|
||||
collision_box = {
|
||||
type = "fixed",
|
||||
fixed = {{-3/16, 7/16, -3/16, 3/16, 1/2, 3/16},
|
||||
{-1/16, -1/2, -1/16, 1/16, 7/16, 1/16}}
|
||||
fixed = {
|
||||
{-3/16, 7/16, -3/16, 3/16, 1/2, 3/16},
|
||||
{-1/16, -1/2, -1/16, 1/16, 7/16, 1/16}
|
||||
}
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {{-3/16, 7/16, -3/16, 3/16, 1/2, 3/16},
|
||||
{-1/16, -1/2, -1/16, 1/16, 7/16, 1/16}}
|
||||
fixed = {
|
||||
{-3/16, 7/16, -3/16, 3/16, 1/2, 3/16},
|
||||
{-1/16, -1/2, -1/16, 1/16, 7/16, 1/16}
|
||||
}
|
||||
},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
groups = {cracky = 3, oddly_breakable_by_hand = 3,
|
||||
not_in_creative_inventory = 1, mounted_ceiling = 1},
|
||||
sounds = default.node_sound_metal_defaults(),
|
||||
groups = {cracky = 3, oddly_breakable_by_hand = 3, handy = 1,
|
||||
mounted_ceiling = 1, not_in_creative_inventory = 1},
|
||||
_mcl_hardness = 0.2,
|
||||
sounds = morelights.sounds.metal
|
||||
})
|
||||
|
||||
--
|
||||
|
@ -1,3 +0,0 @@
|
||||
default
|
||||
morelights
|
||||
stairs?
|
@ -1,45 +1,112 @@
|
||||
local S = minetest.get_translator("morelights_extras")
|
||||
|
||||
|
||||
minetest.register_node("morelights_extras:f_block", {
|
||||
description = "Futuristic Light Block",
|
||||
description = S("Futuristic Light Block"),
|
||||
tiles = {"morelights_extras_f_block.png"},
|
||||
paramtype = "light",
|
||||
light_source = LIGHT_MAX,
|
||||
groups = {cracky = 2, oddly_breakable_by_hand = 3},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
light_source = minetest.LIGHT_MAX,
|
||||
groups = {cracky = 2, oddly_breakable_by_hand = 3, handy = 1},
|
||||
_mcl_hardness = 0.3,
|
||||
sounds = morelights.sounds.glass
|
||||
})
|
||||
|
||||
minetest.register_node("morelights_extras:dirt_with_grass", {
|
||||
description = "Grass Light",
|
||||
tiles = {
|
||||
"default_grass.png^morelights_extras_blocklight.png",
|
||||
"default_dirt.png",
|
||||
"default_dirt.png^default_grass_side.png"
|
||||
},
|
||||
paramtype = "light",
|
||||
light_source = 12,
|
||||
groups = {cracky = 2, oddly_breakable_by_hand = 3},
|
||||
sounds = default.node_sound_glass_defaults()
|
||||
})
|
||||
do
|
||||
local def = {
|
||||
description = S("Grass Light"),
|
||||
tiles = {
|
||||
"default_grass.png^morelights_extras_blocklight.png",
|
||||
"default_dirt.png",
|
||||
"default_dirt.png^default_grass_side.png"
|
||||
},
|
||||
paramtype = "light",
|
||||
light_source = 12,
|
||||
groups = {cracky = 2, oddly_breakable_by_hand = 3, handy = 1},
|
||||
_mcl_hardness = 0.3,
|
||||
sounds = morelights.sounds.glass
|
||||
}
|
||||
|
||||
minetest.register_node("morelights_extras:stone_block", {
|
||||
description = "Stone Block Light",
|
||||
tiles = {"default_stone_block.png^morelights_extras_blocklight.png"},
|
||||
paramtype = "light",
|
||||
light_source = 12,
|
||||
groups = {cracky = 2, oddly_breakable_by_hand = 3},
|
||||
sounds = default.node_sound_glass_defaults()
|
||||
})
|
||||
if morelights.game == "mineclone2" then
|
||||
-- For MineClone 2, use node coloring to match environment.
|
||||
-- See the mcl_core:dirt_with_grass definition in
|
||||
-- ITEMS/mcl_core/nodes_base.lua.
|
||||
local override = {
|
||||
tiles = {
|
||||
"mcl_core_grass_block_top.png",
|
||||
{name = "default_dirt.png", color = "#FFFFFF"}
|
||||
},
|
||||
overlay_tiles = {
|
||||
{name = "morelights_extras_blocklight.png", color = "#FFFFFF"},
|
||||
"",
|
||||
{
|
||||
name = "mcl_core_grass_block_side_overlay.png",
|
||||
tileable_vertical = false
|
||||
}
|
||||
},
|
||||
paramtype2 = "color",
|
||||
palette = "mcl_core_palette_grass.png",
|
||||
palette_index = 0,
|
||||
color = "#55aa60",
|
||||
drop = "morelights_extras:dirt_with_grass",
|
||||
|
||||
minetest.register_node("morelights_extras:sandstone_block", {
|
||||
description = "Sandstone Block Light",
|
||||
tiles = {"default_sandstone_block.png^morelights_extras_blocklight.png"},
|
||||
paramtype = "light",
|
||||
light_source = 12,
|
||||
groups = {cracky = 2, oddly_breakable_by_hand = 3},
|
||||
sounds = default.node_sound_glass_defaults()
|
||||
})
|
||||
on_construct = function(pos)
|
||||
local node = minetest.get_node(pos)
|
||||
if node.param2 == 0 then
|
||||
local grass_node = mcl_core.get_grass_block_type(pos)
|
||||
if grass_node.param2 ~= 0 then
|
||||
minetest.set_node(pos, {
|
||||
name = "morelights_extras:dirt_with_grass",
|
||||
param2 = grass_node.param2
|
||||
})
|
||||
end
|
||||
end
|
||||
end
|
||||
}
|
||||
|
||||
for k, v in pairs(override) do
|
||||
def[k] = v
|
||||
end
|
||||
end
|
||||
|
||||
minetest.register_node("morelights_extras:dirt_with_grass", def)
|
||||
end
|
||||
|
||||
do
|
||||
local tile = "default_stone_block.png"
|
||||
if morelights.game == "mineclone2" then
|
||||
tile = "mcl_stairs_stone_slab_top.png"
|
||||
end
|
||||
|
||||
minetest.register_node("morelights_extras:stone_block", {
|
||||
description = S("Stone Block Light"),
|
||||
tiles = {tile .. "^morelights_extras_blocklight.png"},
|
||||
paramtype = "light",
|
||||
light_source = 12,
|
||||
groups = {cracky = 2, oddly_breakable_by_hand = 3, handy = 1},
|
||||
_mcl_hardness = 0.3,
|
||||
sounds = morelights.sounds.glass
|
||||
})
|
||||
end
|
||||
|
||||
do
|
||||
local tile = "default_sandstone_block.png"
|
||||
if morelights.game == "mineclone2" then
|
||||
tile = "mcl_core_sandstone_smooth.png"
|
||||
end
|
||||
|
||||
minetest.register_node("morelights_extras:sandstone_block", {
|
||||
description = S("Sandstone Block Light"),
|
||||
tiles = {tile .. "^morelights_extras_blocklight.png"},
|
||||
paramtype = "light",
|
||||
light_source = 12,
|
||||
groups = {cracky = 2, oddly_breakable_by_hand = 3, handy = 1},
|
||||
_mcl_hardness = 0.3,
|
||||
sounds = morelights.sounds.glass
|
||||
})
|
||||
end
|
||||
|
||||
minetest.register_node("morelights_extras:stairlight", {
|
||||
description = "Stair Light (place on stairs)",
|
||||
description = S("Stair Light (place on stairs)"),
|
||||
drawtype = "nodebox",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
@ -58,25 +125,44 @@ minetest.register_node("morelights_extras:stairlight", {
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
light_source = 10,
|
||||
groups = {cracky = 2, oddly_breakable_by_hand = 3, attached_node = 1},
|
||||
sunlight_propagates = true,
|
||||
groups = {cracky = 2, oddly_breakable_by_hand = 3, handy = 1,
|
||||
attached_node = 1},
|
||||
_mcl_hardness = 0.15,
|
||||
node_placement_prediction = "",
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
sounds = morelights.sounds.glass,
|
||||
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
local node = minetest.get_node(vector.subtract(pointed_thing.above,
|
||||
{x=0, y=1, z=0}))
|
||||
if pointed_thing.type ~= "node" then
|
||||
return itemstack
|
||||
end
|
||||
|
||||
if node and node.name:match("^stairs:stair")
|
||||
and node.param2 < 4 then
|
||||
minetest.item_place(itemstack, placer, pointed_thing, node.param2)
|
||||
-- See builtin/game/item.lua.
|
||||
local node = minetest.get_node(pointed_thing.under)
|
||||
|
||||
if placer and not placer:get_player_control().sneak then
|
||||
local def = minetest.registered_nodes[node.name]
|
||||
if def and def.on_rightclick then
|
||||
return def.on_rightclick(pointed_thing.under, node, placer,
|
||||
itemstack, pointed_thing) or itemstack
|
||||
end
|
||||
end
|
||||
|
||||
if node.param2 < 4
|
||||
and (node.name:match("^stairs:stair_")
|
||||
or node.name:match("^mcl_stairs:stair_")) then
|
||||
-- Set `above` to the node actually above the stair, since that's
|
||||
-- where the node is placed.
|
||||
pointed_thing.above = vector.add(pointed_thing.under,
|
||||
{x=0, y=1, z=0})
|
||||
return minetest.item_place_node(itemstack, placer, pointed_thing,
|
||||
node.param2)
|
||||
end
|
||||
|
||||
return itemstack
|
||||
end,
|
||||
|
||||
on_rotate = function(pos, node, user, mode, new_param2)
|
||||
return false
|
||||
end,
|
||||
on_rotate = screwdriver.rotate_simple
|
||||
})
|
||||
|
||||
--
|
||||
@ -88,9 +174,9 @@ local a = morelights.craft_items
|
||||
minetest.register_craft({
|
||||
output = "morelights_extras:f_block",
|
||||
recipe = {
|
||||
{a.mese_fragment, a.steel, a.mese_fragment},
|
||||
{a.crystal_fragment, a.steel, a.crystal_fragment},
|
||||
{a.glass_pane, "morelights:bulb", a.glass_pane},
|
||||
{a.mese_fragment, a.steel, a.mese_fragment}
|
||||
{a.crystal_fragment, a.steel, a.crystal_fragment}
|
||||
}
|
||||
})
|
||||
|
||||
|
7
morelights_extras/locale/template.txt
Normal file
7
morelights_extras/locale/template.txt
Normal file
@ -0,0 +1,7 @@
|
||||
# textdomain:morelights_extras
|
||||
|
||||
Futuristic Light Block=
|
||||
Grass Light=
|
||||
Stone Block Light=
|
||||
Sandstone Block Light=
|
||||
Stair Light (place on stairs)=
|
3
morelights_extras/mod.conf
Normal file
3
morelights_extras/mod.conf
Normal file
@ -0,0 +1,3 @@
|
||||
name = morelights_extras
|
||||
description = Provides miscellaneous lighting nodes.
|
||||
depends = morelights
|
@ -1,4 +0,0 @@
|
||||
default
|
||||
dye
|
||||
morelights
|
||||
wool
|
@ -1,14 +1,18 @@
|
||||
local S = minetest.get_translator("morelights_modern")
|
||||
|
||||
|
||||
minetest.register_node("morelights_modern:block", {
|
||||
description = "Modern Light Block",
|
||||
description = S("Modern Light Block"),
|
||||
tiles = {"morelights_metal_dark.png^morelights_modern_block.png"},
|
||||
paramtype = "light",
|
||||
light_source = LIGHT_MAX,
|
||||
groups = {cracky = 2, oddly_breakable_by_hand = 3},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
light_source = minetest.LIGHT_MAX,
|
||||
groups = {cracky = 2, oddly_breakable_by_hand = 3, handy = 1},
|
||||
_mcl_hardness = 0.3,
|
||||
sounds = morelights.sounds.glass
|
||||
})
|
||||
|
||||
minetest.register_node("morelights_modern:smallblock", {
|
||||
description = "Modern Light Block (small)",
|
||||
description = S("Modern Light Block (small)"),
|
||||
drawtype = "nodebox",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
@ -22,19 +26,21 @@ minetest.register_node("morelights_modern:smallblock", {
|
||||
},
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
sunlight_propagates = true,
|
||||
light_source = 12,
|
||||
groups = {cracky = 3, oddly_breakable_by_hand = 3},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
groups = {cracky = 3, oddly_breakable_by_hand = 3, handy = 1},
|
||||
_mcl_hardness = 0.2,
|
||||
sounds = morelights.sounds.glass,
|
||||
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
return morelights.rotate_and_place(itemstack, placer, pointed_thing)
|
||||
end,
|
||||
end
|
||||
})
|
||||
|
||||
morelights.register_variants({
|
||||
{
|
||||
name = "morelights_modern:post_d",
|
||||
description = "Modern Post Light (dark)",
|
||||
description = S("Modern Post Light (@1)", S("dark")),
|
||||
tiles = {
|
||||
"morelights_metal_dark.png",
|
||||
"morelights_metal_dark.png",
|
||||
@ -43,7 +49,7 @@ morelights.register_variants({
|
||||
},
|
||||
{
|
||||
name = "morelights_modern:post_l",
|
||||
description = "Modern Post Light (light)",
|
||||
description = S("Modern Post Light (@1)", S("light")),
|
||||
tiles = {
|
||||
"morelights_metal_light.png",
|
||||
"morelights_metal_light.png",
|
||||
@ -55,23 +61,27 @@ morelights.register_variants({
|
||||
drawtype = "nodebox",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {{-1/8, -1/2, -1/8, 1/8, 1/2, 1/8}}
|
||||
fixed = {-1/8, -1/2, -1/8, 1/8, 1/2, 1/8}
|
||||
},
|
||||
paramtype = "light",
|
||||
light_source = LIGHT_MAX,
|
||||
groups = {cracky = 3, oddly_breakable_by_hand = 3},
|
||||
sounds = default.node_sound_metal_defaults(),
|
||||
sunlight_propagates = true,
|
||||
light_source = minetest.LIGHT_MAX,
|
||||
groups = {cracky = 3, oddly_breakable_by_hand = 3, handy = 1},
|
||||
_mcl_hardness = 0.3,
|
||||
sounds = morelights.sounds.metal
|
||||
})
|
||||
|
||||
morelights.register_variants({
|
||||
{
|
||||
name = "morelights_modern:streetpost_d",
|
||||
description = "Street Lamp Post (dark)--connects to bar lights",
|
||||
description = S("Street Lamp Post (@1) - connects to bar lights",
|
||||
S("dark")),
|
||||
tiles = {"morelights_metal_dark.png"}
|
||||
},
|
||||
{
|
||||
name = "morelights_modern:streetpost_l",
|
||||
description = "Street Lamp Post (light)--connects to bar lights",
|
||||
description = S("Street Lamp Post (@1) - connects to bar lights",
|
||||
S("light")),
|
||||
tiles = {"morelights_metal_light.png"}
|
||||
}
|
||||
},
|
||||
@ -90,12 +100,14 @@ morelights.register_variants({
|
||||
"morelights_modern:barlight_s"
|
||||
},
|
||||
paramtype = "light",
|
||||
groups = {cracky = 2, oddly_breakable_by_hand = 3},
|
||||
sounds = default.node_sound_metal_defaults(),
|
||||
sunlight_propagates = true,
|
||||
groups = {cracky = 2, oddly_breakable_by_hand = 3, handy = 1},
|
||||
_mcl_hardness = 0.3,
|
||||
sounds = morelights.sounds.metal
|
||||
})
|
||||
|
||||
minetest.register_node("morelights_modern:barlight_c", {
|
||||
description = "Ceiling Bar Light (connecting)",
|
||||
description = S("Ceiling Bar Light (connecting)"),
|
||||
drawtype = "nodebox",
|
||||
node_box = {
|
||||
type = "connected",
|
||||
@ -117,13 +129,16 @@ minetest.register_node("morelights_modern:barlight_c", {
|
||||
"morelights_metal_dark.png"
|
||||
},
|
||||
paramtype = "light",
|
||||
light_source = LIGHT_MAX,
|
||||
groups = {cracky = 2, oddly_breakable_by_hand = 3},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
sunlight_propagates = true,
|
||||
light_source = minetest.LIGHT_MAX,
|
||||
groups = {cracky = 2, oddly_breakable_by_hand = 3, handy = 1},
|
||||
_mcl_hardness = 0.15,
|
||||
sounds = morelights.sounds.glass
|
||||
})
|
||||
|
||||
-- TODO: Determine orientation of bar lights from nearby nodes.
|
||||
minetest.register_node("morelights_modern:barlight_s", {
|
||||
description = "Ceiling Bar Light (straight)",
|
||||
description = S("Ceiling Bar Light (straight)"),
|
||||
drawtype = "nodebox",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
@ -136,13 +151,15 @@ minetest.register_node("morelights_modern:barlight_s", {
|
||||
},
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
light_source = LIGHT_MAX,
|
||||
groups = {cracky = 2, oddly_breakable_by_hand = 3},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
sunlight_propagates = true,
|
||||
light_source = minetest.LIGHT_MAX,
|
||||
groups = {cracky = 2, oddly_breakable_by_hand = 3, handy = 1},
|
||||
_mcl_hardness = 0.15,
|
||||
sounds = morelights.sounds.glass
|
||||
})
|
||||
|
||||
minetest.register_node("morelights_modern:ceilinglight", {
|
||||
description = "Modern Ceiling Light",
|
||||
description = S("Modern Ceiling Light"),
|
||||
drawtype = "nodebox",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
@ -154,25 +171,27 @@ minetest.register_node("morelights_modern:ceilinglight", {
|
||||
},
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
light_source = LIGHT_MAX,
|
||||
groups = {cracky = 3, oddly_breakable_by_hand = 3},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
sunlight_propagates = true,
|
||||
light_source = minetest.LIGHT_MAX,
|
||||
groups = {cracky = 3, oddly_breakable_by_hand = 3, handy = 1},
|
||||
_mcl_hardness = 0.2,
|
||||
sounds = morelights.sounds.glass,
|
||||
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
return morelights.rotate_and_place(itemstack, placer, pointed_thing,
|
||||
{[0] = 0, 20, 12, 16, 4, 8})
|
||||
end,
|
||||
end
|
||||
})
|
||||
|
||||
morelights.register_variants({
|
||||
{
|
||||
name = "morelights_modern:canlight_d",
|
||||
description = "Modern Can Light (dark)",
|
||||
description = S("Modern Can Light (@1)", S("dark")),
|
||||
tiles = {"morelights_metal_dark.png^morelights_modern_canlight.png"}
|
||||
},
|
||||
{
|
||||
name = "morelights_modern:canlight_l",
|
||||
description = "Modern Can Light (light)",
|
||||
description = S("Modern Can Light (@1)", S("light")),
|
||||
tiles = {"morelights_metal_light.png^morelights_modern_canlight.png"}
|
||||
},
|
||||
},
|
||||
@ -188,13 +207,15 @@ morelights.register_variants({
|
||||
fixed = {-1/8, 0, -1/8, 1/8, 1/2, 1/8}
|
||||
},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
light_source = 12,
|
||||
groups = {cracky = 2, oddly_breakable_by_hand = 3},
|
||||
sounds = default.node_sound_metal_defaults(),
|
||||
groups = {cracky = 2, oddly_breakable_by_hand = 3, handy = 1},
|
||||
_mcl_hardness = 0.2,
|
||||
sounds = morelights.sounds.metal
|
||||
})
|
||||
|
||||
minetest.register_node("morelights_modern:walllamp", {
|
||||
description = "Modern Wall Lamp",
|
||||
description = S("Modern Wall Lamp"),
|
||||
drawtype = "mesh",
|
||||
mesh = "morelights_modern_walllamp.obj",
|
||||
collision_box = {
|
||||
@ -208,20 +229,22 @@ minetest.register_node("morelights_modern:walllamp", {
|
||||
tiles = {"morelights_metal_dark_32.png^morelights_modern_walllamp.png"},
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
sunlight_propagates = true,
|
||||
light_source = 12,
|
||||
groups = {cracky = 2, oddly_breakable_by_hand = 3},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
groups = {cracky = 2, oddly_breakable_by_hand = 3, handy = 1},
|
||||
_mcl_hardness = 0.2,
|
||||
sounds = morelights.sounds.glass,
|
||||
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
return morelights.rotate_and_place(itemstack, placer, pointed_thing,
|
||||
{[0] = 6, 4, 1, 3, 0, 2})
|
||||
end,
|
||||
end
|
||||
})
|
||||
|
||||
morelights.register_variants({
|
||||
{
|
||||
name = "morelights_modern:tablelamp_d",
|
||||
description = "Modern Table Lamp (dark)",
|
||||
description = S("Modern Table Lamp (@1)", S("dark")),
|
||||
tiles = {
|
||||
"morelights_metal_light_32.png^morelights_modern_tablelamp_o.png",
|
||||
"morelights_modern_tablelamp_d.png"
|
||||
@ -229,7 +252,7 @@ morelights.register_variants({
|
||||
},
|
||||
{
|
||||
name = "morelights_modern:tablelamp_l",
|
||||
description = "Modern Table Lamp (light)",
|
||||
description = S("Modern Table Lamp (@1)", S("light")),
|
||||
tiles = {
|
||||
"morelights_metal_dark_32.png^morelights_modern_tablelamp_o.png",
|
||||
"morelights_modern_tablelamp_l.png"
|
||||
@ -248,22 +271,24 @@ morelights.register_variants({
|
||||
fixed = {-1/4, -1/2, -1/4, 1/4, 7/16, 1/4}
|
||||
},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
light_source = 10,
|
||||
groups = {choppy = 2, oddly_breakable_by_hand = 3},
|
||||
sounds = default.node_sound_defaults(),
|
||||
groups = {choppy = 2, oddly_breakable_by_hand = 3, handy = 1},
|
||||
_mcl_hardness = 0.2,
|
||||
sounds = morelights.sounds.default
|
||||
})
|
||||
|
||||
morelights.register_variants({
|
||||
{
|
||||
name = "morelights_modern:pathlight_d",
|
||||
description = "Modern Path Light (dark)",
|
||||
description = S("Modern Path Light (@1)", S("dark")),
|
||||
tiles = {
|
||||
"morelights_metal_dark_32.png^morelights_modern_pathlight.png"
|
||||
}
|
||||
},
|
||||
{
|
||||
name = "morelights_modern:pathlight_l",
|
||||
description = "Modern Path Light (light)",
|
||||
description = S("Modern Path Light (@1)", S("light")),
|
||||
tiles = {
|
||||
"morelights_metal_light_32.png^morelights_modern_pathlight.png"
|
||||
}
|
||||
@ -281,12 +306,14 @@ morelights.register_variants({
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {{-1/8, -1/2, -1/8, 1/8, 3/8, 1/8}}
|
||||
fixed = {-1/8, -1/2, -1/8, 1/8, 3/8, 1/8}
|
||||
},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
light_source = 8,
|
||||
groups = {cracky = 3, oddly_breakable_by_hand = 3},
|
||||
sounds = default.node_sound_metal_defaults(),
|
||||
groups = {cracky = 3, oddly_breakable_by_hand = 3, handy = 1},
|
||||
_mcl_hardness = 0.2,
|
||||
sounds = morelights.sounds.metal
|
||||
})
|
||||
|
||||
--
|
||||
@ -395,7 +422,7 @@ minetest.register_craft({
|
||||
minetest.register_craft({
|
||||
output = "morelights_modern:walllamp",
|
||||
recipe = {
|
||||
{a.dye_light, a.glass_pane, ""},
|
||||
{"", a.glass_pane, ""},
|
||||
{a.glass_pane, "morelights:bulb", a.steel},
|
||||
{"", a.dye_dark, a.steel}
|
||||
}
|
||||
@ -404,8 +431,8 @@ minetest.register_craft({
|
||||
minetest.register_craft({
|
||||
output = "morelights_modern:tablelamp_d",
|
||||
recipe = {
|
||||
{a.wool_dark, "morelights:bulb", a.wool_dark},
|
||||
{"", a.steel, ""},
|
||||
{a.wool_dark, "morelights:bulb", a.wool_dark},
|
||||
{"", a.steel, ""}
|
||||
}
|
||||
})
|
||||
@ -413,8 +440,8 @@ minetest.register_craft({
|
||||
minetest.register_craft({
|
||||
output = "morelights_modern:tablelamp_l",
|
||||
recipe = {
|
||||
{a.wool_light, "morelights:bulb", a.wool_light},
|
||||
{"", a.steel, ""},
|
||||
{a.wool_light, "morelights:bulb", a.wool_light},
|
||||
{"", a.steel, ""}
|
||||
}
|
||||
})
|
||||
|
15
morelights_modern/locale/template.txt
Normal file
15
morelights_modern/locale/template.txt
Normal file
@ -0,0 +1,15 @@
|
||||
# textdomain:morelights_modern
|
||||
|
||||
dark=
|
||||
light=
|
||||
Modern Light Block=
|
||||
Modern Light Block (small)=
|
||||
Modern Post Light (@1)=
|
||||
Street Lamp Post (@1) - connects to bar lights=
|
||||
Ceiling Bar Light (connecting)=
|
||||
Ceiling Bar Light (straight)=
|
||||
Modern Ceiling Light=
|
||||
Modern Can Light (@1)=
|
||||
Modern Wall Lamp=
|
||||
Modern Table Lamp (@1)=
|
||||
Modern Path Light (@1)=
|
3
morelights_modern/mod.conf
Normal file
3
morelights_modern/mod.conf
Normal file
@ -0,0 +1,3 @@
|
||||
name = morelights_modern
|
||||
description = Provides modern-style lighting nodes.
|
||||
depends = morelights
|
@ -1,4 +0,0 @@
|
||||
basic_materials?
|
||||
default
|
||||
farming
|
||||
morelights
|
@ -1,9 +1,12 @@
|
||||
local S = minetest.get_translator("morelights_vintage")
|
||||
|
||||
|
||||
-- Register custom brass ingot if a suitable replacement doesn't exist.
|
||||
if morelights.craft_items.brass == nil then
|
||||
morelights.craft_items.brass = "morelights_vintage:brass_ingot"
|
||||
|
||||
minetest.register_craftitem("morelights_vintage:brass_ingot", {
|
||||
description = "Brass Ingot",
|
||||
description = S("Brass Ingot"),
|
||||
inventory_image = "default_steel_ingot.png^[multiply:#FFCE69"
|
||||
})
|
||||
|
||||
@ -11,13 +14,14 @@ if morelights.craft_items.brass == nil then
|
||||
output = "morelights_vintage:brass_ingot 2",
|
||||
type = "shapeless",
|
||||
recipe = {
|
||||
"default:copper_ingot", "default:tin_ingot"
|
||||
morelights.craft_items.copper,
|
||||
morelights.craft_items.tin
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
minetest.register_node("morelights_vintage:chain_b", {
|
||||
description = "Brass Chain",
|
||||
description = S("Brass Chain"),
|
||||
drawtype = "mesh",
|
||||
mesh = "morelights_chain.obj",
|
||||
collision_box = {
|
||||
@ -32,13 +36,16 @@ minetest.register_node("morelights_vintage:chain_b", {
|
||||
inventory_image = "morelights_vintage_chain_b_inv.png",
|
||||
wield_image = "morelights_vintage_chain_b_inv.png",
|
||||
paramtype = "light",
|
||||
groups = {cracky = 3, oddly_breakable_by_hand = 3, mounted_ceiling = 1},
|
||||
sounds = default.node_sound_metal_defaults(),
|
||||
sunlight_propagates = true,
|
||||
groups = {cracky = 3, oddly_breakable_by_hand = 3, handy = 1,
|
||||
mounted_ceiling = 1},
|
||||
_mcl_hardness = 0.2,
|
||||
sounds = morelights.sounds.metal,
|
||||
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
return morelights.on_place_hanging(itemstack, placer, pointed_thing,
|
||||
"morelights_vintage:chain_ceiling_b")
|
||||
end,
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node("morelights_vintage:chain_ceiling_b", {
|
||||
@ -47,36 +54,39 @@ minetest.register_node("morelights_vintage:chain_ceiling_b", {
|
||||
collision_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-3/16, 7/16, -3/16, 3/16, 8/16, 3/16},
|
||||
{-1/16, -8/16, -1/16, 1/16, 7/16, 1/16}
|
||||
{-3/16, 7/16, -3/16, 3/16, 1/2, 3/16},
|
||||
{-1/16, -1/2, -1/16, 1/16, 7/16, 1/16}
|
||||
}
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-3/16, 7/16, -3/16, 3/16, 8/16, 3/16},
|
||||
{-1/16, -8/16, -1/16, 1/16, 7/16, 1/16}
|
||||
{-3/16, 7/16, -3/16, 3/16, 1/2, 3/16},
|
||||
{-1/16, -1/2, -1/16, 1/16, 7/16, 1/16}
|
||||
}
|
||||
},
|
||||
tiles = {"morelights_vintage_brass_32.png"},
|
||||
drop = "morelights_vintage:chain_b",
|
||||
paramtype = "light",
|
||||
groups = {cracky = 3, oddly_breakable_by_hand = 3,
|
||||
not_in_creative_inventory = 1, mounted_ceiling = 1},
|
||||
sounds = default.node_sound_metal_defaults(),
|
||||
sunlight_propagates = true,
|
||||
groups = {cracky = 3, oddly_breakable_by_hand = 3, handy = 1,
|
||||
mounted_ceiling = 1, mounted_ceiling = 1},
|
||||
_mcl_hardness = 0.2,
|
||||
sounds = morelights.sounds.metal
|
||||
})
|
||||
|
||||
minetest.register_node("morelights_vintage:block", {
|
||||
description = "Vintage Light Block",
|
||||
description = S("Vintage Light Block"),
|
||||
tiles = {"morelights_vintage_block.png"},
|
||||
paramtype = "light",
|
||||
light_source = LIGHT_MAX,
|
||||
groups = {cracky = 2, oddly_breakable_by_hand = 3},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
light_source = minetest.LIGHT_MAX,
|
||||
groups = {cracky = 2, oddly_breakable_by_hand = 3, handy = 1},
|
||||
_mcl_hardness = 0.3,
|
||||
sounds = morelights.sounds.glass
|
||||
})
|
||||
|
||||
minetest.register_node("morelights_vintage:smallblock", {
|
||||
description = "Vintage Light Block (small)",
|
||||
description = S("Vintage Light Block (small)"),
|
||||
drawtype = "nodebox",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
@ -89,17 +99,19 @@ minetest.register_node("morelights_vintage:smallblock", {
|
||||
},
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
sunlight_propagates = true,
|
||||
light_source = 12,
|
||||
groups = {cracky = 2, oddly_breakable_by_hand = 3},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
groups = {cracky = 2, oddly_breakable_by_hand = 3, handy = 1},
|
||||
_mcl_hardness = 0.2,
|
||||
sounds = morelights.sounds.glass,
|
||||
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
return morelights.rotate_and_place(itemstack, placer, pointed_thing)
|
||||
end,
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node("morelights_vintage:lantern_f", {
|
||||
description = "Vintage Lantern (floor, wall, or ceiling)",
|
||||
description = S("Vintage Lantern (floor, wall, or ceiling)"),
|
||||
drawtype = "mesh",
|
||||
mesh = "morelights_vintage_lantern_f.obj",
|
||||
tiles = {
|
||||
@ -115,34 +127,39 @@ minetest.register_node("morelights_vintage:lantern_f", {
|
||||
fixed = {-3/16, -1/2, -3/16, 3/16, 1/16, 3/16}
|
||||
},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
light_source = 12,
|
||||
groups = {cracky = 2, oddly_breakable_by_hand = 3},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
groups = {cracky = 2, oddly_breakable_by_hand = 3, handy = 1},
|
||||
_mcl_hardness = 0.2,
|
||||
sounds = morelights.sounds.glass,
|
||||
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
local wdir = minetest.dir_to_wallmounted(
|
||||
vector.subtract(pointed_thing.under, pointed_thing.above))
|
||||
local fakestack = itemstack
|
||||
local fakeStack = ItemStack(itemstack)
|
||||
|
||||
if wdir == 0 then
|
||||
fakestack:set_name("morelights_vintage:lantern_c")
|
||||
fakeStack:set_name("morelights_vintage:lantern_c")
|
||||
elseif wdir == 1 then
|
||||
fakestack:set_name("morelights_vintage:lantern_f")
|
||||
fakeStack:set_name("morelights_vintage:lantern_f")
|
||||
else
|
||||
fakestack:set_name("morelights_vintage:lantern_w")
|
||||
fakeStack:set_name("morelights_vintage:lantern_w")
|
||||
end
|
||||
|
||||
itemstack = minetest.item_place(fakestack, placer, pointed_thing, wdir)
|
||||
itemstack:set_name("morelights_vintage:lantern_f")
|
||||
minetest.item_place(fakeStack, placer, pointed_thing, wdir)
|
||||
itemstack:set_count(fakeStack:get_count())
|
||||
|
||||
return itemstack
|
||||
end,
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node("morelights_vintage:lantern_c", {
|
||||
drawtype = "mesh",
|
||||
mesh = "morelights_vintage_lantern_c.obj",
|
||||
tiles = {"morelights_vintage_lantern.png", "morelights_metal_dark_32.png"},
|
||||
tiles = {
|
||||
"morelights_vintage_lantern.png",
|
||||
"morelights_metal_dark_32.png"
|
||||
},
|
||||
collision_box = {
|
||||
type = "fixed",
|
||||
fixed = {-3/16, -1/16, -3/16, 3/16, 1/2, 3/16}
|
||||
@ -152,11 +169,13 @@ minetest.register_node("morelights_vintage:lantern_c", {
|
||||
fixed = {-3/16, 0, -3/16, 3/16, 1/2, 3/16}
|
||||
},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
light_source = 12,
|
||||
groups = {cracky = 2, oddly_breakable_by_hand = 3,
|
||||
not_in_creative_inventory = 1},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
drop = "morelights_vintage:lantern_f",
|
||||
groups = {cracky = 2, oddly_breakable_by_hand = 3, handy = 1,
|
||||
not_in_creative_inventory = 1},
|
||||
_mcl_hardness = 0.2,
|
||||
sounds = morelights.sounds.glass,
|
||||
drop = "morelights_vintage:lantern_f"
|
||||
})
|
||||
|
||||
minetest.register_node("morelights_vintage:lantern_w", {
|
||||
@ -171,22 +190,22 @@ minetest.register_node("morelights_vintage:lantern_w", {
|
||||
fixed = {-3/16, -1/4, -5/16, 3/16, 1/8, 3/16}
|
||||
},
|
||||
selection_box = {
|
||||
type = "wallmounted",
|
||||
wall_bottom = {-3/16, -1/4, -5/16, 3/16, 1/8, 3/16},
|
||||
wall_side = {-1/4, -5/16, -3/16, 1/8, 3/16, 3/16},
|
||||
wall_top = {-3/16, -1/8, -5/16, 3/16, 1/4, 3/16}
|
||||
type = "fixed",
|
||||
fixed = {-3/16, -1/4, -5/16, 3/16, 1/8, 3/16}
|
||||
},
|
||||
paramtype = "light",
|
||||
paramtype2 = "wallmounted",
|
||||
sunlight_propagates = true,
|
||||
light_source = 12,
|
||||
groups = {cracky = 2, oddly_breakable_by_hand = 3,
|
||||
not_in_creative_inventory = 1},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
drop = "morelights_vintage:lantern_f",
|
||||
groups = {cracky = 2, oddly_breakable_by_hand = 3, handy = 1,
|
||||
not_in_creative_inventory = 1},
|
||||
_mcl_hardness = 0.2,
|
||||
sounds = morelights.sounds.glass,
|
||||
drop = "morelights_vintage:lantern_f"
|
||||
})
|
||||
|
||||
minetest.register_node("morelights_vintage:hangingbulb", {
|
||||
description = "Vintage Hanging Light Bulb",
|
||||
description = S("Vintage Hanging Light Bulb"),
|
||||
drawtype = "mesh",
|
||||
mesh = "morelights_vintage_hangingbulb.obj",
|
||||
tiles = {
|
||||
@ -205,13 +224,15 @@ minetest.register_node("morelights_vintage:hangingbulb", {
|
||||
fixed = {-1/8, -1/8, -1/8, 1/8, 1/2, 1/8}
|
||||
},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
light_source = 10,
|
||||
groups = {cracky = 2, oddly_breakable_by_hand = 3},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
groups = {cracky = 2, oddly_breakable_by_hand = 3, handy = 1},
|
||||
_mcl_hardness = 0.15,
|
||||
sounds = morelights.sounds.glass
|
||||
})
|
||||
|
||||
minetest.register_node("morelights_vintage:oillamp", {
|
||||
description = "Vintage Oil Lamp",
|
||||
description = S("Vintage Oil Lamp"),
|
||||
drawtype = "mesh",
|
||||
mesh = "morelights_vintage_oillamp.obj",
|
||||
tiles = {
|
||||
@ -236,13 +257,15 @@ minetest.register_node("morelights_vintage:oillamp", {
|
||||
fixed = {-1/8, -1/2, -1/8, 1/8, 1/4, 1/8}
|
||||
},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
light_source = 8,
|
||||
groups = {cracky = 2, oddly_breakable_by_hand = 3},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
groups = {cracky = 2, oddly_breakable_by_hand = 3, handy = 1},
|
||||
_mcl_hardness = 0.2,
|
||||
sounds = morelights.sounds.glass
|
||||
})
|
||||
|
||||
minetest.register_node("morelights_vintage:chandelier", {
|
||||
description = "Vintage Chandelier",
|
||||
description = S("Vintage Chandelier"),
|
||||
drawtype = "mesh",
|
||||
mesh = "morelights_vintage_chandelier.obj",
|
||||
tiles = {
|
||||
@ -258,9 +281,11 @@ minetest.register_node("morelights_vintage:chandelier", {
|
||||
fixed = {-3/8, -1/2, -3/8, 3/8, 1/2, 3/8}
|
||||
},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
light_source = 10,
|
||||
groups = {cracky = 2, oddly_breakable_by_hand = 3},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
groups = {cracky = 2, oddly_breakable_by_hand = 3, handy = 1},
|
||||
_mcl_hardness = 0.3,
|
||||
sounds = morelights.sounds.glass
|
||||
})
|
||||
|
||||
--
|
||||
@ -300,7 +325,7 @@ minetest.register_craft({
|
||||
recipe = {
|
||||
{"", a.steel, ""},
|
||||
{a.glass_pane, "morelights:bulb", a.glass_pane},
|
||||
{"default:stick", a.steel, "default:stick"}
|
||||
{a.stick, a.steel, a.stick}
|
||||
}
|
||||
})
|
||||
|
||||
@ -317,8 +342,8 @@ minetest.register_craft({
|
||||
output = "morelights_vintage:oillamp",
|
||||
recipe = {
|
||||
{"", a.glass, ""},
|
||||
{a.cotton, a.brass, ""},
|
||||
{"", a.glass, ""}
|
||||
{"", a.cotton, ""},
|
||||
{"", a.brass, ""}
|
||||
}
|
||||
})
|
||||
|
||||
|
10
morelights_vintage/locale/template.txt
Normal file
10
morelights_vintage/locale/template.txt
Normal file
@ -0,0 +1,10 @@
|
||||
# textdomain:morelights_vintage
|
||||
|
||||
Brass Ingot=
|
||||
Brass Chain=
|
||||
Vintage Light Block=
|
||||
Vintage Light Block (small)=
|
||||
Vintage Lantern (floor, wall, or ceiling)=
|
||||
Vintage Hanging Light Bulb=
|
||||
Vintage Oil Lamp=
|
||||
Vintage Chandelier=
|
3
morelights_vintage/mod.conf
Normal file
3
morelights_vintage/mod.conf
Normal file
@ -0,0 +1,3 @@
|
||||
name = morelights_vintage
|
||||
description = Provides antique and historical-style lighting nodes.
|
||||
depends = morelights
|
BIN
screenshot.png
BIN
screenshot.png
Binary file not shown.
Before Width: | Height: | Size: 314 KiB After Width: | Height: | Size: 627 KiB |
Loading…
Reference in New Issue
Block a user