Guest User

Untitled

a guest
Feb 19th, 2013
55
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. minetest.register_abm({
  2. nodenames = {"portals:skyportal_center"},
  3. interval = 3,
  4. chance = 1,
  5. action = function(pos)
  6. local objs = minetest.env:get_objects_inside_radius(pos, 1)
  7.  
  8. if objs[1] == nil then
  9. return false;
  10. else
  11. for k, obj in pairs(objs) do
  12. local objpos = obj:getpos()
  13. local groundmat = "default:dirt"
  14. portalpos1 = pos
  15. ypos = pos.y+800
  16. --dirtlayer
  17. minetest.env:add_node({x=pos.x, y=ypos-1, z=pos.z}, {name=groundmat})
  18. --portallayer
  19. minetest.env:add_node({x=pos.x, y=ypos, z=pos.z}, {name="portals:skyportal_center2"})
  20. portalpos2 = {x=pos.x, y=ypos, z=pos.z}
  21. minetest.env:add_node({x=pos.x+1, y=ypos, z=pos.z}, {name="portals:skyportal_rim2"})
  22. minetest.env:add_node({x=pos.x-1, y=ypos, z=pos.z}, {name="portals:skyportal_rim2"})
  23. minetest.env:add_node({x=pos.x, y=ypos, z=pos.z+1}, {name="portals:skyportal_rim2"})
  24. minetest.env:add_node({x=pos.x, y=ypos, z=pos.z-1}, {name="portals:skyportal_rim2"})
  25. minetest.env:add_node({x=pos.x+1, y=ypos, z=pos.z+1}, {name="portals:skyportal_rim"})
  26. minetest.env:add_node({x=pos.x-1, y=ypos, z=pos.z-1}, {name="portals:skyportal_rim"})
  27. minetest.env:add_node({x=pos.x-1, y=ypos, z=pos.z+1}, {name="portals:skyportal_rim"})
  28. minetest.env:add_node({x=pos.x+1, y=ypos, z=pos.z-1}, {name="portals:skyportal_rim"})
  29. --dirtlayer 2
  30. minetest.env:add_node({x=pos.x+2, y=ypos, z=pos.z}, {name=groundmat})
  31. minetest.env:add_node({x=pos.x-2, y=ypos, z=pos.z}, {name=groundmat})
  32. minetest.env:add_node({x=pos.x, y=ypos, z=pos.z+2}, {name=groundmat})
  33. minetest.env:add_node({x=pos.x, y=ypos, z=pos.z-2}, {name=groundmat})
  34. minetest.env:add_node({x=pos.x+2, y=ypos, z=pos.z+2}, {name=groundmat})
  35. minetest.env:add_node({x=pos.x-2, y=ypos, z=pos.z-2}, {name=groundmat})
  36. minetest.env:add_node({x=pos.x-2, y=ypos, z=pos.z+2}, {name=groundmat})
  37. minetest.env:add_node({x=pos.x+2, y=ypos, z=pos.z-2}, {name=groundmat})
  38. obj:setpos(portalpos2)
  39.  
  40. end
  41. end
  42. end,
  43. })
RAW Paste Data