if pool and pool[pos.x] and pool[pos.x][pos.y] then
pool[pos.x][pos.y][pos.z] = data
- --if not pool[pos.x][pos.y] then
- -- pool[pos.x][pos.y] = nil
- -- -- only run this if y axis is empty
- -- if not pool[pos.x] then
- -- pool[pos.x] = nil
- -- end
- --end
+ if pool[pos.x][pos.y] and not next(pool[pos.x][pos.y]) then
+ pool[pos.x][pos.y] = nil
+ -- only run this if y axis is empty
+ if pool[pos.x] and not next(pool[pos.x]) then
+ pool[pos.x] = nil
+ end
+ end
end
end
end
local function calculate(pos)
boundary = create_boundary_box(pos)
- --print(dump(boundary))
--pathfind through memory map
for x,index_x in pairs(boundary) do
local minetest,vector = minetest,vector
-
---add in smoke and fire
-local function create_ps(pos)
- local dir = get_offset(minetest.get_node(pos).param2)
- local ppos = vector.add(dir,pos)
- local meta = minetest.get_meta(pos)
- local psf = minetest.add_particlespawner({
- amount = 2,
- time = 0,
- minpos = ppos,
- maxpos = ppos,
- minvel = vector.new(0,0,0),
- maxvel = vector.new(0,0,0),
- minacc = {x=0, y=0, z=0},
- maxacc = {x=0, y=0, z=0},
- minexptime = 1,
- maxexptime = 1,
- minsize = 3,
- maxsize = 3,
- collisiondetection = false,
- vertical = true,
- texture = "redstone_torch_animated.png",
- animation = {type = "vertical_frames",
-
- aspect_w = 16,
- -- Width of a frame in pixels
-
- aspect_h = 16,
- -- Height of a frame in pixels
-
- length = 0.2,
- -- Full loop length
- },
- })
- local pss = minetest.add_particlespawner({
- amount = 2,
- time = 0,
- minpos = ppos,
- maxpos = ppos,
- minvel = vector.new(-0.1,0.1,-0.1),
- maxvel = vector.new(0.1,0.3,0.1),
- minacc = vector.new(0,0,0),
- maxacc = vector.new(0,0,0),
- minexptime = 1,
- maxexptime = 2,
- minsize = 1,
- maxsize = 2,
- collisiondetection = false,
- vertical = false,
- texture = "smoke.png",
- })
- meta:set_int("psf", psf)
- meta:set_int("pss", pss)
-end
-
-- Item definitions
minetest.register_craftitem("redstone:torch", {
description = "Redstone Torch",