File tree 2 files changed +17
-0
lines changed
2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -118,6 +118,20 @@ local function spawn_falling_node(p, node)
118
118
end
119
119
end
120
120
121
+ function core .spawn_falling_node (pos )
122
+ local node = core .get_node (pos )
123
+ if node .name == " air" or node .name == " ignore" then
124
+ return false
125
+ end
126
+ local obj = core .add_entity (pos , " __builtin:falling_node" )
127
+ if obj then
128
+ obj :get_luaentity ():set_node (node )
129
+ core .remove_node (pos )
130
+ return true
131
+ end
132
+ return false
133
+ end
134
+
121
135
local function drop_attached_node (p )
122
136
local nn = core .get_node (p ).name
123
137
core .remove_node (p )
Original file line number Diff line number Diff line change @@ -2219,6 +2219,9 @@ and `minetest.auth_reload` call the authetification handler.
2219
2219
* Returns `true` if successful, `false` on failure (e.g. protected location)
2220
2220
* `minetest.punch_node(pos)`
2221
2221
* Punch node with the same effects that a player would cause
2222
+ * `minetest.spawn_falling_node(pos)`
2223
+ * Change node into falling node
2224
+ * Returns `true` if successful, `false` on failure
2222
2225
2223
2226
* `minetest.find_nodes_with_meta(pos1, pos2)`
2224
2227
* Get a table of positions of nodes that have metadata within a region {pos1, pos2}
You can’t perform that action at this time.
0 commit comments