]> git.lizzy.rs Git - Crafter.git/blobdiff - mods/redstone/space_maker.lua
Extreme redstone optimizations
[Crafter.git] / mods / redstone / space_maker.lua
index 611203ab347be1b61df7030b64e3ff4eeef34b83..b56dbef40acae1ab14b0af1111c1e238edb6410b 100644 (file)
@@ -1,3 +1,4 @@
+local minetest,vector,pairs = minetest,vector,pairs
 --this is a debug for creating flat planes to test redstone
 local items = {
 "redstone:dust 50",
@@ -40,17 +41,19 @@ minetest.register_node("redstone:space", {
                vm:set_data(data)
                vm:write_to_map()
                
-               local placer_pos = placer:getpos()
+               local placer_pos = placer:get_pos()
                placer_pos.y = pos.y + 1
                placer:move_to(placer_pos)
                
                pos.y = pos.y + 1
                for _,item in pairs(items) do
                        local obj = minetest.add_item(pos,item)
-                       local x=math.random(-2,2)*math.random()
-                       local y=math.random(2,5)
-                       local z=math.random(-2,2)*math.random()
-                       obj:setvelocity({x=x, y=y, z=z})
+                       --local x=math.random(-2,2)*math.random()
+                       --local y=math.random(2,5)
+                       --local z=math.random(-2,2)*math.random()
+                       --if obj and obj:get_luaentity() then
+                       --      obj:setvelocity({x=x, y=y, z=z})
+                       --end
                end
     end,