Guest User

Untitled

a guest
Nov 29th, 2012
51
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local verticals_list = {
  2.     "default:dirt",
  3.     "default:dirt_with_grass",
  4.     "default:stone",
  5.     "default:cobble",
  6.     "default:mossycobble",
  7.     "default:brick",
  8.     "default:tree",
  9.     "default:jungletree",
  10.     "default:coal",
  11.     "default:iron"
  12. }
  13.  
  14. plant_valid_wall = function(wallpos)
  15.     local walldir = nil
  16.     if minetest.env:get_node({ x = wallpos.x-1, y = wallpos.y, z = wallpos.z   }).name ~= "air" then walldir = 3 end
  17.     if minetest.env:get_node({ x = wallpos.x+1, y = wallpos.y, z = wallpos.z   }).name ~= "air" then walldir = 2 end
  18.     if minetest.env:get_node({ x = wallpos.x,   y = wallpos.y, z = wallpos.z+1 }).name ~= "air" then walldir = 4 end
  19.     if minetest.env:get_node({ x = wallpos.x,   y = wallpos.y, z = wallpos.z-1 }).name ~= "air" then walldir = 5 end
  20.     if table.getn(minetest.env:find_nodes_in_area({x=wallpos.x-1, y=wallpos.y, z=wallpos.z-1}, {x=wallpos.x+1, y=wallpos.y, z=wallpos.z+1}, verticals_list)) == 0
  21.         then walldir = nil
  22.     end
  23.     if walldir ~= nil then
  24.         dbg("walldir is "..walldir)
  25.     else
  26.         dbg("walldir is nil")
  27.     end
  28.     return walldir
  29. end
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×