Guest User

Untitled

a guest
Nov 29th, 2012
57
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
  17.         walldir = 3
  18.     elseif minetest.env:get_node({ x = wallpos.x+1, y = wallpos.y, z = wallpos.z   }).name ~= "air" then
  19.         walldir = 2 end
  20.     elseif minetest.env:get_node({ x = wallpos.x,   y = wallpos.y, z = wallpos.z+1 }).name ~= "air" then
  21.         walldir = 4
  22.     elseif minetest.env:get_node({ x = wallpos.x,   y = wallpos.y, z = wallpos.z-1 }).name ~= "air" then walldir = 5
  23.     elseif 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
  24.         then
  25.         walldir = nil
  26.     end
  27.     if walldir ~= nil then
  28.         dbg("walldir is "..walldir)
  29.     else
  30.         dbg("walldir is nil")
  31.     end
  32.     return walldir
  33. 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.

×