mirror of
https://github.com/minetest/minetest.git
synced 2024-12-28 19:50:28 +01:00
parent
95d7fcb949
commit
70b71c5013
@ -158,12 +158,10 @@ core.register_entity(":__builtin:falling_node", {
|
|||||||
or def.drawtype == "normal"
|
or def.drawtype == "normal"
|
||||||
or def.drawtype == "nodebox" then
|
or def.drawtype == "nodebox" then
|
||||||
if (def.paramtype2 == "facedir" or def.paramtype2 == "colorfacedir") then
|
if (def.paramtype2 == "facedir" or def.paramtype2 == "colorfacedir") then
|
||||||
local fdir = node.param2 % 32
|
local fdir = node.param2 % 32 % 24
|
||||||
-- Get rotation from a precalculated lookup table
|
-- Get rotation from a precalculated lookup table
|
||||||
local euler = facedir_to_euler[fdir + 1]
|
local euler = facedir_to_euler[fdir + 1]
|
||||||
if euler then
|
self.object:set_rotation(euler)
|
||||||
self.object:set_rotation(euler)
|
|
||||||
end
|
|
||||||
elseif (def.drawtype ~= "plantlike" and def.drawtype ~= "plantlike_rooted" and
|
elseif (def.drawtype ~= "plantlike" and def.drawtype ~= "plantlike_rooted" and
|
||||||
(def.paramtype2 == "wallmounted" or def.paramtype2 == "colorwallmounted" or def.drawtype == "signlike")) then
|
(def.paramtype2 == "wallmounted" or def.paramtype2 == "colorwallmounted" or def.drawtype == "signlike")) then
|
||||||
local rot = node.param2 % 8
|
local rot = node.param2 % 8
|
||||||
|
@ -13,6 +13,20 @@ minetest.register_node("testnodes:falling", {
|
|||||||
groups = { falling_node = 1, dig_immediate = 3 },
|
groups = { falling_node = 1, dig_immediate = 3 },
|
||||||
})
|
})
|
||||||
|
|
||||||
|
minetest.register_node("testnodes:falling_facedir", {
|
||||||
|
description = S("Falling Facedir Node"),
|
||||||
|
tiles = {
|
||||||
|
"testnodes_1.png",
|
||||||
|
"testnodes_2.png",
|
||||||
|
"testnodes_3.png",
|
||||||
|
"testnodes_4.png",
|
||||||
|
"testnodes_5.png",
|
||||||
|
"testnodes_6.png",
|
||||||
|
},
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
groups = { falling_node = 1, dig_immediate = 3 },
|
||||||
|
})
|
||||||
|
|
||||||
-- Same as falling node, but will stop falling on top of liquids
|
-- Same as falling node, but will stop falling on top of liquids
|
||||||
minetest.register_node("testnodes:falling_float", {
|
minetest.register_node("testnodes:falling_float", {
|
||||||
description = S("Falling+Floating Node"),
|
description = S("Falling+Floating Node"),
|
||||||
|
Loading…
Reference in New Issue
Block a user