-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add rock bricks+blocks; move chamotte and mordor bricks+blocks into s…
…eparate files; save untranslated definition for rocks to use it in other blocks registration. Closes #1304
- Loading branch information
Showing
7 changed files
with
165 additions
and
103 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,94 @@ | ||
local S = minetest.get_translator(minetest.get_current_modname()) | ||
|
||
-- Items | ||
|
||
minetest.register_craftitem("lord_bricks:chamotte_brick_raw", { | ||
description = S("Raw Chamotte Brick"), | ||
inventory_image = "lord_bricks_chamotte_brick_raw.png" | ||
}) | ||
|
||
minetest.register_craftitem("lord_bricks:chamotte_brick_dried", { | ||
description = S("Chamotte Brick"), | ||
inventory_image = "lord_bricks_chamotte_brick_dried.png" | ||
}) | ||
|
||
|
||
-- Nodes | ||
|
||
minetest.register_node("lord_bricks:chamotte_masonry", { | ||
description = S("Chamotte Masonry"), | ||
tiles = {"lord_bricks_chamotte_masonry.png"}, | ||
is_ground_content = false, | ||
groups = {cracky = 2, brick = 1}, | ||
sounds = default.node_sound_stone_defaults(), | ||
}) | ||
|
||
minetest.register_node("lord_bricks:chamotte_masonry_large", { | ||
description = S("Large Chamotte Masonry"), | ||
tiles = {"lord_bricks_chamotte_masonry_large.png"}, | ||
is_ground_content = false, | ||
groups = {cracky = 2, brick = 1}, | ||
sounds = default.node_sound_stone_defaults(), | ||
}) | ||
|
||
minetest.register_node("lord_bricks:chamotte_brick", { | ||
description = S("Chamotte Brick"), | ||
tiles = {"lord_bricks_chamotte_brick.png"}, | ||
is_ground_content = false, | ||
groups = {cracky = 2, brick = 1}, | ||
sounds = default.node_sound_stone_defaults(), | ||
}) | ||
|
||
minetest.register_node("lord_bricks:chamotte_block", { | ||
description = S("Chamotte Block"), | ||
tiles = {"lord_bricks_chamotte_block.png"}, | ||
is_ground_content = false, | ||
groups = {cracky = 2}, | ||
sounds = default.node_sound_stone_defaults(), | ||
}) | ||
|
||
|
||
stairs.register_stair_and_slab("chamotte_masonry", "lord_bricks:chamotte_masonry", | ||
{cracky=2}, | ||
{"lord_bricks_chamotte_masonry.png"}, | ||
S("Chamotte Masonry Stair"), | ||
S("Chamotte Masonry Slab"), | ||
default.node_sound_stone_defaults(), | ||
false, | ||
S("Inner Chamotte Masonry Stair"), | ||
S("Outer Chamotte Masonry Stair") | ||
) | ||
|
||
stairs.register_stair_and_slab("chamotte_masonry_large", "lord_bricks:chamotte_masonry_large", | ||
{cracky=2}, | ||
{"lord_bricks_chamotte_masonry_large.png"}, | ||
S("Large Chamotte Masonry Stair"), | ||
S("Large Chamotte Masonry Slab"), | ||
default.node_sound_stone_defaults(), | ||
false, | ||
S("Inner Large Chamotte Masonry Stair"), | ||
S("Outer Large Chamotte Masonry Stair") | ||
) | ||
|
||
stairs.register_stair_and_slab("chamotte_brick", "lord_bricks:chamotte_brick", | ||
{cracky=2}, | ||
{"lord_bricks_chamotte_brick.png"}, | ||
S("Chamotte Brick Stair"), | ||
S("Chamotte Brick Slab"), | ||
default.node_sound_stone_defaults(), | ||
false, | ||
S("Inner Chamotte Brick Stair"), | ||
S("Outer Chamotte Brick Stair") | ||
) | ||
|
||
stairs.register_stair_and_slab("chamotte_block", "lord_bricks:chamotte_block", | ||
{cracky=2}, | ||
{"lord_bricks_chamotte_block.png"}, | ||
S("Chamotte Block Stair"), | ||
S("Chamotte Block Slab"), | ||
default.node_sound_stone_defaults(), | ||
false, | ||
S("Inner Chamotte Block Stair"), | ||
S("Outer Chamotte Block Stair") | ||
) | ||
|
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
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
name = lord_bricks | ||
depends = lord_overwrites_mtg_default, stairs | ||
depends = lord_overwrites_mtg_default, stairs, lord_rocks |
83 changes: 8 additions & 75 deletions
83
mods/lord/Blocks/lord_bricks/nodes.lua → ...lord/Blocks/lord_bricks/mordor_bricks.lua
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
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,51 @@ | ||
local S = minetest.get_translator(minetest.get_current_modname()) | ||
|
||
for node_name, registration in pairs(rocks.get_lord_nodes()) do | ||
local name = node_name:split(":")[2] | ||
local base_description = registration.original_description | ||
|
||
local def_brick = table.copy(minetest.registered_nodes[node_name]) | ||
local brick_name = string.format("lord_bricks:%s_brick", name) | ||
def_brick.description = S(string.format("%s Brick", base_description)) | ||
def_brick.tiles = { string.format("lord_bricks_$s_brick.png", name) } | ||
def_brick.groups.stone = nil | ||
def_brick.groups.rock = nil | ||
def_brick.groups.brick = 1 | ||
|
||
local def_block = table.copy(minetest.registered_nodes[node_name]) | ||
local block_name = string.format("lord_bricks:%s_block", name) | ||
def_block.description = S(string.format("%s Block", base_description)) | ||
def_brick.tiles = { string.format("lord_bricks_$s_block.png", name) } | ||
def_block.groups.stone = nil | ||
def_block.groups.rock = nil | ||
|
||
for _, texture in ipairs(def_brick.tiles) do | ||
minetest.log("info", "use texture: " .. texture .. " at " .. __FILE_LINE__()) | ||
end | ||
|
||
for _, texture in ipairs(def_block.tiles) do | ||
minetest.log("info", "use texture: " .. texture .. " at " .. __FILE_LINE__()) | ||
end | ||
|
||
minetest.register_node(brick_name, def_brick) | ||
minetest.register_node(block_name, def_block) | ||
|
||
minetest.register_craft({ | ||
type = "shaped", | ||
output = brick_name .. " 4", | ||
recipe = { | ||
{ node_name, node_name, }, | ||
{ node_name, node_name, }, | ||
}, | ||
}) | ||
|
||
minetest.register_craft({ | ||
type = "shaped", | ||
output = block_name .. " 9", | ||
recipe = { | ||
{ node_name, node_name, node_name, }, | ||
{ node_name, node_name, node_name, }, | ||
{ node_name, node_name, node_name, }, | ||
}, | ||
}) | ||
end |
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
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