aboutsummaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
Diffstat (limited to 'builtin')
-rw-r--r--builtin/chatcommands.lua20
-rw-r--r--builtin/falling.lua15
-rw-r--r--builtin/misc_register.lua12
3 files changed, 37 insertions, 10 deletions
diff --git a/builtin/chatcommands.lua b/builtin/chatcommands.lua
index 4b09f7b2b..9f14749f4 100644
--- a/builtin/chatcommands.lua
+++ b/builtin/chatcommands.lua
@@ -665,3 +665,23 @@ minetest.register_chatcommand("clearobjects", {
minetest.chat_send_all("*** Cleared all objects.")
end,
})
+
+minetest.register_chatcommand("msg", {
+ params = "<name> <message>",
+ description = "Send a private message",
+ privs = {shout=true},
+ func = function(name, param)
+ local found, _, sendto, message = param:find("^([^%s]+)%s(.+)$")
+ if found then
+ if minetest.env:get_player_by_name(sendto) then
+ minetest.log("action", "PM from "..name.." to "..sendto..": "..message)
+ minetest.chat_send_player(sendto, "PM from "..name..": "..message)
+ minetest.chat_send_player(name, "Message sent")
+ else
+ minetest.chat_send_player(name, "The player "..sendto.." is not online")
+ end
+ else
+ minetest.chat_send_player(name, "Invalid usage, see /help msg")
+ end
+ end,
+})
diff --git a/builtin/falling.lua b/builtin/falling.lua
index 1c09f9856..f6491991b 100644
--- a/builtin/falling.lua
+++ b/builtin/falling.lua
@@ -142,7 +142,7 @@ end
-- Some common functions
--
-function nodeupdate_single(p)
+function nodeupdate_single(p, delay)
n = minetest.env:get_node(p)
if minetest.get_node_group(n.name, "falling_node") ~= 0 then
p_bottom = {x=p.x, y=p.y-1, z=p.z}
@@ -151,9 +151,13 @@ function nodeupdate_single(p)
if minetest.registered_nodes[n_bottom.name] and
(not minetest.registered_nodes[n_bottom.name].walkable or
minetest.registered_nodes[n_bottom.name].buildable_to) then
- minetest.env:remove_node(p)
- spawn_falling_node(p, n.name)
- nodeupdate(p)
+ if delay then
+ minetest.after(0.1, nodeupdate_single, {x=p.x, y=p.y, z=p.z}, false)
+ else
+ minetest.env:remove_node(p)
+ spawn_falling_node(p, n.name)
+ nodeupdate(p)
+ end
end
end
@@ -174,8 +178,7 @@ function nodeupdate(p)
for x = -1,1 do
for y = -1,1 do
for z = -1,1 do
- p2 = {x=p.x+x, y=p.y+y, z=p.z+z}
- nodeupdate_single(p2)
+ nodeupdate_single({x=p.x+x, y=p.y+y, z=p.z+z}, not (x==0 and y==0 and z==0))
end
end
end
diff --git a/builtin/misc_register.lua b/builtin/misc_register.lua
index f9c06a02a..4041fb9e2 100644
--- a/builtin/misc_register.lua
+++ b/builtin/misc_register.lua
@@ -103,6 +103,10 @@ function minetest.register_item(name, itemdef)
-- Apply defaults and add to registered_* table
if itemdef.type == "node" then
+ -- Use the nodebox as selection box if it's not set manually
+ if itemdef.drawtype == "nodebox" and not itemdef.selection_box then
+ itemdef.selection_box = itemdef.node_box
+ end
setmetatable(itemdef, {__index = minetest.nodedef_default})
minetest.registered_nodes[itemdef.name] = itemdef
elseif itemdef.type == "craft" then
@@ -249,8 +253,8 @@ minetest.register_item(":unknown", {
minetest.register_node(":air", {
description = "Air (you hacker you!)",
- inventory_image = "unknown_block.png",
- wield_image = "unknown_block.png",
+ inventory_image = "unknown_node.png",
+ wield_image = "unknown_node.png",
drawtype = "airlike",
paramtype = "light",
sunlight_propagates = true,
@@ -265,8 +269,8 @@ minetest.register_node(":air", {
minetest.register_node(":ignore", {
description = "Ignore (you hacker you!)",
- inventory_image = "unknown_block.png",
- wield_image = "unknown_block.png",
+ inventory_image = "unknown_node.png",
+ wield_image = "unknown_node.png",
drawtype = "airlike",
paramtype = "none",
sunlight_propagates = false,