mirror of
https://github.com/minetest-mods/moreblocks.git
synced 2025-07-15 22:30:46 +02:00
Compare commits
9 Commits
v2.1.0
...
b93949c266
Author | SHA1 | Date | |
---|---|---|---|
b93949c266 | |||
04810e1f83 | |||
e91b0ea1a0 | |||
72ef8deeae | |||
710b90972b | |||
aa3dcd5878 | |||
94247a6449 | |||
e7547d57ba | |||
c13321142b |
@ -1,8 +1,7 @@
|
|||||||
repos:
|
repos:
|
||||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
rev: v3.3.0
|
rev: v2.3.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: fix-byte-order-marker
|
|
||||||
- id: end-of-file-fixer
|
- id: end-of-file-fixer
|
||||||
- id: trailing-whitespace
|
- id: trailing-whitespace
|
||||||
|
|
||||||
|
34
CHANGELOG.md
34
CHANGELOG.md
@ -7,32 +7,19 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
## [2.1.0] - 2020-12-14
|
|
||||||
|
|
||||||
### Added
|
|
||||||
|
|
||||||
- Clean Glass versions of Trap and (Super) Glowing Glass.
|
|
||||||
- Compressed desert cobblestone.
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- Revised placing strategy that takes into account which side of the face
|
|
||||||
(top/bottom for horizontal, left/right for vertical placement) is being clicked.
|
|
||||||
Aux (sprint/special, default E) key can be used to place the node with the orientation
|
|
||||||
it would have if placed from the other side.
|
|
||||||
When placing nodes next to nodes of the same gategory (e.g.slab to slab) the other
|
|
||||||
node's orientation is copied, flipping it placing on top or below an upright or
|
|
||||||
upside-down node. In this case the aux key will disable the special processing of
|
|
||||||
same-category nodes.
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
|
|
||||||
- Revised minetest_game crafting recipe overrides to match Minetest 5.0.0 and later.
|
|
||||||
|
|
||||||
### Removed
|
### Removed
|
||||||
|
|
||||||
- Legacy Stairs+ conversion code.
|
- Legacy Stairs+ conversion code.
|
||||||
- It was only required to import worlds last edited before Q3 2013.
|
- It was only required to import worlds last edited before Q3 2013.
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Switch to GitHub Actions.
|
||||||
|
- Benefits include faster responses.
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Compressed desert cobblestone.
|
||||||
|
|
||||||
## [2.0.0] - 2019-11-25
|
## [2.0.0] - 2019-11-25
|
||||||
|
|
||||||
@ -117,8 +104,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|||||||
|
|
||||||
- Initial versioned release.
|
- Initial versioned release.
|
||||||
|
|
||||||
[Unreleased]: https://github.com/minetest-mods/moreblocks/compare/v2.1.0...HEAD
|
[Unreleased]: https://github.com/minetest-mods/moreblocks/compare/v2.0.0...HEAD
|
||||||
[2.1.0]: https://github.com/minetest-mods/moreblocks/compare/v2.0.0...v2.1.0
|
|
||||||
[2.0.0]: https://github.com/minetest-mods/moreblocks/compare/v1.3.0...v2.0.0
|
[2.0.0]: https://github.com/minetest-mods/moreblocks/compare/v1.3.0...v2.0.0
|
||||||
[1.3.0]: https://github.com/minetest-mods/moreblocks/compare/v1.2.0...v1.3.0
|
[1.3.0]: https://github.com/minetest-mods/moreblocks/compare/v1.2.0...v1.3.0
|
||||||
[1.2.0]: https://github.com/minetest-mods/moreblocks/compare/v1.1.0...v1.2.0
|
[1.2.0]: https://github.com/minetest-mods/moreblocks/compare/v1.1.0...v1.2.0
|
||||||
|
@ -58,7 +58,7 @@ on that line.
|
|||||||
|
|
||||||
## Version compatibility
|
## Version compatibility
|
||||||
|
|
||||||
More Blocks is currently primarily tested with Minetest 5.3.0.
|
More Blocks is currently primarily tested with Minetest 5.1.0.
|
||||||
It may or may not work with newer or older versions. Issues arising in older
|
It may or may not work with newer or older versions. Issues arising in older
|
||||||
versions than 5.0.0 will generally not be fixed.
|
versions than 5.0.0 will generally not be fixed.
|
||||||
|
|
||||||
|
88
crafting.lua
88
crafting.lua
@ -348,36 +348,12 @@ minetest.register_craft({
|
|||||||
recipe = {"moreblocks:sweeper", "default:glass"},
|
recipe = {"moreblocks:sweeper", "default:glass"},
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
|
||||||
output = "moreblocks:trap_clean_glass",
|
|
||||||
type = "shapeless",
|
|
||||||
recipe = {"default:mese_crystal_fragment", "moreblocks:clean_glass"},
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_craft({
|
|
||||||
output = "moreblocks:trap_clean_glass",
|
|
||||||
type = "shapeless",
|
|
||||||
recipe = {"moreblocks:sweeper", "moreblocks:trap_glass"},
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "moreblocks:glow_glass",
|
output = "moreblocks:glow_glass",
|
||||||
type = "shapeless",
|
type = "shapeless",
|
||||||
recipe = {"default:torch", "default:glass"},
|
recipe = {"default:torch", "default:glass"},
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
|
||||||
output = "moreblocks:clean_glow_glass",
|
|
||||||
type = "shapeless",
|
|
||||||
recipe = {"default:torch", "moreblocks:clean_glass"},
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_craft({
|
|
||||||
output = "moreblocks:clean_glow_glass",
|
|
||||||
type = "shapeless",
|
|
||||||
recipe = {"moreblocks:sweeper", "moreblocks:glow_glass"},
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "moreblocks:trap_glow_glass",
|
output = "moreblocks:trap_glow_glass",
|
||||||
type = "shapeless",
|
type = "shapeless",
|
||||||
@ -390,26 +366,6 @@ minetest.register_craft({
|
|||||||
recipe = {"default:mese_crystal_fragment", "moreblocks:glow_glass"},
|
recipe = {"default:mese_crystal_fragment", "moreblocks:glow_glass"},
|
||||||
})
|
})
|
||||||
|
|
||||||
-- several recipes are possible for the trap+clean+glow, we only present 3 of them
|
|
||||||
minetest.register_craft({
|
|
||||||
output = "moreblocks:trap_clean_glow_glass",
|
|
||||||
type = "shapeless",
|
|
||||||
recipe = {"default:mese_crystal_fragment", "moreblocks:clean_glow_glass"},
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_craft({
|
|
||||||
output = "moreblocks:trap_clean_glow_glass",
|
|
||||||
type = "shapeless",
|
|
||||||
recipe = {"default:mese_crystal_fragment", "moreblocks:clean_glass", "default:torch"},
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_craft({
|
|
||||||
output = "moreblocks:trap_clean_glow_glass",
|
|
||||||
type = "shapeless",
|
|
||||||
recipe = {"moreblocks:sweeper", "moreblocks:trap_glow_glass" },
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "moreblocks:super_glow_glass",
|
output = "moreblocks:super_glow_glass",
|
||||||
type = "shapeless",
|
type = "shapeless",
|
||||||
@ -422,24 +378,6 @@ minetest.register_craft({
|
|||||||
recipe = {"default:torch", "moreblocks:glow_glass"},
|
recipe = {"default:torch", "moreblocks:glow_glass"},
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
|
||||||
output = "moreblocks:clean_super_glow_glass",
|
|
||||||
type = "shapeless",
|
|
||||||
recipe = {"default:torch", "default:torch", "moreblocks:clean_glass"},
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_craft({
|
|
||||||
output = "moreblocks:clean_super_glow_glass",
|
|
||||||
type = "shapeless",
|
|
||||||
recipe = {"default:torch", "moreblocks:clean_glow_glass"},
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_craft({
|
|
||||||
output = "moreblocks:clean_super_glow_glass",
|
|
||||||
type = "shapeless",
|
|
||||||
recipe = {"moreblocks:sweeper", "moreblocks:super_glow_glass"},
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "moreblocks:trap_super_glow_glass",
|
output = "moreblocks:trap_super_glow_glass",
|
||||||
@ -453,32 +391,6 @@ minetest.register_craft({
|
|||||||
recipe = {"default:mese_crystal_fragment", "moreblocks:super_glow_glass"},
|
recipe = {"default:mese_crystal_fragment", "moreblocks:super_glow_glass"},
|
||||||
})
|
})
|
||||||
|
|
||||||
-- several recipes are possible for the trap+clean+glow, we only present 4 of them
|
|
||||||
minetest.register_craft({
|
|
||||||
output = "moreblocks:trap_clean_super_glow_glass",
|
|
||||||
type = "shapeless",
|
|
||||||
recipe = {"default:mese_crystal_fragment", "moreblocks:clean_super_glow_glass"},
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_craft({
|
|
||||||
output = "moreblocks:trap_clean_super_glow_glass",
|
|
||||||
type = "shapeless",
|
|
||||||
recipe = {"default:mese_crystal_fragment", "moreblocks:clean_glow_glass", "default:torch"},
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_craft({
|
|
||||||
output = "moreblocks:trap_clean_super_glow_glass",
|
|
||||||
type = "shapeless",
|
|
||||||
recipe = {"default:mese_crystal_fragment", "moreblocks:clean_glass", "default:torch", "default:torch"},
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_craft({
|
|
||||||
output = "moreblocks:trap_clean_super_glow_glass",
|
|
||||||
type = "shapeless",
|
|
||||||
recipe = {"moreblocks:sweeper", "moreblocks:trap_super_glow_glass" },
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "moreblocks:coal_stone",
|
output = "moreblocks:coal_stone",
|
||||||
type = "shapeless",
|
type = "shapeless",
|
||||||
|
3
init.lua
3
init.lua
@ -20,6 +20,7 @@ dofile(modpath .. "/config.lua")
|
|||||||
dofile(modpath .. "/circular_saw.lua")
|
dofile(modpath .. "/circular_saw.lua")
|
||||||
dofile(modpath .. "/stairsplus/init.lua")
|
dofile(modpath .. "/stairsplus/init.lua")
|
||||||
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")
|
||||||
|
|
||||||
|
minetest.log("action", "[moreblocks] loaded.")
|
||||||
|
65
nodes.lua
65
nodes.lua
@ -349,19 +349,6 @@ local nodes = {
|
|||||||
sounds = sound_stone,
|
sounds = sound_stone,
|
||||||
no_stairs = true,
|
no_stairs = true,
|
||||||
},
|
},
|
||||||
["trap_clean_glass"] = {
|
|
||||||
description = S("Trap Clean Glass"),
|
|
||||||
drawtype = "glasslike_framed_optional",
|
|
||||||
tiles = {"moreblocks_clean_glass.png^moreblocks_trap_box_glass.png", "moreblocks_clean_glass_detail.png"},
|
|
||||||
use_texture_alpha = true,
|
|
||||||
paramtype = "light",
|
|
||||||
sunlight_propagates = true,
|
|
||||||
is_ground_content = false,
|
|
||||||
walkable = false,
|
|
||||||
groups = {cracky = 3, oddly_breakable_by_hand = 3},
|
|
||||||
sounds = sound_glass,
|
|
||||||
no_stairs = true,
|
|
||||||
},
|
|
||||||
["trap_sandstone"] = {
|
["trap_sandstone"] = {
|
||||||
description = S("Trap Sandstone"),
|
description = S("Trap Sandstone"),
|
||||||
drawtype = "glasslike_framed",
|
drawtype = "glasslike_framed",
|
||||||
@ -420,18 +407,6 @@ local nodes = {
|
|||||||
groups = {cracky = 3, oddly_breakable_by_hand = 3},
|
groups = {cracky = 3, oddly_breakable_by_hand = 3},
|
||||||
sounds = sound_glass,
|
sounds = sound_glass,
|
||||||
},
|
},
|
||||||
["clean_glow_glass"] = {
|
|
||||||
description = S("Clean Glow Glass"),
|
|
||||||
drawtype = "glasslike_framed_optional",
|
|
||||||
tiles = {"moreblocks_clean_glass.png^[colorize:#E9CD61", "moreblocks_clean_glass_detail.png^[colorize:#E9CD61"},
|
|
||||||
use_texture_alpha = true,
|
|
||||||
paramtype = "light",
|
|
||||||
sunlight_propagates = true,
|
|
||||||
is_ground_content = false,
|
|
||||||
light_source = 11,
|
|
||||||
groups = {cracky = 3, oddly_breakable_by_hand = 3},
|
|
||||||
sounds = sound_glass,
|
|
||||||
},
|
|
||||||
["trap_glow_glass"] = {
|
["trap_glow_glass"] = {
|
||||||
description = S("Trap Glow Glass"),
|
description = S("Trap Glow Glass"),
|
||||||
drawtype = "glasslike_framed_optional",
|
drawtype = "glasslike_framed_optional",
|
||||||
@ -446,20 +421,6 @@ local nodes = {
|
|||||||
sounds = sound_glass,
|
sounds = sound_glass,
|
||||||
no_stairs = true,
|
no_stairs = true,
|
||||||
},
|
},
|
||||||
["trap_clean_glow_glass"] = {
|
|
||||||
description = S("Trap Clean Glow Glass"),
|
|
||||||
drawtype = "glasslike_framed_optional",
|
|
||||||
tiles = {"moreblocks_clean_glass.png^[colorize:#E9CD61^moreblocks_trap_box_glass.png", "moreblocks_clean_glass_detail.png^[colorize:#E9CD61"},
|
|
||||||
use_texture_alpha = true,
|
|
||||||
paramtype = "light",
|
|
||||||
sunlight_propagates = true,
|
|
||||||
is_ground_content = false,
|
|
||||||
light_source = 11,
|
|
||||||
walkable = false,
|
|
||||||
groups = {cracky = 3, oddly_breakable_by_hand = 3},
|
|
||||||
sounds = sound_glass,
|
|
||||||
no_stairs = true,
|
|
||||||
},
|
|
||||||
["super_glow_glass"] = {
|
["super_glow_glass"] = {
|
||||||
description = S("Super Glow Glass"),
|
description = S("Super Glow Glass"),
|
||||||
drawtype = "glasslike_framed_optional",
|
drawtype = "glasslike_framed_optional",
|
||||||
@ -472,18 +433,6 @@ local nodes = {
|
|||||||
groups = {cracky = 3, oddly_breakable_by_hand = 3},
|
groups = {cracky = 3, oddly_breakable_by_hand = 3},
|
||||||
sounds = sound_glass,
|
sounds = sound_glass,
|
||||||
},
|
},
|
||||||
["clean_super_glow_glass"] = {
|
|
||||||
description = S("Clean Super Glow Glass"),
|
|
||||||
drawtype = "glasslike_framed_optional",
|
|
||||||
tiles = {"moreblocks_clean_glass.png^[colorize:#FFFF78", "moreblocks_clean_glass_detail.png^[colorize:#FFFF78"},
|
|
||||||
use_texture_alpha = true,
|
|
||||||
paramtype = "light",
|
|
||||||
sunlight_propagates = true,
|
|
||||||
is_ground_content = false,
|
|
||||||
light_source = default.LIGHT_MAX,
|
|
||||||
groups = {cracky = 3, oddly_breakable_by_hand = 3},
|
|
||||||
sounds = sound_glass,
|
|
||||||
},
|
|
||||||
["trap_super_glow_glass"] = {
|
["trap_super_glow_glass"] = {
|
||||||
description = S("Trap Super Glow Glass"),
|
description = S("Trap Super Glow Glass"),
|
||||||
drawtype = "glasslike_framed_optional",
|
drawtype = "glasslike_framed_optional",
|
||||||
@ -498,20 +447,6 @@ local nodes = {
|
|||||||
sounds = sound_glass,
|
sounds = sound_glass,
|
||||||
no_stairs = true,
|
no_stairs = true,
|
||||||
},
|
},
|
||||||
["trap_clean_super_glow_glass"] = {
|
|
||||||
description = S("Trap Clean Super Glow Glass"),
|
|
||||||
drawtype = "glasslike_framed_optional",
|
|
||||||
tiles = {"moreblocks_clean_glass.png^[colorize:#FFFF78^moreblocks_trap_box_glass.png", "moreblocks_clean_glass_detail.png^[colorize:#FFFF78"},
|
|
||||||
use_texture_alpha = true,
|
|
||||||
paramtype = "light",
|
|
||||||
sunlight_propagates = true,
|
|
||||||
is_ground_content = false,
|
|
||||||
light_source = default.LIGHT_MAX,
|
|
||||||
walkable = false,
|
|
||||||
groups = {cracky = 3, oddly_breakable_by_hand = 3},
|
|
||||||
sounds = sound_glass,
|
|
||||||
no_stairs = true,
|
|
||||||
},
|
|
||||||
["rope"] = {
|
["rope"] = {
|
||||||
description = S("Rope"),
|
description = S("Rope"),
|
||||||
drawtype = "signlike",
|
drawtype = "signlike",
|
||||||
|
@ -1,71 +0,0 @@
|
|||||||
--[[
|
|
||||||
More Blocks: redefinitions of default stuff
|
|
||||||
|
|
||||||
Copyright © 2011-2020 Hugo Locurcio and contributors.
|
|
||||||
Licensed under the zlib license. See LICENSE.md for more information.
|
|
||||||
--]]
|
|
||||||
|
|
||||||
-- Redefinitions of some default crafting recipes:
|
|
||||||
|
|
||||||
-- Signs: +1
|
|
||||||
minetest.clear_craft({
|
|
||||||
recipe = {
|
|
||||||
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
|
|
||||||
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
|
|
||||||
{'', 'group:stick', ''},
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.clear_craft({
|
|
||||||
recipe = {
|
|
||||||
{'group:wood', 'group:wood', 'group:wood'},
|
|
||||||
{'group:wood', 'group:wood', 'group:wood'},
|
|
||||||
{'', 'group:stick', ''},
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_craft({
|
|
||||||
output = 'default:sign_wall_steel 4',
|
|
||||||
recipe = {
|
|
||||||
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
|
|
||||||
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
|
|
||||||
{'', 'group:stick', ''},
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_craft({
|
|
||||||
output = 'default:sign_wall_wood 4',
|
|
||||||
recipe = {
|
|
||||||
{'group:wood', 'group:wood', 'group:wood'},
|
|
||||||
{'group:wood', 'group:wood', 'group:wood'},
|
|
||||||
{'', 'group:stick', ''},
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
minetest.clear_craft({
|
|
||||||
recipe = {
|
|
||||||
{"default:papyrus", "default:papyrus", "default:papyrus"}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
minetest.register_craft({
|
|
||||||
output = "default:paper 4",
|
|
||||||
recipe = {
|
|
||||||
{"default:papyrus", "default:papyrus", "default:papyrus"},
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
minetest.register_craft({
|
|
||||||
output = "default:rail 24",
|
|
||||||
recipe = {
|
|
||||||
{"default:steel_ingot", "", "default:steel_ingot"},
|
|
||||||
{"default:steel_ingot", "default:stick", "default:steel_ingot"},
|
|
||||||
{"default:steel_ingot", "", "default:steel_ingot"},
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_craft({
|
|
||||||
type = "toolrepair",
|
|
||||||
additional_wear = -0.10, -- Tool repair buff (10% bonus instead of 2%).
|
|
||||||
})
|
|
@ -15,97 +15,6 @@ local descriptions = {
|
|||||||
["stair"] = S("%s Stairs"),
|
["stair"] = S("%s Stairs"),
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Extends the standad rotate_node placement so that it takes into account
|
|
||||||
-- the side (top/bottom or left/right) of the face being pointed at.
|
|
||||||
-- As with the standard rotate_node, sneak can be used to force the perpendicular
|
|
||||||
-- placement (wall placement on floor/ceiling, floor/ceiling placement on walls).
|
|
||||||
-- Additionally, the aux / sprint / special key can be used to place the node
|
|
||||||
-- as if from the opposite side.
|
|
||||||
--
|
|
||||||
-- When placing a node next to one of the same category (e.g. slab to slab or
|
|
||||||
-- stair to stair), the default placement (regardless of sneak) is to copy the
|
|
||||||
-- under node's param2, flipping if placed above or below it. The aux key disable
|
|
||||||
-- this behavior.
|
|
||||||
local wall_right_dirmap = {9, 18, 7, 12}
|
|
||||||
local wall_left_dirmap = {11, 16, 5, 14}
|
|
||||||
local ceil_dirmap = {20, 23, 22, 21}
|
|
||||||
|
|
||||||
stairsplus.rotate_node_aux = function(itemstack, placer, pointed_thing)
|
|
||||||
local sneak = placer and placer:get_player_control().sneak
|
|
||||||
local aux = placer and placer:get_player_control().aux1
|
|
||||||
|
|
||||||
-- namestring for what we are placing, up to the first _ (exclusive)
|
|
||||||
local item_prefix = itemstack:get_name():gsub("_.*$", "")
|
|
||||||
-- namestring for what we are placing against
|
|
||||||
local under = pointed_thing.under
|
|
||||||
local under_node = minetest.get_node(under)
|
|
||||||
local under_prefix = under_node and under_node.name:gsub("_.*$", "")
|
|
||||||
|
|
||||||
local same_cat = item_prefix == under_prefix
|
|
||||||
|
|
||||||
-- standard (floor) facedir, also used for sneak placement against the lower half of the wall
|
|
||||||
local p2 = placer and minetest.dir_to_facedir(placer:get_look_dir()) or 0
|
|
||||||
|
|
||||||
-- check which face and which quadrant we are interested in
|
|
||||||
-- this is used both to check if we're handling parallel placement in the same-category case,
|
|
||||||
-- and in general for sneak placement
|
|
||||||
local face_pos = minetest.pointed_thing_to_face_pos(placer, pointed_thing)
|
|
||||||
local face_off = vector.subtract(face_pos, under)
|
|
||||||
local wallmounted = minetest.dir_to_wallmounted(face_off)
|
|
||||||
|
|
||||||
if same_cat and not aux then
|
|
||||||
p2 = under_node.param2
|
|
||||||
-- 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?
|
|
||||||
if wallmounted < 2 then
|
|
||||||
if p2 < 4 then
|
|
||||||
p2 = (p2 + 2) % 4
|
|
||||||
p2 = ceil_dirmap[p2 + 1]
|
|
||||||
elseif p2 > 19 then
|
|
||||||
p2 = ceil_dirmap[p2 - 19] - 20
|
|
||||||
p2 = (p2 + 2) % 4
|
|
||||||
end
|
|
||||||
end
|
|
||||||
else
|
|
||||||
-- for same-cat placement, aux is used to disable param2 copying
|
|
||||||
if same_cat then
|
|
||||||
aux = not aux
|
|
||||||
end
|
|
||||||
|
|
||||||
local remap = nil
|
|
||||||
|
|
||||||
-- standard placement against the wall
|
|
||||||
local use_wallmap = (wallmounted > 1 and not sneak) or (wallmounted < 2 and sneak)
|
|
||||||
|
|
||||||
-- standard placement against the ceiling, or sneak placement against the upper half of the wall
|
|
||||||
local use_ceilmap = wallmounted == 1 and not sneak
|
|
||||||
use_ceilmap = use_ceilmap or (wallmounted > 1 and sneak and face_off.y > 0)
|
|
||||||
|
|
||||||
if use_wallmap then
|
|
||||||
local left = (p2 == 0 and face_off.x < 0) or
|
|
||||||
(p2 == 1 and face_off.z > 0) or
|
|
||||||
(p2 == 2 and face_off.x > 0) or
|
|
||||||
(p2 == 3 and face_off.z < 0)
|
|
||||||
if aux then
|
|
||||||
left = not left
|
|
||||||
end
|
|
||||||
remap = left and wall_left_dirmap or wall_right_dirmap
|
|
||||||
elseif use_ceilmap then
|
|
||||||
remap = ceil_dirmap
|
|
||||||
end
|
|
||||||
|
|
||||||
if aux then
|
|
||||||
p2 = (p2 + 2) % 4
|
|
||||||
end
|
|
||||||
|
|
||||||
if remap then
|
|
||||||
p2 = remap[p2 + 1]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
return minetest.item_place(itemstack, placer, pointed_thing, p2)
|
|
||||||
end
|
|
||||||
|
|
||||||
stairsplus.register_single = function(category, alternate, info, modname, subname, recipeitem, fields)
|
stairsplus.register_single = function(category, alternate, info, modname, subname, recipeitem, fields)
|
||||||
local src_def = minetest.registered_nodes[recipeitem] or {}
|
local src_def = minetest.registered_nodes[recipeitem] or {}
|
||||||
local desc_base = descriptions[category]:format(fields.description)
|
local desc_base = descriptions[category]:format(fields.description)
|
||||||
@ -133,7 +42,7 @@ 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.on_place = minetest.rotate_node
|
||||||
def.groups = stairsplus:prepare_groups(fields.groups)
|
def.groups = stairsplus:prepare_groups(fields.groups)
|
||||||
|
|
||||||
if category == "slab" then
|
if category == "slab" then
|
||||||
|
@ -61,6 +61,8 @@ for _, name in pairs(default_nodes) do
|
|||||||
-- Stone and desert_stone drop cobble and desert_cobble respectively.
|
-- Stone and desert_stone drop cobble and desert_cobble respectively.
|
||||||
if type(ndef.drop) == "string" then
|
if type(ndef.drop) == "string" then
|
||||||
ndef.drop = ndef.drop:gsub(".+:", "")
|
ndef.drop = ndef.drop:gsub(".+:", "")
|
||||||
|
elseif name == "desert_stone" then
|
||||||
|
ndef.drop = ndef.drop.items[1].items[1]:gsub(".+:", "")
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Use the primary tile for all sides of cut glasslike nodes and disregard paramtype2.
|
-- Use the primary tile for all sides of cut glasslike nodes and disregard paramtype2.
|
||||||
|
Reference in New Issue
Block a user