Builtin: minor patches
parent
191bb343f9
commit
484a20083f
|
@ -158,7 +158,11 @@ core.register_entity(":__builtin:falling_node", {
|
|||
-- Drop node if does not fall within 5 seconds
|
||||
self.timer = self.timer + dtime
|
||||
if self.timer > 5 then
|
||||
core.add_item(pos, self.node)
|
||||
-- Add dropped items
|
||||
local drops = core.get_node_drops(self.node, "")
|
||||
for _, dropped_item in pairs(drops) do
|
||||
core.add_item(pos, dropped_item)
|
||||
end
|
||||
self.object:remove()
|
||||
end
|
||||
end
|
||||
|
|
|
@ -624,6 +624,11 @@ end
|
|||
function core.item_eat(hp_change, replace_with_item, poison)
|
||||
return function(itemstack, user, pointed_thing) -- closure
|
||||
if user then
|
||||
if user:is_player() and pointed_thing.type == "object" then
|
||||
pointed_thing.ref:right_click(user)
|
||||
return user:get_wielded_item()
|
||||
end
|
||||
|
||||
return core.do_item_eat(hp_change, replace_with_item, itemstack, user, pointed_thing, poison)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -44,7 +44,9 @@ local player_list = {}
|
|||
|
||||
|
||||
function core.send_join_message(player_name)
|
||||
core.chat_send_all("=> " .. player_name .. " has joined the server")
|
||||
if not core.is_singleplayer() then
|
||||
core.chat_send_all("=> " .. player_name .. " has joined the server")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
@ -60,10 +62,7 @@ end
|
|||
core.register_on_joinplayer(function(player)
|
||||
local player_name = player:get_player_name()
|
||||
player_list[player_name] = player
|
||||
if not core.is_singleplayer() then
|
||||
core.send_join_message(player_name)
|
||||
end
|
||||
|
||||
core.send_join_message(player_name)
|
||||
end)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue