Add crate and some decor blocks

master
Wuzzy 2022-01-14 17:44:39 +01:00
parent adcd597347
commit 914b55dacc
8 changed files with 107 additions and 23 deletions

View File

@ -10,7 +10,7 @@ External mods used:
---
Textures:
- Water, wood, tree, stone, tools, hand, player textures come from “PixelBOX” texture pack by jp (CC0)
- Water, wood, tree, stone, tools, hand, player textures, crates come from “PixelBOX” texture pack by jp (CC0)
- Textures in `lzr_decor` mod made by jp (CC0)
- Crosshair, wieldhand, `smoke_puff.png`: trivial textures by Wuzzy (CC0)
- Emitter, detector textures: Derivate works of xdecor textures by jp (CC0)

View File

@ -66,6 +66,27 @@ minetest.register_node("lzr_decor:barricade", {
groups = {breakable = 1},
})
minetest.register_node("lzr_decor:bonfire", {
description = S("Bonfire"),
walkable = false,
drawtype = "plantlike",
paramtype = "light",
paramtype2 = "facedir",
inventory_image = "lzr_decor_bonfire.png^[verticalframe:7:0",
wield_image = "lzr_decor_bonfire.png^[verticalframe:7:0",
use_texture_alpha = "clip",
tiles = {
{ name = "lzr_decor_bonfire.png",
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 2.0,
},},
},
groups = {breakable = 1},
})
minetest.register_node("lzr_decor:barrel", {
description = S("Barrel"),
tiles = {"xdecor_barrel_top.png", "xdecor_barrel_top.png", "xdecor_barrel_sides.png"},
@ -129,6 +150,30 @@ register_storage("lzr_decor:empty_shelf", S("Empty Shelf"), {
}
})
register_storage("lzr_decor:bookshelf", S("Bookshelf"), {
paramtype2 = "facedir",
on_rotate = screwdriver.rotate_simple,
tiles = {
{name="default_wood.png", align_style="world"},
{name="default_wood.png", align_style="world"},
{name="default_wood.png", align_style="world"},
{name="default_wood.png", align_style="world"},
"default_wood.png^lzr_decor_bookshelf.png",
},
})
register_storage("lzr_decor:vessels_shelf", S("Vessels Shelf"), {
paramtype2 = "facedir",
on_rotate = screwdriver.rotate_simple,
tiles = {
{name="default_wood.png", align_style="world"},
{name="default_wood.png", align_style="world"},
{name="default_wood.png", align_style="world"},
{name="default_wood.png", align_style="world"},
"default_wood.png^lzr_decor_vessels_shelf.png",
},
})
register_storage("lzr_decor:multishelf", S("Multi Shelf"), {
paramtype2 = "facedir",
on_rotate = screwdriver.rotate_simple,
@ -194,6 +239,7 @@ minetest.register_node("lzr_decor:chair", {
minetest.register_node("lzr_decor:cobweb", {
description = S("Cobweb"),
drawtype = "plantlike",
paramtype = "light",
tiles = {"xdecor_cobweb.png"},
inventory_image = "xdecor_cobweb.png",
walkable = false,
@ -302,3 +348,22 @@ minetest.register_node("lzr_decor:woodframed_glass", {
sounds = lzr_sounds.node_sound_glass_defaults()
})
minetest.register_node("lzr_decor:grate_steel", {
description = S("Steel Grate"),
paramtype = "light",
drawtype = "nodebox",
tiles = {"default_latch_steel.png"},
use_texture_alpha = "clip",
groups = { breakable = 1 },
sounds = lzr_sounds.node_sound_metal_defaults()
})
minetest.register_node("lzr_decor:grate_rust", {
description = S("Rusty Steel Grate"),
paramtype = "light",
drawtype = "nodebox",
tiles = {"default_latch_steel_rust.png"},
use_texture_alpha = "clip",
groups = { breakable = 1 },
sounds = lzr_sounds.node_sound_metal_defaults()
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 697 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 589 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 636 B

View File

@ -133,6 +133,7 @@ end
local register_element = function(subname, def, options)
local def_core = table.copy(def)
if not options then options = {} end
if options.is_detector then
def_core.after_place_node = full_update_detector_placed
else
@ -140,7 +141,9 @@ local register_element = function(subname, def, options)
end
def_core.after_dig_node = full_update
def_core._after_rotate = after_rotate
def_core._lzr_active = "lzr_laser:"..subname.."_on"
if options.activate ~= false then
def_core._lzr_active = "lzr_laser:"..subname.."_on"
end
def_core.tiles = def.tiles_off
def_core.mesh = def.mesh_off
if not def_core.groups then
@ -170,36 +173,41 @@ local register_element = function(subname, def, options)
return minetest.item_place_node(itemstack, placer, pointed_thing)
end
end
local def_core_on = table.copy(def_core)
def_core_on.description = S("@1 (active)", def.description)
def_core_on._lzr_active = nil
def_core_on._lzr_inactive = "lzr_laser:"..subname
def_core_on.tiles = def.tiles_on
def_core_on.mesh = def.mesh_on
def_core_on.drop = "lzr_laser:"..subname
def_core_on.groups[subname] = 2
def_core_on.light_source = def.light_source_on
if not options then options = {} end
minetest.register_node("lzr_laser:"..subname, def_core)
minetest.register_node("lzr_laser:"..subname.."_on", def_core_on)
local def_core_on
if options.activate ~= false then
def_core_on = table.copy(def_core)
def_core_on.description = S("@1 (active)", def.description)
def_core_on._lzr_active = nil
def_core_on._lzr_inactive = "lzr_laser:"..subname
def_core_on.tiles = def.tiles_on
def_core_on.mesh = def.mesh_on
def_core_on.drop = "lzr_laser:"..subname
def_core_on.groups[subname] = 2
def_core_on.light_source = def.light_source_on
minetest.register_node("lzr_laser:"..subname.."_on", def_core_on)
end
if options.allow_take then
local def_takable = table.copy(def_core)
def_takable.tiles = def.tiles_takable_off
def_takable.groups.takable = 1
def_takable.description = S("@1 (takable)", def.description)
def_takable._lzr_active = "lzr_laser:"..subname.."_takable_on"
local def_takable_on = table.copy(def_core_on)
def_takable_on.tiles = def.tiles_takable_on
def_takable_on.light_source = def.light_source_on
def_takable_on.groups.takable = 1
def_takable_on.description = S("@1 (takable, active)", def.description)
def_takable_on.drop = "lzr_laser:"..subname.."_takable"
def_takable_on._lzr_inactive = "lzr_laser:"..subname.."_takable"
minetest.register_node("lzr_laser:"..subname.."_takable", def_takable)
minetest.register_node("lzr_laser:"..subname.."_takable_on", def_takable_on)
if options.activate ~= false then
def_takable._lzr_active = "lzr_laser:"..subname.."_takable_on"
local def_takable_on = table.copy(def_core_on)
def_takable_on.tiles = def.tiles_takable_on
def_takable_on.light_source = def.light_source_on
def_takable_on.groups.takable = 1
def_takable_on.description = S("@1 (takable, active)", def.description)
def_takable_on.drop = "lzr_laser:"..subname.."_takable"
def_takable_on._lzr_inactive = "lzr_laser:"..subname.."_takable"
minetest.register_node("lzr_laser:"..subname.."_takable_on", def_takable_on)
end
end
end
@ -209,6 +217,17 @@ for i=-8, 7 do
table.insert(wedge_box, { i/16, -0.5, i/16, (i+1)/16, 0.5, 0.5 })
end
register_element("crate", {
description = S("Crate"),
tiles_off = {
"lzr_laser_crate_fixed.png",
},
tiles_takable_off = {
"lzr_laser_crate.png",
},
sounds = lzr_sounds.node_sound_wood_defaults(),
}, { allow_take = true, activate = false })
register_element("mirror", {
description = S("Mirror"),
paramtype = "light",

Binary file not shown.

After

Width:  |  Height:  |  Size: 500 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 227 B