[mcl_colorbricks] add colored bricks
60
mods/ITEMS/mcl_colorbricks/init.lua
Normal file
|
@ -0,0 +1,60 @@
|
||||||
|
local S = minetest.get_translator(minetest.get_current_modname())
|
||||||
|
local mod_doc = minetest.get_modpath("doc")
|
||||||
|
|
||||||
|
local brick = {}
|
||||||
|
-- This uses a trick: you can first define the recipes using all of the base
|
||||||
|
-- colors, and then some recipes using more specific colors for a few non-base
|
||||||
|
-- colors available. When crafting, the last recipes will be checked first.
|
||||||
|
brick.dyes = {
|
||||||
|
-- name, texture, colorbrick desc., dye, color_group
|
||||||
|
{"white", "mcl_colorbricks_white", "White Brick", "white", "unicolor_white"},
|
||||||
|
{"grey", "mcl_colorbricks_dark_grey", "Grey Brick", "dark_grey", "unicolor_darkgrey"},
|
||||||
|
{"silver", "mcl_colorbricks_grey", "Light Grey Brick", "grey", "unicolor_grey"},
|
||||||
|
{"black", "mcl_colorbricks_black", "Black Brick", "black", "unicolor_black"},
|
||||||
|
{"yellow", "mcl_colorbricks_yellow", "Yellow Brick", "yellow", "unicolor_yellow"},
|
||||||
|
{"green", "mcl_colorbricks_dark_green", "Green Brick", "dark_green", "unicolor_dark_green"},
|
||||||
|
{"cyan", "mcl_colorbricks_cyan", "Cyan Brick", "cyan", "unicolor_cyan"},
|
||||||
|
{"blue", "mcl_colorbricks_blue", "Blue Brick", "blue", "unicolor_blue"},
|
||||||
|
{"magenta", "mcl_colorbricks_magenta", "Magenta Brick", "magenta", "unicolor_red_violet"},
|
||||||
|
{"orange", "mcl_colorbricks_orange", "Orange Brick", "orange", "unicolor_orange"},
|
||||||
|
{"purple", "mcl_colorbricks_violet", "Purple Brick", "violet", "unicolor_violet"},
|
||||||
|
{"brown", "mcl_colorbricks_brown", "Brown Brick", "brown", "unicolor_dark_orange"},
|
||||||
|
{"pink", "mcl_colorbricks_pink", "Pink Brick", "pink", "unicolor_light_red"},
|
||||||
|
{"lime", "mcl_colorbricks_lime", "Lime Brick", "green", "unicolor_green"},
|
||||||
|
{"light_blue", "mcl_colorbricks_light_blue", "Light Blue Brick", "lightblue", "unicolor_light_blue"},
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, row in ipairs(brick.dyes) do
|
||||||
|
local name = row[1]
|
||||||
|
local texture = row[2]
|
||||||
|
local desc_brick = row[3]
|
||||||
|
local dye = row[4]
|
||||||
|
local color_group = row[5]
|
||||||
|
|
||||||
|
-- Node Definition
|
||||||
|
minetest.register_node("mcl_colorbricks:colorbrick_"..name, {
|
||||||
|
description = S(desc_brick),
|
||||||
|
stack_max = 64,
|
||||||
|
is_ground_content = false,
|
||||||
|
tiles = {texture..".png"},
|
||||||
|
groups = {pickaxey=1, building_block=1, material_stone=1, [color_group]=1},
|
||||||
|
sounds = mcl_sounds.node_sound_stone_defaults(),
|
||||||
|
_mcl_blast_resistance = 6,
|
||||||
|
_mcl_hardness = 2,
|
||||||
|
})
|
||||||
|
|
||||||
|
if mod_doc and not is_canonical then
|
||||||
|
doc.add_entry_alias("nodes", "mcl_core:brick_block", "nodes", "mcl_colorbricks:colorbrick_"..name)
|
||||||
|
end
|
||||||
|
|
||||||
|
mcl_stairs.register_stair_and_slab_simple("colorbrick_"..name, "mcl_colorbricks:colorbrick_"..name, S(desc_brick.." Stairs"), S(desc_brick.." Slab"), S("Double "..desc_brick.." Slab"))
|
||||||
|
|
||||||
|
if dye then
|
||||||
|
-- Crafting from dye and white wool
|
||||||
|
minetest.register_craft({
|
||||||
|
type = "shapeless",
|
||||||
|
output = "mcl_colorbricks:colorbrick_"..name,
|
||||||
|
recipe = {"mcl_dye:"..dye, "mcl_core:brick_block"},
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end
|
3
mods/ITEMS/mcl_colorbricks/mod.conf
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
name = mcl_colorbricks
|
||||||
|
depends = mcl_colors, mcl_stairs, mclx_stairs
|
||||||
|
optional_depends = mcl_sounds, mcl_core, doc, mcl_dye
|
BIN
mods/ITEMS/mcl_colorbricks/textures/mcl_colorbricks_black.png
Normal file
After Width: | Height: | Size: 5.2 KiB |
BIN
mods/ITEMS/mcl_colorbricks/textures/mcl_colorbricks_blue.png
Normal file
After Width: | Height: | Size: 5.5 KiB |
BIN
mods/ITEMS/mcl_colorbricks/textures/mcl_colorbricks_brown.png
Normal file
After Width: | Height: | Size: 5.4 KiB |
BIN
mods/ITEMS/mcl_colorbricks/textures/mcl_colorbricks_cyan.png
Normal file
After Width: | Height: | Size: 5.5 KiB |
After Width: | Height: | Size: 5.4 KiB |
After Width: | Height: | Size: 5.2 KiB |
BIN
mods/ITEMS/mcl_colorbricks/textures/mcl_colorbricks_grey.png
Normal file
After Width: | Height: | Size: 5.3 KiB |
After Width: | Height: | Size: 5.5 KiB |
BIN
mods/ITEMS/mcl_colorbricks/textures/mcl_colorbricks_lime.png
Normal file
After Width: | Height: | Size: 5.5 KiB |
BIN
mods/ITEMS/mcl_colorbricks/textures/mcl_colorbricks_magenta.png
Normal file
After Width: | Height: | Size: 5.5 KiB |
BIN
mods/ITEMS/mcl_colorbricks/textures/mcl_colorbricks_orange.png
Normal file
After Width: | Height: | Size: 5.6 KiB |
BIN
mods/ITEMS/mcl_colorbricks/textures/mcl_colorbricks_pink.png
Normal file
After Width: | Height: | Size: 5.5 KiB |
BIN
mods/ITEMS/mcl_colorbricks/textures/mcl_colorbricks_violet.png
Normal file
After Width: | Height: | Size: 5.5 KiB |
BIN
mods/ITEMS/mcl_colorbricks/textures/mcl_colorbricks_white.png
Normal file
After Width: | Height: | Size: 5.2 KiB |
BIN
mods/ITEMS/mcl_colorbricks/textures/mcl_colorbricks_yellow.png
Normal file
After Width: | Height: | Size: 5.5 KiB |