mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2024-11-14 22:40:31 +01:00
Remove empty eject_entities.lua file
This commit is contained in:
parent
7f78ccf906
commit
fae3e02f49
|
@ -1,28 +0,0 @@
|
|||
-------------------------------------
|
||||
-- Eject entities when placing node
|
||||
--
|
||||
|
||||
unwalkable_nodes = {}
|
||||
|
||||
minetest.after(0, function()
|
||||
for itemname, node in pairs(minetest.registered_nodes) do
|
||||
if node.walkable == false then
|
||||
table.insert(unwalkable_nodes, 1, itemname)
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
minetest.register_on_placenode(function(pos)
|
||||
local objs = minetest.get_objects_inside_radius(pos, 1)
|
||||
local minp, maxp = {x=pos.x-1, y=pos.y, z=pos.z-1}, {x=pos.x+1, y=pos.y+1, z=pos.z+1}
|
||||
local nodes = minetest.find_nodes_in_area(minp, maxp, unwalkable_nodes)
|
||||
if table.getn(nodes) == 0 then
|
||||
return
|
||||
end
|
||||
for _,obj in pairs(objs) do
|
||||
if not obj:is_player() and obj:get_entity_name() == "builtin:item" then
|
||||
obj:setpos(nodes[math.random(1,#nodes)])
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
Loading…
Reference in New Issue
Block a user