From 8de3848a7afee9609003f520b2d93b92025bbe99 Mon Sep 17 00:00:00 2001 From: Robbie Ferguson Date: Thu, 19 May 2016 17:23:02 -0400 Subject: [PATCH] Begin working on find_air function Thanks to sofar for the advice and DonBatman for the initial [untested] code. --- init.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/init.lua b/init.lua index 721939d..e3cb2e6 100644 --- a/init.lua +++ b/init.lua @@ -35,6 +35,19 @@ local function find_free_position_near(pos) return pos, false end +local function = find_air(pos,player) + local bot = {pos.x, pos.y-1, pos.z} + local mid = {pos} + local top = {pos.x, pos.y+1, pos.z} + while + mid ~= "air" or mid ~= "ignore" and + top ~= "air" or top ~= "ignore" then + pos.y = pos.y +2 + else + player:setpos(mid) -- change this to a return and call from within /tpj (which will also impact /tpe) + end +end + local function parti(pos) minetest.add_particlespawner(50, 0.4, {x=pos.x + 0.5, y=pos.y, z=pos.z + 0.5}, {x=pos.x - 0.5, y=pos.y, z=pos.z - 0.5},