Kotolegokot d097558014 Groupcaps
Groupcaps were added, texture of cobbleblock was modified. Different anvils were deleted, because it had very big bug.
2012-10-31 18:36:51 +06:00

34 lines
727 B
Lua

--Mod by PilzAdam
function minetest.handle_node_drops(pos, drops, digger)
for _,item in ipairs(drops) do
local count, name
if type(item) == "string" then
count = 1
name = item
else
count = item:get_count()
name = item:get_name()
end
for i=1,count do
local obj = minetest.env:add_item(pos, name)
if obj ~= nil then
obj:get_luaentity().collect = true
local k = 1
if name == "default:cobble" then
k = math.random(3,6)
end
local x = math.random(1, 5)/k
if math.random(1,2) == 1 then
x = -x
end
local z = math.random(1, 5)/k
if math.random(1,2) == 1 then
z = -z
end
obj:setvelocity({x=1/x, y=obj:getvelocity().y, z=1/z})
end
end
end
end