mirror of
https://github.com/minetest-mods/moreblocks.git
synced 2025-04-20 19:00:32 +02:00
Add place_rotated mod support (#208)
Co-authored-by: Evgeniy <evgenuel@gmail.com>
This commit is contained in:
parent
768225a990
commit
7f02b444dc
@ -31,4 +31,5 @@ read_globals = {
|
|||||||
"HasOwner",
|
"HasOwner",
|
||||||
"getLastOwner",
|
"getLastOwner",
|
||||||
"GetNodeOwnerName",
|
"GetNodeOwnerName",
|
||||||
|
"place_rotated",
|
||||||
}
|
}
|
||||||
|
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
|
||||||
|
@ -146,11 +146,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",
|
||||||
@ -165,6 +168,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"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user