forked from minetest-mods/moreblocks
Compare commits
12 Commits
9423c32f5b
...
master
Author | SHA1 | Date | |
---|---|---|---|
533045d382 | |||
58baa2b5f5 | |||
f17b84ade4 | |||
3d36f1f2fe | |||
7f02b444dc | |||
768225a990 | |||
20689b1f18 | |||
77c4ebb7ab | |||
54b2217aeb | |||
79a0c76d40 | |||
ee42eeee8d | |||
d70ac4b289 |
@ -31,4 +31,5 @@ read_globals = {
|
|||||||
"HasOwner",
|
"HasOwner",
|
||||||
"getLastOwner",
|
"getLastOwner",
|
||||||
"GetNodeOwnerName",
|
"GetNodeOwnerName",
|
||||||
|
"place_rotated",
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,9 @@ circular_saw.known_stairs = setmetatable({}, {
|
|||||||
-- This is populated by stairsplus:register_all:
|
-- This is populated by stairsplus:register_all:
|
||||||
circular_saw.known_nodes = {}
|
circular_saw.known_nodes = {}
|
||||||
|
|
||||||
|
-- This is populated by stairsplus:register_micro:
|
||||||
|
circular_saw.microblocks = {}
|
||||||
|
|
||||||
-- How many microblocks does this shape at the output inventory cost:
|
-- How many microblocks does this shape at the output inventory cost:
|
||||||
-- It may cause slight loss, but no gain.
|
-- It may cause slight loss, but no gain.
|
||||||
circular_saw.cost_in_microblocks = {
|
circular_saw.cost_in_microblocks = {
|
||||||
@ -137,10 +140,13 @@ function circular_saw:reset(pos)
|
|||||||
|
|
||||||
inv:set_list("input", {})
|
inv:set_list("input", {})
|
||||||
inv:set_list("micro", {})
|
inv:set_list("micro", {})
|
||||||
inv:set_list("output", {})
|
|
||||||
|
|
||||||
meta:set_int("anz", 0)
|
local microblockcount = inv:get_stack("micro",1):get_count()
|
||||||
|
meta:set_int("anz", microblockcount)
|
||||||
|
if microblockcount == 0 then
|
||||||
meta:set_string("infotext", S("Circular Saw is empty") .. owned_by)
|
meta:set_string("infotext", S("Circular Saw is empty") .. owned_by)
|
||||||
|
inv:set_list("output", {})
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@ -161,19 +167,21 @@ function circular_saw:update_inventory(pos, amount)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local stack = inv:get_stack("input", 1)
|
local stack = inv:get_stack("input", 1)
|
||||||
-- At least one "normal" block is necessary to see what kind of stairs are requested.
|
local microstack = inv:get_stack("micro",1)
|
||||||
if stack:is_empty() then
|
|
||||||
-- Any microblocks not taken out yet are now lost.
|
-- At least one (micro)block is necessary to see what kind of stairs are requested.
|
||||||
-- (covers material loss in the machine)
|
if stack:is_empty() and microstack:is_empty() then
|
||||||
|
|
||||||
self:reset(pos)
|
self:reset(pos)
|
||||||
return
|
return
|
||||||
|
|
||||||
end
|
end
|
||||||
local node_name = stack:get_name() or ""
|
|
||||||
|
local node_name = circular_saw.microblocks[microstack:get_name()] or stack:get_name() or ""
|
||||||
local node_def = stack:get_definition()
|
local node_def = stack:get_definition()
|
||||||
local name_parts = circular_saw.known_nodes[node_name] or ""
|
local name_parts = circular_saw.known_nodes[node_name] or ""
|
||||||
local modname = name_parts[1] or ""
|
local modname = name_parts[1]
|
||||||
local material = name_parts[2] or ""
|
local material = name_parts[2]
|
||||||
local owned_by = meta:get_string("owner")
|
local owned_by = meta:get_string("owner")
|
||||||
|
|
||||||
if owned_by and owned_by ~= "" then
|
if owned_by and owned_by ~= "" then
|
||||||
@ -197,6 +205,7 @@ function circular_saw:update_inventory(pos, amount)
|
|||||||
inv:set_list("micro", {
|
inv:set_list("micro", {
|
||||||
modname .. ":micro_" .. material .. " " .. (amount % 8)
|
modname .. ":micro_" .. material .. " " .. (amount % 8)
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Display:
|
-- Display:
|
||||||
inv:set_list("output",
|
inv:set_list("output",
|
||||||
self:get_output_inv(modname, material, amount,
|
self:get_output_inv(modname, material, amount,
|
||||||
@ -233,11 +242,11 @@ function circular_saw.allow_metadata_inventory_move(
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
-- Only input- and recycle-slot are intended as input slots:
|
-- Only input- and recycle-slot (and microblock slot when empty) are intended as input slots:
|
||||||
function circular_saw.allow_metadata_inventory_put(
|
function circular_saw.allow_metadata_inventory_put(
|
||||||
pos, listname, index, stack, player)
|
pos, listname, index, stack, player)
|
||||||
-- The player is not allowed to put something in there:
|
-- The player is not allowed to put something in there:
|
||||||
if listname == "output" or listname == "micro" then
|
if listname == "output" then
|
||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -285,6 +294,16 @@ function circular_saw.allow_metadata_inventory_put(
|
|||||||
end
|
end
|
||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if listname == "micro" then
|
||||||
|
if not (inv:is_empty("input") and inv:is_empty("micro")) then return 0 end
|
||||||
|
for name, t in pairs(circular_saw.microblocks) do
|
||||||
|
if name == stackname and inv:room_for_item("input", stack) then
|
||||||
|
return count
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return 0
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Taking is allowed from all slots (even the internal microblock slot).
|
-- Taking is allowed from all slots (even the internal microblock slot).
|
||||||
@ -304,6 +323,8 @@ function circular_saw.on_metadata_inventory_put(
|
|||||||
if listname == "input" then
|
if listname == "input" then
|
||||||
-- Each new block is worth 8 microblocks:
|
-- Each new block is worth 8 microblocks:
|
||||||
circular_saw:update_inventory(pos, 8 * count)
|
circular_saw:update_inventory(pos, 8 * count)
|
||||||
|
elseif listname == "micro" then
|
||||||
|
circular_saw:update_inventory(pos, count)
|
||||||
elseif listname == "recycle" then
|
elseif listname == "recycle" then
|
||||||
-- Lets look which shape this represents:
|
-- Lets look which shape this represents:
|
||||||
local cost = circular_saw:get_cost(inv, stackname)
|
local cost = circular_saw:get_cost(inv, stackname)
|
||||||
@ -354,7 +375,6 @@ function circular_saw.on_metadata_inventory_take(
|
|||||||
-- We do know how much each block at each position costs:
|
-- We do know how much each block at each position costs:
|
||||||
local cost = circular_saw.cost_in_microblocks[index]
|
local cost = circular_saw.cost_in_microblocks[index]
|
||||||
* stack:get_count()
|
* stack:get_count()
|
||||||
|
|
||||||
circular_saw:update_inventory(pos, -cost)
|
circular_saw:update_inventory(pos, -cost)
|
||||||
elseif listname == "micro" then
|
elseif listname == "micro" then
|
||||||
-- Each microblock costs 1 microblock:
|
-- Each microblock costs 1 microblock:
|
||||||
@ -447,6 +467,7 @@ minetest.register_node("moreblocks:circular_saw", {
|
|||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
groups = {choppy = 2,oddly_breakable_by_hand = 2},
|
groups = {choppy = 2,oddly_breakable_by_hand = 2},
|
||||||
|
is_ground_content = false,
|
||||||
sounds = moreblocks.node_sound_wood_defaults(),
|
sounds = moreblocks.node_sound_wood_defaults(),
|
||||||
on_construct = circular_saw.on_construct,
|
on_construct = circular_saw.on_construct,
|
||||||
can_dig = circular_saw.can_dig,
|
can_dig = circular_saw.can_dig,
|
||||||
|
3
init.lua
3
init.lua
@ -21,8 +21,7 @@ dofile(modpath .. "/stairsplus/init.lua")
|
|||||||
|
|
||||||
if minetest.get_modpath("default") then
|
if minetest.get_modpath("default") then
|
||||||
dofile(modpath .. "/nodes.lua")
|
dofile(modpath .. "/nodes.lua")
|
||||||
|
dofile(modpath .. "/redefinitions.lua")
|
||||||
dofile(modpath .. "/crafting.lua")
|
dofile(modpath .. "/crafting.lua")
|
||||||
dofile(modpath .. "/aliases.lua")
|
dofile(modpath .. "/aliases.lua")
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.log("action", "[moreblocks] loaded.")
|
|
||||||
|
94
locale/moreblocks.pt_BR.tr
Normal file
94
locale/moreblocks.pt_BR.tr
Normal file
@ -0,0 +1,94 @@
|
|||||||
|
# textdomain: moreblocks
|
||||||
|
|
||||||
|
# Portuguese_Brazil translation for More Blocks.
|
||||||
|
# Copyright © 2011-2020 Hugo Locurcio and contributors
|
||||||
|
# This file is distributed under the same license as the More Blocks package.
|
||||||
|
# Jose Anastacio 2020.
|
||||||
|
|
||||||
|
#: circular_saw.lua
|
||||||
|
|
||||||
|
Circular Saw=Serra Circular
|
||||||
|
Input material=Material de entrada
|
||||||
|
Left-over=Sobra
|
||||||
|
Max=Máximo
|
||||||
|
Recycle output=Saida reciclagem
|
||||||
|
Set=Defina
|
||||||
|
owned by @1=propriedade de @1
|
||||||
|
Circular Saw is empty=Serra Circular está vazia
|
||||||
|
Circular Saw is working on @1=Serra Circular está trabalhando em @1
|
||||||
|
|
||||||
|
#: nodes.lua
|
||||||
|
|
||||||
|
Deprecated=Descontinuado
|
||||||
|
All-faces Acacia Tree=Árvore de Acácia multifacetada
|
||||||
|
All-faces Aspen Tree=Árvore Aspen multifacetada
|
||||||
|
All-faces Jungle Tree=Árvore da Selva multifacetada
|
||||||
|
All-faces Pine Tree=Pinheiro multifacetado
|
||||||
|
All-faces Tree=Tronco de árvore
|
||||||
|
Cactus Brick=Tijolos de Cacto
|
||||||
|
Cactus Checker=Xadrez de Cacto
|
||||||
|
Centered Wooden Tile=Tijolos Centrado de Madeira
|
||||||
|
Checker Stone Tile=Xadrez Centrado de Pedra
|
||||||
|
Circle Stone Bricks=Tijolos de Pedra Cricular
|
||||||
|
Clean Glass=Vidro Limpo
|
||||||
|
Coal Checker=Xadrez de Carvão
|
||||||
|
Coal Glass=Vidro com Carvao
|
||||||
|
Clean Super Glow Glass=Cristal Limpo Super brilhante
|
||||||
|
Trap Clean Super Glow Glass=Vidro Limpo Super brilhante
|
||||||
|
Trap Clean Glass=Cristal Falso Limpo
|
||||||
|
Clean Glow Glass=Cristal Brillante Limpo
|
||||||
|
Trap Clean Glow Glass=Cristal Brillante Limpo Falso
|
||||||
|
Coal Stone=Pedra de carvão
|
||||||
|
Coal Stone Bricks=Tijolos de Carvão
|
||||||
|
Compressed Cobblestone=Pedregulho Comprimido
|
||||||
|
Compressed Desert Cobblestone=Pedregulho do Deserto Comprimido
|
||||||
|
Compressed Dirt=Terra Comprimida
|
||||||
|
Copper Patina Block=Bloco pátina de cobre
|
||||||
|
Empty Shelf=Prateleira Vazia
|
||||||
|
Full Wooden Tile=Xadrez de Madeira completo
|
||||||
|
Glow Glass=Vidro brilhante
|
||||||
|
Iron Checker=Xadrez de Ferro
|
||||||
|
Iron Glass=Cristal com ferro
|
||||||
|
Iron Stone=Ferro e Pedra
|
||||||
|
Iron Stone Bricks=Tijolos de Ferro
|
||||||
|
Plankstone=Prancha de Pedra
|
||||||
|
Rope=Corda
|
||||||
|
Split Stone Tile=Xadrez de Pedra Dividido
|
||||||
|
Stone Bricks=Tijolos de Pedra
|
||||||
|
Stone Tile=Xadrez de Pedra
|
||||||
|
Super Glow Glass=Cristal Súper Brillante
|
||||||
|
Sweeper=Limpiador
|
||||||
|
Tar=Alquitrán
|
||||||
|
Trap Desert Stone=Pedra del Desierto Falsa
|
||||||
|
Trap Glass=Cristal Falso
|
||||||
|
Trap Glow Glass=Cristal Brillante Falso
|
||||||
|
Trap Obsidian=Obsidiana Falsa
|
||||||
|
Trap Obsidian Glass=Vidrio de Obsidiana Falso
|
||||||
|
Trap Sandstone=Arenisca Falsa
|
||||||
|
Trap Stone=Piedra Falsa
|
||||||
|
Trap Super Glow Glass=Cristal Súper Brillante Falso
|
||||||
|
Wooden Tile=Xadrez de Madeira
|
||||||
|
Offset Wooden Tile=Xadrez de Madeira compensada
|
||||||
|
Downwards Wooden Tile=Xadrez de Madeira para baixo
|
||||||
|
Leftwards Wooden Tile=Xadrez de Madeira para a esquerda
|
||||||
|
Rightwards Wooden Tile=Xadrez de Madeira para a direita
|
||||||
|
|
||||||
|
|
||||||
|
#: ownership.lua
|
||||||
|
|
||||||
|
Sorry, @1 owns that spot.=Desculpe, @1 é o dono desse lugar.
|
||||||
|
someone=alguem
|
||||||
|
|
||||||
|
#: stairsplus/common.lua
|
||||||
|
|
||||||
|
@1 Microblock=Microbloco de @1
|
||||||
|
@1 Slab=Laje de @1
|
||||||
|
@1 Slope=Declive de @1
|
||||||
|
@1 Painel=Panel de @1
|
||||||
|
@1 Stairs=Escadas de @1
|
||||||
|
|
||||||
|
#: stairsplus/registrations.lua
|
||||||
|
|
||||||
|
Concrete=Concreto
|
||||||
|
Cement=Cimento
|
||||||
|
Brass Block=Bloco de latão
|
92
locale/moreblocks.uk.tr
Normal file
92
locale/moreblocks.uk.tr
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
# textdomain: moreblocks
|
||||||
|
|
||||||
|
More Blocks=Більше Блоків
|
||||||
|
Adds various miscellaneous blocks to the game.=Додає різноманітні нові блоки до гри.
|
||||||
|
Adds various miscellaneous blocks.=Додає різноманітні нові блоки до гри.
|
||||||
|
|
||||||
|
#: circular_saw.lua
|
||||||
|
|
||||||
|
Circular Saw=Циркулярна пила
|
||||||
|
Input material=Вхідний@nматеріал
|
||||||
|
Left-over=Залишки
|
||||||
|
Max=Кільк.
|
||||||
|
Recycle output=Пере-@nобробка
|
||||||
|
Set=Гаразд
|
||||||
|
owned by @1=належить @1
|
||||||
|
Circular Saw is empty=Циркулярна пила пуста
|
||||||
|
Circular Saw is working on @1=Циркулярна пила працює над @1
|
||||||
|
|
||||||
|
#: init.lua
|
||||||
|
|
||||||
|
[MOD] moreblocks loaded.=[MOD] moreblocks завантажено.
|
||||||
|
|
||||||
|
#: nodes.lua
|
||||||
|
|
||||||
|
Deprecated=застарілий
|
||||||
|
All-faces Acacia Tree=Всебічна колода акації
|
||||||
|
All-faces Aspen Tree=Всебічна колода осики
|
||||||
|
All-faces Jungle Tree=Всебічна джунглева колода
|
||||||
|
All-faces Pine Tree=Всебічна колода сосни
|
||||||
|
All-faces Tree=Всебічна колода яблуні
|
||||||
|
Cactus Brick=Кактусова цегла
|
||||||
|
Cactus Checker=Кактусова мозаїка
|
||||||
|
Centered Wooden Tile=Дерев'яна мозаїка (центр)
|
||||||
|
Checker Stone Tile=Кам'яна мозаїка
|
||||||
|
Circle Stone Bricks=Кільцевий камінь
|
||||||
|
Clean Glass=Чисте скло
|
||||||
|
Coal Checker=Вугілляна мозаїка
|
||||||
|
Coal Glass=Вугілляне скло
|
||||||
|
Clean Super Glow Glass=Чисте супер-сяюче скло
|
||||||
|
Trap Clean Super Glow Glass=Trap чисте супер-сяюче скло
|
||||||
|
Trap Clean Glass=Trap чисте скло
|
||||||
|
Clean Glow Glass=Чисте сяюче скло
|
||||||
|
Trap Clean Glow Glass=Trap чисте сяюче скло
|
||||||
|
Coal Stone=Вугілляний камінь
|
||||||
|
Coal Stone Bricks=Вуглекам'яна цегла
|
||||||
|
Compressed Cobblestone=Пресований кругляк
|
||||||
|
Compressed Desert Cobblestone=Пресований пустельний кругляк
|
||||||
|
Compressed Dirt=Пресований ґрунт
|
||||||
|
Copper Patina Block=Блок мідного патину
|
||||||
|
Empty Shelf=Пусті полиці
|
||||||
|
Full Wooden Tile=Дерев'яна мозаїка
|
||||||
|
Glow Glass=Сяюче скло
|
||||||
|
Iron Checker=Сталева мозаїка
|
||||||
|
Iron Glass=Металізоване скло
|
||||||
|
Iron Stone=Залізний камінь
|
||||||
|
Iron Stone Bricks=Залізокам'яна цегла
|
||||||
|
Plankstone=Деревокам'яна мозаїка
|
||||||
|
Rope=Мотузка
|
||||||
|
Split Stone Tile=Кам'яна мозаїка
|
||||||
|
Stone Bricks=Кам'яна цегла
|
||||||
|
Stone Tile=Кам'яна плитка
|
||||||
|
Super Glow Glass=Супер-сяюче скло
|
||||||
|
Sweeper=Підмітальник
|
||||||
|
Tar=Смола
|
||||||
|
Trap Desert Stone=Уявний пустельний камінь
|
||||||
|
Trap Glass=Уявне скло
|
||||||
|
Trap Glow Glass=Уявне сяюче скло
|
||||||
|
Trap Obsidian=Уявний обсидіан
|
||||||
|
Trap Obsidian Glass=Уявне обсидіанове скло
|
||||||
|
Trap Sandstone=Уявний пісковик
|
||||||
|
Trap Stone=Уявний камінь
|
||||||
|
Trap Super Glow Glass=Уявне супер-сяюче скло
|
||||||
|
Wooden Tile=Дерев'яна мозаїка
|
||||||
|
Offset Wooden Tile=Дерев'яна мозаїка (зверзу)
|
||||||
|
# @deprecated
|
||||||
|
Downwards Wooden Tile=Дерев'яна мозаїка (знизу)
|
||||||
|
# @deprecated
|
||||||
|
Leftwards Wooden Tile=Дерев'яна мозаїка (ліворуч)
|
||||||
|
# @deprecated
|
||||||
|
Rightwards Wooden Tile=Дерев'яна мозаїка (праворуч)
|
||||||
|
|
||||||
|
#: ownership.lua
|
||||||
|
Sorry, @1 owns that spot.=Вибачте, це належить @1.
|
||||||
|
someone=комусь
|
||||||
|
|
||||||
|
#: stairsplus/common.lua
|
||||||
|
|
||||||
|
@1 Microblock=@1 (мікроблок)
|
||||||
|
@1 Slab=@1 (плита)
|
||||||
|
@1 Slope=@1 (схил)
|
||||||
|
@1 Panel=@1 (панель)
|
||||||
|
@1 Stairs=@1 (сходи)
|
2
mod.conf
2
mod.conf
@ -1,4 +1,4 @@
|
|||||||
name = moreblocks
|
name = moreblocks
|
||||||
description = Adds various miscellaneous blocks to the game.
|
description = Adds various miscellaneous blocks to the game.
|
||||||
optional_depends = default,stairs,farming,wool,basic_materials
|
optional_depends = default,stairs,farming,wool,basic_materials,place_rotated
|
||||||
min_minetest_version = 5.0.0
|
min_minetest_version = 5.0.0
|
||||||
|
77
nodes.lua
77
nodes.lua
@ -41,7 +41,6 @@ local nodes = {
|
|||||||
["wood_tile"] = {
|
["wood_tile"] = {
|
||||||
description = S("Wooden Tile"),
|
description = S("Wooden Tile"),
|
||||||
groups = {wood = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 3},
|
groups = {wood = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 3},
|
||||||
is_ground_content = false,
|
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
place_param2 = 0,
|
place_param2 = 0,
|
||||||
tiles = {"default_wood.png^moreblocks_wood_tile.png",
|
tiles = {"default_wood.png^moreblocks_wood_tile.png",
|
||||||
@ -66,14 +65,12 @@ local nodes = {
|
|||||||
["wood_tile_center"] = {
|
["wood_tile_center"] = {
|
||||||
description = S("Centered Wooden Tile"),
|
description = S("Centered Wooden Tile"),
|
||||||
groups = {wood = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 3},
|
groups = {wood = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 3},
|
||||||
is_ground_content = false,
|
|
||||||
tiles = {"default_wood.png^moreblocks_wood_tile_center.png"},
|
tiles = {"default_wood.png^moreblocks_wood_tile_center.png"},
|
||||||
sounds = sound_wood,
|
sounds = sound_wood,
|
||||||
},
|
},
|
||||||
["wood_tile_full"] = {
|
["wood_tile_full"] = {
|
||||||
description = S("Full Wooden Tile"),
|
description = S("Full Wooden Tile"),
|
||||||
groups = {wood = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 3},
|
groups = {wood = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 3},
|
||||||
is_ground_content = false,
|
|
||||||
tiles = tile_tiles("wood_tile_full"),
|
tiles = tile_tiles("wood_tile_full"),
|
||||||
sounds = sound_wood,
|
sounds = sound_wood,
|
||||||
},
|
},
|
||||||
@ -82,7 +79,6 @@ local nodes = {
|
|||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
place_param2 = 0,
|
place_param2 = 0,
|
||||||
groups = {wood = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 3},
|
groups = {wood = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 3},
|
||||||
is_ground_content = false,
|
|
||||||
tiles = {"default_wood.png^moreblocks_wood_tile_offset.png"},
|
tiles = {"default_wood.png^moreblocks_wood_tile_offset.png"},
|
||||||
sounds = sound_wood,
|
sounds = sound_wood,
|
||||||
no_stairs = true,
|
no_stairs = true,
|
||||||
@ -108,7 +104,6 @@ local nodes = {
|
|||||||
["circle_stone_bricks"] = {
|
["circle_stone_bricks"] = {
|
||||||
description = S("Circle Stone Bricks"),
|
description = S("Circle Stone Bricks"),
|
||||||
groups = {stone = 1, cracky = 3},
|
groups = {stone = 1, cracky = 3},
|
||||||
is_ground_content = false,
|
|
||||||
sounds = sound_stone,
|
sounds = sound_stone,
|
||||||
},
|
},
|
||||||
["grey_bricks"] = {
|
["grey_bricks"] = {
|
||||||
@ -116,7 +111,6 @@ local nodes = {
|
|||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
place_param2 = 0,
|
place_param2 = 0,
|
||||||
groups = {cracky = 3},
|
groups = {cracky = 3},
|
||||||
is_ground_content = false,
|
|
||||||
sounds = sound_stone,
|
sounds = sound_stone,
|
||||||
},
|
},
|
||||||
["coal_stone_bricks"] = {
|
["coal_stone_bricks"] = {
|
||||||
@ -124,7 +118,6 @@ local nodes = {
|
|||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
place_param2 = 0,
|
place_param2 = 0,
|
||||||
groups = {stone = 1, cracky = 3},
|
groups = {stone = 1, cracky = 3},
|
||||||
is_ground_content = false,
|
|
||||||
sounds = sound_stone,
|
sounds = sound_stone,
|
||||||
},
|
},
|
||||||
["iron_stone_bricks"] = {
|
["iron_stone_bricks"] = {
|
||||||
@ -132,13 +125,11 @@ local nodes = {
|
|||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
place_param2 = 0,
|
place_param2 = 0,
|
||||||
groups = {stone = 1, cracky = 3},
|
groups = {stone = 1, cracky = 3},
|
||||||
is_ground_content = false,
|
|
||||||
sounds = sound_stone,
|
sounds = sound_stone,
|
||||||
},
|
},
|
||||||
["stone_tile"] = {
|
["stone_tile"] = {
|
||||||
description = S("Stone Tile"),
|
description = S("Stone Tile"),
|
||||||
groups = {stone = 1, cracky = 3},
|
groups = {stone = 1, cracky = 3},
|
||||||
is_ground_content = false,
|
|
||||||
sounds = sound_stone,
|
sounds = sound_stone,
|
||||||
},
|
},
|
||||||
["split_stone_tile"] = {
|
["split_stone_tile"] = {
|
||||||
@ -148,37 +139,31 @@ local nodes = {
|
|||||||
tiles = {"moreblocks_split_stone_tile_top.png",
|
tiles = {"moreblocks_split_stone_tile_top.png",
|
||||||
"moreblocks_split_stone_tile.png"},
|
"moreblocks_split_stone_tile.png"},
|
||||||
groups = {stone = 1, cracky = 3},
|
groups = {stone = 1, cracky = 3},
|
||||||
is_ground_content = false,
|
|
||||||
sounds = sound_stone,
|
sounds = sound_stone,
|
||||||
},
|
},
|
||||||
["checker_stone_tile"] = {
|
["checker_stone_tile"] = {
|
||||||
description = S("Checker Stone Tile"),
|
description = S("Checker Stone Tile"),
|
||||||
groups = {stone = 1, cracky = 3},
|
groups = {stone = 1, cracky = 3},
|
||||||
is_ground_content = false,
|
|
||||||
sounds = sound_stone,
|
sounds = sound_stone,
|
||||||
},
|
},
|
||||||
["tar"] = {
|
["tar"] = {
|
||||||
description = S("Tar"),
|
description = S("Tar"),
|
||||||
groups = {cracky=2, tar_block=1},
|
groups = {cracky=2, tar_block=1},
|
||||||
is_ground_content = false,
|
|
||||||
sounds = sound_stone,
|
sounds = sound_stone,
|
||||||
},
|
},
|
||||||
["dirt_compressed"] = {
|
["dirt_compressed"] = {
|
||||||
description = S("Compressed Dirt"),
|
description = S("Compressed Dirt"),
|
||||||
groups = {crumbly=2},
|
groups = {crumbly=2, compressed = 1},
|
||||||
is_ground_content = false,
|
|
||||||
sounds = sound_dirt,
|
sounds = sound_dirt,
|
||||||
},
|
},
|
||||||
["cobble_compressed"] = {
|
["cobble_compressed"] = {
|
||||||
description = S("Compressed Cobblestone"),
|
description = S("Compressed Cobblestone"),
|
||||||
groups = {cracky = 1},
|
groups = {cracky = 1, compressed = 1},
|
||||||
is_ground_content = false,
|
|
||||||
sounds = sound_stone,
|
sounds = sound_stone,
|
||||||
},
|
},
|
||||||
["desert_cobble_compressed"] = {
|
["desert_cobble_compressed"] = {
|
||||||
description = S("Compressed Desert Cobblestone"),
|
description = S("Compressed Desert Cobblestone"),
|
||||||
groups = {cracky = 1},
|
groups = {cracky = 1, compressed = 1},
|
||||||
is_ground_content = false,
|
|
||||||
sounds = sound_stone,
|
sounds = sound_stone,
|
||||||
},
|
},
|
||||||
["plankstone"] = {
|
["plankstone"] = {
|
||||||
@ -186,7 +171,6 @@ local nodes = {
|
|||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
place_param2 = 0,
|
place_param2 = 0,
|
||||||
groups = {cracky = 3},
|
groups = {cracky = 3},
|
||||||
is_ground_content = false,
|
|
||||||
tiles = tile_tiles("plankstone"),
|
tiles = tile_tiles("plankstone"),
|
||||||
sounds = sound_stone,
|
sounds = sound_stone,
|
||||||
},
|
},
|
||||||
@ -197,7 +181,6 @@ local nodes = {
|
|||||||
use_texture_alpha = "clip",
|
use_texture_alpha = "clip",
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
is_ground_content = false,
|
|
||||||
groups = {cracky = 3, oddly_breakable_by_hand = 3},
|
groups = {cracky = 3, oddly_breakable_by_hand = 3},
|
||||||
sounds = sound_glass,
|
sounds = sound_glass,
|
||||||
},
|
},
|
||||||
@ -208,7 +191,6 @@ local nodes = {
|
|||||||
use_texture_alpha = "clip",
|
use_texture_alpha = "clip",
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
is_ground_content = false,
|
|
||||||
groups = {cracky = 3, oddly_breakable_by_hand = 3},
|
groups = {cracky = 3, oddly_breakable_by_hand = 3},
|
||||||
sounds = sound_glass,
|
sounds = sound_glass,
|
||||||
},
|
},
|
||||||
@ -219,7 +201,6 @@ local nodes = {
|
|||||||
use_texture_alpha = "clip",
|
use_texture_alpha = "clip",
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
is_ground_content = false,
|
|
||||||
groups = {cracky = 3, oddly_breakable_by_hand = 3},
|
groups = {cracky = 3, oddly_breakable_by_hand = 3},
|
||||||
sounds = sound_glass,
|
sounds = sound_glass,
|
||||||
},
|
},
|
||||||
@ -228,13 +209,11 @@ local nodes = {
|
|||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
place_param2 = 0,
|
place_param2 = 0,
|
||||||
groups = {cracky = 3},
|
groups = {cracky = 3},
|
||||||
is_ground_content = false,
|
|
||||||
sounds = sound_stone,
|
sounds = sound_stone,
|
||||||
},
|
},
|
||||||
["cactus_checker"] = {
|
["cactus_checker"] = {
|
||||||
description = S("Cactus Checker"),
|
description = S("Cactus Checker"),
|
||||||
groups = {stone = 1, cracky = 3},
|
groups = {stone = 1, cracky = 3},
|
||||||
is_ground_content = false,
|
|
||||||
tiles = {"default_stone.png^moreblocks_cactus_checker.png",
|
tiles = {"default_stone.png^moreblocks_cactus_checker.png",
|
||||||
"default_stone.png^moreblocks_cactus_checker.png",
|
"default_stone.png^moreblocks_cactus_checker.png",
|
||||||
"default_stone.png^moreblocks_cactus_checker.png",
|
"default_stone.png^moreblocks_cactus_checker.png",
|
||||||
@ -249,7 +228,6 @@ local nodes = {
|
|||||||
tiles = {"default_wood.png", "default_wood.png", "default_wood.png",
|
tiles = {"default_wood.png", "default_wood.png", "default_wood.png",
|
||||||
"default_wood.png", "moreblocks_empty_shelf.png", "moreblocks_empty_shelf.png"},
|
"default_wood.png", "moreblocks_empty_shelf.png", "moreblocks_empty_shelf.png"},
|
||||||
groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
|
groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
|
||||||
is_ground_content = false,
|
|
||||||
sounds = sound_wood,
|
sounds = sound_wood,
|
||||||
furnace_burntime = 15,
|
furnace_burntime = 15,
|
||||||
no_stairs = true,
|
no_stairs = true,
|
||||||
@ -257,13 +235,11 @@ local nodes = {
|
|||||||
["coal_stone"] = {
|
["coal_stone"] = {
|
||||||
description = S("Coal Stone"),
|
description = S("Coal Stone"),
|
||||||
groups = {stone = 1, cracky = 3},
|
groups = {stone = 1, cracky = 3},
|
||||||
is_ground_content = false,
|
|
||||||
sounds = sound_stone,
|
sounds = sound_stone,
|
||||||
},
|
},
|
||||||
["iron_stone"] = {
|
["iron_stone"] = {
|
||||||
description = S("Iron Stone"),
|
description = S("Iron Stone"),
|
||||||
groups = {stone = 1, cracky = 3},
|
groups = {stone = 1, cracky = 3},
|
||||||
is_ground_content = false,
|
|
||||||
sounds = sound_stone,
|
sounds = sound_stone,
|
||||||
},
|
},
|
||||||
["coal_checker"] = {
|
["coal_checker"] = {
|
||||||
@ -275,7 +251,6 @@ local nodes = {
|
|||||||
"default_stone.png^moreblocks_coal_checker.png^[transformR90",
|
"default_stone.png^moreblocks_coal_checker.png^[transformR90",
|
||||||
"default_stone.png^moreblocks_coal_checker.png^[transformR90"},
|
"default_stone.png^moreblocks_coal_checker.png^[transformR90"},
|
||||||
groups = {stone = 1, cracky = 3},
|
groups = {stone = 1, cracky = 3},
|
||||||
is_ground_content = false,
|
|
||||||
sounds = sound_stone,
|
sounds = sound_stone,
|
||||||
},
|
},
|
||||||
["iron_checker"] = {
|
["iron_checker"] = {
|
||||||
@ -287,7 +262,6 @@ local nodes = {
|
|||||||
"default_stone.png^moreblocks_iron_checker.png^[transformR90",
|
"default_stone.png^moreblocks_iron_checker.png^[transformR90",
|
||||||
"default_stone.png^moreblocks_iron_checker.png^[transformR90"},
|
"default_stone.png^moreblocks_iron_checker.png^[transformR90"},
|
||||||
groups = {stone = 1, cracky = 3},
|
groups = {stone = 1, cracky = 3},
|
||||||
is_ground_content = false,
|
|
||||||
sounds = sound_stone,
|
sounds = sound_stone,
|
||||||
},
|
},
|
||||||
["trap_stone"] = {
|
["trap_stone"] = {
|
||||||
@ -297,7 +271,6 @@ local nodes = {
|
|||||||
walkable = false,
|
walkable = false,
|
||||||
groups = {cracky = 3},
|
groups = {cracky = 3},
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
is_ground_content = false,
|
|
||||||
sounds = sound_stone,
|
sounds = sound_stone,
|
||||||
no_stairs = true,
|
no_stairs = true,
|
||||||
},
|
},
|
||||||
@ -308,7 +281,6 @@ local nodes = {
|
|||||||
walkable = false,
|
walkable = false,
|
||||||
groups = {cracky = 3},
|
groups = {cracky = 3},
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
is_ground_content = false,
|
|
||||||
sounds = sound_stone,
|
sounds = sound_stone,
|
||||||
no_stairs = true,
|
no_stairs = true,
|
||||||
},
|
},
|
||||||
@ -319,7 +291,6 @@ local nodes = {
|
|||||||
use_texture_alpha = "clip",
|
use_texture_alpha = "clip",
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
is_ground_content = false,
|
|
||||||
walkable = false,
|
walkable = false,
|
||||||
groups = {cracky = 3, oddly_breakable_by_hand = 3},
|
groups = {cracky = 3, oddly_breakable_by_hand = 3},
|
||||||
sounds = sound_glass,
|
sounds = sound_glass,
|
||||||
@ -332,7 +303,6 @@ local nodes = {
|
|||||||
use_texture_alpha = "clip",
|
use_texture_alpha = "clip",
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
is_ground_content = false,
|
|
||||||
walkable = false,
|
walkable = false,
|
||||||
groups = {cracky = 3, oddly_breakable_by_hand = 3},
|
groups = {cracky = 3, oddly_breakable_by_hand = 3},
|
||||||
sounds = sound_glass,
|
sounds = sound_glass,
|
||||||
@ -345,7 +315,6 @@ local nodes = {
|
|||||||
walkable = false,
|
walkable = false,
|
||||||
groups = {cracky = 1, level = 2},
|
groups = {cracky = 1, level = 2},
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
is_ground_content = false,
|
|
||||||
sounds = sound_stone,
|
sounds = sound_stone,
|
||||||
no_stairs = true,
|
no_stairs = true,
|
||||||
},
|
},
|
||||||
@ -356,7 +325,6 @@ local nodes = {
|
|||||||
use_texture_alpha = "clip",
|
use_texture_alpha = "clip",
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
is_ground_content = false,
|
|
||||||
walkable = false,
|
walkable = false,
|
||||||
groups = {cracky = 3, oddly_breakable_by_hand = 3},
|
groups = {cracky = 3, oddly_breakable_by_hand = 3},
|
||||||
sounds = sound_glass,
|
sounds = sound_glass,
|
||||||
@ -369,7 +337,6 @@ local nodes = {
|
|||||||
walkable = false,
|
walkable = false,
|
||||||
groups = {crumbly = 1, cracky = 3},
|
groups = {crumbly = 1, cracky = 3},
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
is_ground_content = false,
|
|
||||||
sounds = sound_stone,
|
sounds = sound_stone,
|
||||||
no_stairs = true,
|
no_stairs = true,
|
||||||
},
|
},
|
||||||
@ -415,7 +382,6 @@ local nodes = {
|
|||||||
use_texture_alpha = "clip",
|
use_texture_alpha = "clip",
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
is_ground_content = false,
|
|
||||||
light_source = 11,
|
light_source = 11,
|
||||||
groups = {cracky = 3, oddly_breakable_by_hand = 3},
|
groups = {cracky = 3, oddly_breakable_by_hand = 3},
|
||||||
sounds = sound_glass,
|
sounds = sound_glass,
|
||||||
@ -427,7 +393,6 @@ local nodes = {
|
|||||||
use_texture_alpha = "clip",
|
use_texture_alpha = "clip",
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
is_ground_content = false,
|
|
||||||
light_source = 11,
|
light_source = 11,
|
||||||
groups = {cracky = 3, oddly_breakable_by_hand = 3},
|
groups = {cracky = 3, oddly_breakable_by_hand = 3},
|
||||||
sounds = sound_glass,
|
sounds = sound_glass,
|
||||||
@ -439,7 +404,6 @@ local nodes = {
|
|||||||
use_texture_alpha = "clip",
|
use_texture_alpha = "clip",
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
is_ground_content = false,
|
|
||||||
light_source = 11,
|
light_source = 11,
|
||||||
walkable = false,
|
walkable = false,
|
||||||
groups = {cracky = 3, oddly_breakable_by_hand = 3},
|
groups = {cracky = 3, oddly_breakable_by_hand = 3},
|
||||||
@ -453,7 +417,6 @@ local nodes = {
|
|||||||
use_texture_alpha = "clip",
|
use_texture_alpha = "clip",
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
is_ground_content = false,
|
|
||||||
light_source = 11,
|
light_source = 11,
|
||||||
walkable = false,
|
walkable = false,
|
||||||
groups = {cracky = 3, oddly_breakable_by_hand = 3},
|
groups = {cracky = 3, oddly_breakable_by_hand = 3},
|
||||||
@ -467,7 +430,6 @@ local nodes = {
|
|||||||
use_texture_alpha = "clip",
|
use_texture_alpha = "clip",
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
is_ground_content = false,
|
|
||||||
light_source = default.LIGHT_MAX,
|
light_source = default.LIGHT_MAX,
|
||||||
groups = {cracky = 3, oddly_breakable_by_hand = 3},
|
groups = {cracky = 3, oddly_breakable_by_hand = 3},
|
||||||
sounds = sound_glass,
|
sounds = sound_glass,
|
||||||
@ -479,7 +441,6 @@ local nodes = {
|
|||||||
use_texture_alpha = "clip",
|
use_texture_alpha = "clip",
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
is_ground_content = false,
|
|
||||||
light_source = default.LIGHT_MAX,
|
light_source = default.LIGHT_MAX,
|
||||||
groups = {cracky = 3, oddly_breakable_by_hand = 3},
|
groups = {cracky = 3, oddly_breakable_by_hand = 3},
|
||||||
sounds = sound_glass,
|
sounds = sound_glass,
|
||||||
@ -491,7 +452,6 @@ local nodes = {
|
|||||||
use_texture_alpha = "clip",
|
use_texture_alpha = "clip",
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
is_ground_content = false,
|
|
||||||
light_source = default.LIGHT_MAX,
|
light_source = default.LIGHT_MAX,
|
||||||
walkable = false,
|
walkable = false,
|
||||||
groups = {cracky = 3, oddly_breakable_by_hand = 3},
|
groups = {cracky = 3, oddly_breakable_by_hand = 3},
|
||||||
@ -505,7 +465,6 @@ local nodes = {
|
|||||||
use_texture_alpha = "clip",
|
use_texture_alpha = "clip",
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
is_ground_content = false,
|
|
||||||
light_source = default.LIGHT_MAX,
|
light_source = default.LIGHT_MAX,
|
||||||
walkable = false,
|
walkable = false,
|
||||||
groups = {cracky = 3, oddly_breakable_by_hand = 3},
|
groups = {cracky = 3, oddly_breakable_by_hand = 3},
|
||||||
@ -519,7 +478,6 @@ local nodes = {
|
|||||||
wield_image = "moreblocks_rope.png",
|
wield_image = "moreblocks_rope.png",
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
is_ground_content = false,
|
|
||||||
paramtype2 = "wallmounted",
|
paramtype2 = "wallmounted",
|
||||||
walkable = false,
|
walkable = false,
|
||||||
climbable = true,
|
climbable = true,
|
||||||
@ -531,27 +489,40 @@ local nodes = {
|
|||||||
["copperpatina"] = {
|
["copperpatina"] = {
|
||||||
description = S("Copper Patina Block"),
|
description = S("Copper Patina Block"),
|
||||||
groups = {cracky = 1, level = 2},
|
groups = {cracky = 1, level = 2},
|
||||||
is_ground_content = false,
|
|
||||||
sounds = sound_metal,
|
sounds = sound_metal,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for name, def in pairs(nodes) do
|
for name, def in pairs(nodes) do
|
||||||
|
def.is_ground_content = def.is_ground_content == true
|
||||||
def.tiles = def.tiles or {"moreblocks_" ..name.. ".png"}
|
def.tiles = def.tiles or {"moreblocks_" ..name.. ".png"}
|
||||||
|
|
||||||
|
local burntime = def.furnace_burntime
|
||||||
|
def.furnace_burntime = nil -- deprecated node def field
|
||||||
|
|
||||||
minetest.register_node("moreblocks:" ..name, def)
|
minetest.register_node("moreblocks:" ..name, def)
|
||||||
minetest.register_alias(name, "moreblocks:" ..name)
|
minetest.register_alias(name, "moreblocks:" ..name)
|
||||||
|
|
||||||
def_copy = table.copy(def)
|
-- Optional: register the node as fuel
|
||||||
|
if burntime then
|
||||||
|
core.register_craft({
|
||||||
|
type = "fuel",
|
||||||
|
recipe = "moreblocks:" .. name,
|
||||||
|
burntime = burntime,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
local tiles = def.tiles
|
||||||
|
|
||||||
-- Use the primary tile for all sides of cut glasslike nodes.
|
-- Use the primary tile for all sides of cut glasslike nodes.
|
||||||
-- This makes them easier to see
|
-- This makes them easier to see
|
||||||
if
|
if
|
||||||
#def_copy.tiles > 1 and
|
#tiles > 1 and
|
||||||
def_copy.drawtype and
|
def.drawtype and
|
||||||
def_copy.drawtype == "glasslike_framed" or
|
def.drawtype == "glasslike_framed" or
|
||||||
def_copy.drawtype == "glasslike_framed_optional"
|
def.drawtype == "glasslike_framed_optional"
|
||||||
then
|
then
|
||||||
def.tiles = {def_copy.tiles[1]}
|
tiles = {def.tiles[1]}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@ -561,7 +532,7 @@ for name, def in pairs(nodes) do
|
|||||||
stairsplus:register_all("moreblocks", name, "moreblocks:" ..name, {
|
stairsplus:register_all("moreblocks", name, "moreblocks:" ..name, {
|
||||||
description = def.description,
|
description = def.description,
|
||||||
groups = groups,
|
groups = groups,
|
||||||
tiles = def.tiles,
|
tiles = tiles,
|
||||||
sunlight_propagates = def.sunlight_propagates,
|
sunlight_propagates = def.sunlight_propagates,
|
||||||
light_source = def.light_source,
|
light_source = def.light_source,
|
||||||
sounds = def.sounds,
|
sounds = def.sounds,
|
||||||
|
94
redefinitions.lua
Normal file
94
redefinitions.lua
Normal file
@ -0,0 +1,94 @@
|
|||||||
|
--[[
|
||||||
|
More Blocks: redefinitions of default stuff
|
||||||
|
|
||||||
|
Copyright © 2011-2020 Hugo Locurcio and contributors.
|
||||||
|
Licensed under the zlib license. See LICENSE.md for more information.
|
||||||
|
--]]
|
||||||
|
|
||||||
|
local modname = minetest.get_current_modname()
|
||||||
|
|
||||||
|
-- Redefine some of the default crafting recipes to be more productive
|
||||||
|
|
||||||
|
-- Auxiliary function: take a recipe as returned by get_all_craft_recipes
|
||||||
|
-- and turn it into a table that can be used to clear a craft or declare a new one
|
||||||
|
local reconstruct_internal_craft = function(recipe)
|
||||||
|
local recp = {
|
||||||
|
{ "", "", "" },
|
||||||
|
{ "", "", "" },
|
||||||
|
{ "", "", "" },
|
||||||
|
}
|
||||||
|
local width = recipe.width
|
||||||
|
for idx, item in pairs(recipe.items) do
|
||||||
|
local row = math.ceil(idx / width)
|
||||||
|
local col = idx - (row-1)*width
|
||||||
|
recp[row][col] = item
|
||||||
|
end
|
||||||
|
return recp
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Change the amount produced by recipe by apply func to the old amount
|
||||||
|
local change_recipe_amount = function(product, recipe, func)
|
||||||
|
-- if width == 0, this is a shapeless recipe, for which the
|
||||||
|
-- internal and Lua API recipe table is the same.
|
||||||
|
-- Otherwise we need to reconstruct the table for the shaped recipe.
|
||||||
|
local shapeless = (recipe.width == 0)
|
||||||
|
local recp = shapeless and recipe.items or reconstruct_internal_craft(recipe)
|
||||||
|
|
||||||
|
local oldamount = tonumber(recipe.output:match(" [0-9]+$") or "1")
|
||||||
|
|
||||||
|
local newamount = func(oldamount)
|
||||||
|
|
||||||
|
-- remove old crafting recipe
|
||||||
|
local redo = { recipe = recp }
|
||||||
|
-- preserve shapelessness
|
||||||
|
if shapeless then
|
||||||
|
redo.type = "shapeless"
|
||||||
|
end
|
||||||
|
minetest.clear_craft(redo)
|
||||||
|
|
||||||
|
-- new output
|
||||||
|
redo.output = ("%s %d"):format(product, newamount)
|
||||||
|
minetest.register_craft(redo)
|
||||||
|
|
||||||
|
minetest.log("action", ("[MOD]%s: recipe for %s production: %d => %d"):format(modname, product, oldamount, newamount))
|
||||||
|
end
|
||||||
|
|
||||||
|
local increase_craft_production = function(product, func)
|
||||||
|
local recipes = minetest.get_all_craft_recipes(product)
|
||||||
|
for _, r in pairs(recipes) do
|
||||||
|
if r.type == "normal" or r.method == "normal" then
|
||||||
|
change_recipe_amount(product, r, func)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Increase the crafting production according to the rules from the table, which is in the form:
|
||||||
|
-- {
|
||||||
|
-- { detector, amount changing function }
|
||||||
|
-- { detector, amount changing function }
|
||||||
|
-- }
|
||||||
|
-- TODO: consider exporting this function to other mods
|
||||||
|
local increase_craft_production_table = function(map_table)
|
||||||
|
for product, _ in pairs(minetest.registered_items) do
|
||||||
|
for _, tab in pairs(map_table) do
|
||||||
|
local detector = tab[1]
|
||||||
|
local func = tab[2]
|
||||||
|
if detector(product) then
|
||||||
|
increase_craft_production(product, func)
|
||||||
|
-- only apply one boost
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
increase_craft_production_table({
|
||||||
|
{ function(n) return n:match('^default:sign_wall') end, function(old) return old + 1 end },
|
||||||
|
{ function(n) return n == 'default:paper' end, function(old) return old*4 end },
|
||||||
|
{ function(n) return n:match('^carts:.*rail$') or n:match('^default:.*rail$') end, function(old) return old + old/2 end },
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
type = "toolrepair",
|
||||||
|
additional_wear = -0.10, -- Tool repair buff (10% bonus instead of 2%).
|
||||||
|
})
|
@ -49,8 +49,6 @@ stairsplus.rotate_node_aux = function(itemstack, placer, pointed_thing)
|
|||||||
local under = pointed_thing.under
|
local under = pointed_thing.under
|
||||||
local under_node = minetest.get_node(under)
|
local under_node = minetest.get_node(under)
|
||||||
local under_prefix = under_node and name_to_category(under_node.name)
|
local under_prefix = under_node and name_to_category(under_node.name)
|
||||||
-- NALC Addition to avoid coloredwood/unifiedbricks crash by Sys4
|
|
||||||
local under_pmod = string.sub(under_node.name, 1, (string.find(under_node.name, ":") or 0)-1)
|
|
||||||
|
|
||||||
local same_cat = item_prefix == under_prefix
|
local same_cat = item_prefix == under_prefix
|
||||||
|
|
||||||
@ -67,9 +65,11 @@ stairsplus.rotate_node_aux = function(itemstack, placer, pointed_thing)
|
|||||||
-- under node has a non-standard shape, so use the distance between under and above
|
-- under node has a non-standard shape, so use the distance between under and above
|
||||||
local wallmounted = minetest.dir_to_wallmounted(vector.subtract(pointed_thing.above, under))
|
local wallmounted = minetest.dir_to_wallmounted(vector.subtract(pointed_thing.above, under))
|
||||||
|
|
||||||
if same_cat and (under_pmod ~= "coloredwood" and under_pmod ~= "unifiedbricks")
|
if same_cat and not aux then
|
||||||
and not aux then
|
-- param2 can be in the range [0, 31]. We assume that the stair nodes use the
|
||||||
p2 = under_node.param2
|
-- drawtype "facedir". Wrap the value like done in Luanti `src/mapnode.cpp`.
|
||||||
|
p2 = under_node.param2 % 24
|
||||||
|
|
||||||
-- flip if placing above or below an upright or upside-down node
|
-- flip if placing above or below an upright or upside-down node
|
||||||
-- TODO should we also flip when placing next to a side-mounted node?
|
-- TODO should we also flip when placing next to a side-mounted node?
|
||||||
if wallmounted < 2 then
|
if wallmounted < 2 then
|
||||||
@ -136,6 +136,7 @@ stairsplus.register_single = function(category, alternate, info, modname, subnam
|
|||||||
def[k] = v
|
def[k] = v
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def.is_ground_content = def.is_ground_content == true
|
||||||
def.drawtype = "nodebox"
|
def.drawtype = "nodebox"
|
||||||
def.paramtype = "light"
|
def.paramtype = "light"
|
||||||
def.paramtype2 = def.paramtype2 or "facedir"
|
def.paramtype2 = def.paramtype2 or "facedir"
|
||||||
@ -148,11 +149,14 @@ stairsplus.register_single = function(category, alternate, info, modname, subnam
|
|||||||
|
|
||||||
-- Darken light sources slightly to make up for their smaller visual size
|
-- Darken light sources slightly to make up for their smaller visual size
|
||||||
def.light_source = math.max(0, (def.light_source or 0) - 1)
|
def.light_source = math.max(0, (def.light_source or 0) - 1)
|
||||||
|
|
||||||
def.on_place = stairsplus.rotate_node_aux
|
|
||||||
def.groups = stairsplus:prepare_groups(fields.groups)
|
def.groups = stairsplus:prepare_groups(fields.groups)
|
||||||
|
|
||||||
if category == "slab" then
|
if category == "slab" then
|
||||||
|
if minetest.global_exists("place_rotated") then
|
||||||
|
def.on_place = place_rotated.slab
|
||||||
|
else
|
||||||
|
def.on_place = stairsplus.rotate_node_aux
|
||||||
|
end
|
||||||
if type(info) ~= "table" then
|
if type(info) ~= "table" then
|
||||||
def.node_box = {
|
def.node_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
@ -167,6 +171,7 @@ stairsplus.register_single = function(category, alternate, info, modname, subnam
|
|||||||
def.description = desc_base .. alternate:gsub("_", " "):gsub("(%a)(%S*)", function(a, b) return a:upper() .. b end)
|
def.description = desc_base .. alternate:gsub("_", " "):gsub("(%a)(%S*)", function(a, b) return a:upper() .. b end)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
def.on_place = stairsplus.rotate_node_aux
|
||||||
def.description = desc_base
|
def.description = desc_base
|
||||||
if category == "slope" then
|
if category == "slope" then
|
||||||
def.drawtype = "mesh"
|
def.drawtype = "mesh"
|
||||||
@ -175,7 +180,7 @@ stairsplus.register_single = function(category, alternate, info, modname, subnam
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if fields.drop and not (type(fields.drop) == "table") then
|
if fields.drop and (type(fields.drop) ~= "table") then
|
||||||
def.drop = modname.. ":" .. category .. "_" .. fields.drop .. alternate
|
def.drop = modname.. ":" .. category .. "_" .. fields.drop .. alternate
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -94,4 +94,5 @@ function stairsplus:register_custom_subset(subset, modname, subname, recipeitem,
|
|||||||
end
|
end
|
||||||
|
|
||||||
circular_saw.known_nodes[recipeitem] = {modname, subname}
|
circular_saw.known_nodes[recipeitem] = {modname, subname}
|
||||||
|
circular_saw.microblocks[modname.. ":micro_" .. subname] = recipeitem
|
||||||
end
|
end
|
||||||
|
@ -40,4 +40,5 @@ function stairsplus:register_micro(modname, subname, recipeitem, fields)
|
|||||||
end
|
end
|
||||||
|
|
||||||
circular_saw.known_nodes[recipeitem] = {modname, subname}
|
circular_saw.known_nodes[recipeitem] = {modname, subname}
|
||||||
|
circular_saw.microblocks[modname.. ":micro_" .. subname] = recipeitem
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user