2012-08-06 03:29:59 +02:00
|
|
|
-- Pipeworks mod by Vanessa Ezekowitz - 2012-08-05
|
2012-07-12 23:52:35 +02:00
|
|
|
--
|
2012-08-24 19:39:29 +02:00
|
|
|
-- Entirely my own code. This mod supplies various shapes of pipes
|
|
|
|
-- and devices that they can connect to such as pumps, valves, etc.
|
|
|
|
-- All pipes autoconnect as you lay them out, and devices will auto-
|
|
|
|
-- connect to them.
|
2012-07-12 23:52:35 +02:00
|
|
|
--
|
|
|
|
-- License: WTFPL
|
|
|
|
--
|
|
|
|
|
2012-08-24 19:39:29 +02:00
|
|
|
-- Un-comment the following dofile line to re-enable the old pipe nodes.
|
|
|
|
-- dofile(minetest.get_modpath("pipeworks").."/oldpipes.lua")
|
2013-01-04 06:15:23 +01:00
|
|
|
--
|
2012-07-12 23:52:35 +02:00
|
|
|
|
2012-09-02 18:55:14 +02:00
|
|
|
minetest.register_alias("pipeworks:pipe", "pipeworks:pipe_110000_empty")
|
2013-01-14 03:45:03 +01:00
|
|
|
local DEBUG = false
|
2013-06-28 15:16:28 +02:00
|
|
|
local CYCLIC = true
|
2012-08-18 14:46:17 +02:00
|
|
|
|
2013-01-06 03:14:09 +01:00
|
|
|
pipeworks_liquid_texture = "default_water.png"
|
|
|
|
|
2012-08-19 07:56:30 +02:00
|
|
|
pipe_leftstub = {
|
2012-08-18 14:46:17 +02:00
|
|
|
{ -32/64, -2/64, -6/64, 1/64, 2/64, 6/64 }, -- pipe segment against -X face
|
|
|
|
{ -32/64, -4/64, -5/64, 1/64, 4/64, 5/64 },
|
|
|
|
{ -32/64, -5/64, -4/64, 1/64, 5/64, 4/64 },
|
|
|
|
{ -32/64, -6/64, -2/64, 1/64, 6/64, 2/64 },
|
|
|
|
|
|
|
|
{ -32/64, -3/64, -8/64, -30/64, 3/64, 8/64 }, -- (the flange for it)
|
|
|
|
{ -32/64, -5/64, -7/64, -30/64, 5/64, 7/64 },
|
|
|
|
{ -32/64, -6/64, -6/64, -30/64, 6/64, 6/64 },
|
|
|
|
{ -32/64, -7/64, -5/64, -30/64, 7/64, 5/64 },
|
|
|
|
{ -32/64, -8/64, -3/64, -30/64, 8/64, 3/64 }
|
|
|
|
}
|
|
|
|
|
2012-08-19 07:56:30 +02:00
|
|
|
pipe_rightstub = {
|
2012-08-18 14:46:17 +02:00
|
|
|
{ -1/64, -2/64, -6/64, 32/64, 2/64, 6/64 }, -- pipe segment against +X face
|
|
|
|
{ -1/64, -4/64, -5/64, 32/64, 4/64, 5/64 },
|
|
|
|
{ -1/64, -5/64, -4/64, 32/64, 5/64, 4/64 },
|
|
|
|
{ -1/64, -6/64, -2/64, 32/64, 6/64, 2/64 },
|
|
|
|
|
|
|
|
{ 30/64, -3/64, -8/64, 32/64, 3/64, 8/64 }, -- (the flange for it)
|
|
|
|
{ 30/64, -5/64, -7/64, 32/64, 5/64, 7/64 },
|
|
|
|
{ 30/64, -6/64, -6/64, 32/64, 6/64, 6/64 },
|
|
|
|
{ 30/64, -7/64, -5/64, 32/64, 7/64, 5/64 },
|
|
|
|
{ 30/64, -8/64, -3/64, 32/64, 8/64, 3/64 }
|
|
|
|
}
|
|
|
|
|
2012-08-19 07:56:30 +02:00
|
|
|
pipe_bottomstub = {
|
2012-08-18 14:46:17 +02:00
|
|
|
{ -2/64, -32/64, -6/64, 2/64, 1/64, 6/64 }, -- pipe segment against -Y face
|
|
|
|
{ -4/64, -32/64, -5/64, 4/64, 1/64, 5/64 },
|
|
|
|
{ -5/64, -32/64, -4/64, 5/64, 1/64, 4/64 },
|
|
|
|
{ -6/64, -32/64, -2/64, 6/64, 1/64, 2/64 },
|
|
|
|
|
|
|
|
{ -3/64, -32/64, -8/64, 3/64, -30/64, 8/64 }, -- (the flange for it)
|
|
|
|
{ -5/64, -32/64, -7/64, 5/64, -30/64, 7/64 },
|
|
|
|
{ -6/64, -32/64, -6/64, 6/64, -30/64, 6/64 },
|
|
|
|
{ -7/64, -32/64, -5/64, 7/64, -30/64, 5/64 },
|
|
|
|
{ -8/64, -32/64, -3/64, 8/64, -30/64, 3/64 }
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-08-19 07:56:30 +02:00
|
|
|
pipe_topstub = {
|
2012-08-18 14:46:17 +02:00
|
|
|
{ -2/64, -1/64, -6/64, 2/64, 32/64, 6/64 }, -- pipe segment against +Y face
|
|
|
|
{ -4/64, -1/64, -5/64, 4/64, 32/64, 5/64 },
|
|
|
|
{ -5/64, -1/64, -4/64, 5/64, 32/64, 4/64 },
|
|
|
|
{ -6/64, -1/64, -2/64, 6/64, 32/64, 2/64 },
|
|
|
|
|
|
|
|
{ -3/64, 30/64, -8/64, 3/64, 32/64, 8/64 }, -- (the flange for it)
|
|
|
|
{ -5/64, 30/64, -7/64, 5/64, 32/64, 7/64 },
|
|
|
|
{ -6/64, 30/64, -6/64, 6/64, 32/64, 6/64 },
|
|
|
|
{ -7/64, 30/64, -5/64, 7/64, 32/64, 5/64 },
|
|
|
|
{ -8/64, 30/64, -3/64, 8/64, 32/64, 3/64 }
|
|
|
|
}
|
|
|
|
|
2012-08-19 07:56:30 +02:00
|
|
|
pipe_frontstub = {
|
2012-08-18 14:46:17 +02:00
|
|
|
{ -6/64, -2/64, -32/64, 6/64, 2/64, 1/64 }, -- pipe segment against -Z face
|
|
|
|
{ -5/64, -4/64, -32/64, 5/64, 4/64, 1/64 },
|
|
|
|
{ -4/64, -5/64, -32/64, 4/64, 5/64, 1/64 },
|
|
|
|
{ -2/64, -6/64, -32/64, 2/64, 6/64, 1/64 },
|
|
|
|
|
|
|
|
{ -8/64, -3/64, -32/64, 8/64, 3/64, -30/64 }, -- (the flange for it)
|
|
|
|
{ -7/64, -5/64, -32/64, 7/64, 5/64, -30/64 },
|
|
|
|
{ -6/64, -6/64, -32/64, 6/64, 6/64, -30/64 },
|
|
|
|
{ -5/64, -7/64, -32/64, 5/64, 7/64, -30/64 },
|
|
|
|
{ -3/64, -8/64, -32/64, 3/64, 8/64, -30/64 }
|
|
|
|
}
|
|
|
|
|
2012-08-19 07:56:30 +02:00
|
|
|
pipe_backstub = {
|
2012-08-18 14:46:17 +02:00
|
|
|
{ -6/64, -2/64, -1/64, 6/64, 2/64, 32/64 }, -- pipe segment against -Z face
|
|
|
|
{ -5/64, -4/64, -1/64, 5/64, 4/64, 32/64 },
|
|
|
|
{ -4/64, -5/64, -1/64, 4/64, 5/64, 32/64 },
|
|
|
|
{ -2/64, -6/64, -1/64, 2/64, 6/64, 32/64 },
|
|
|
|
|
|
|
|
{ -8/64, -3/64, 30/64, 8/64, 3/64, 32/64 }, -- (the flange for it)
|
|
|
|
{ -7/64, -5/64, 30/64, 7/64, 5/64, 32/64 },
|
|
|
|
{ -6/64, -6/64, 30/64, 6/64, 6/64, 32/64 },
|
|
|
|
{ -5/64, -7/64, 30/64, 5/64, 7/64, 32/64 },
|
|
|
|
{ -3/64, -8/64, 30/64, 3/64, 8/64, 32/64 }
|
|
|
|
}
|
|
|
|
|
2012-08-19 07:56:30 +02:00
|
|
|
pipe_selectboxes = {
|
2012-08-18 14:46:17 +02:00
|
|
|
{ -32/64, -8/64, -8/64, 8/64, 8/64, 8/64 },
|
|
|
|
{ -8/64 , -8/64, -8/64, 32/64, 8/64, 8/64 },
|
|
|
|
{ -8/64 , -32/64, -8/64, 8/64, 8/64, 8/64 },
|
|
|
|
{ -8/64 , -8/64, -8/64, 8/64, 32/64, 8/64 },
|
|
|
|
{ -8/64 , -8/64, -32/64, 8/64, 8/64, 8/64 },
|
|
|
|
{ -8/64 , -8/64, -8/64, 8/64, 8/64, 32/64 }
|
|
|
|
}
|
2012-07-12 23:52:35 +02:00
|
|
|
|
2012-08-19 07:56:30 +02:00
|
|
|
pipe_bendsphere = {
|
2012-08-18 14:46:17 +02:00
|
|
|
{ -4/64, -4/64, -4/64, 4/64, 4/64, 4/64 },
|
|
|
|
{ -5/64, -3/64, -3/64, 5/64, 3/64, 3/64 },
|
|
|
|
{ -3/64, -5/64, -3/64, 3/64, 5/64, 3/64 },
|
|
|
|
{ -3/64, -3/64, -5/64, 3/64, 3/64, 5/64 }
|
2012-08-06 03:29:59 +02:00
|
|
|
}
|
|
|
|
|
2012-08-19 07:56:30 +02:00
|
|
|
-- Functions
|
2012-08-06 03:29:59 +02:00
|
|
|
|
2013-06-08 07:00:49 +02:00
|
|
|
if minetest.get_modpath("unified_inventory") or not minetest.setting_getbool("creative_mode") then
|
|
|
|
pipeworks_expect_infinite_stacks = false
|
|
|
|
else
|
|
|
|
pipeworks_expect_infinite_stacks = true
|
|
|
|
end
|
|
|
|
|
2012-08-19 07:56:30 +02:00
|
|
|
dbg = function(s)
|
2013-01-04 06:15:23 +01:00
|
|
|
if DEBUG then
|
2012-08-18 14:46:17 +02:00
|
|
|
print('[PIPEWORKS] ' .. s)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2012-08-24 19:39:29 +02:00
|
|
|
function pipes_fix_image_names(table, replacement)
|
2012-08-06 03:29:59 +02:00
|
|
|
outtable={}
|
2012-08-18 14:46:17 +02:00
|
|
|
for i in ipairs(table) do
|
|
|
|
outtable[i]=string.gsub(table[i], "_XXXXX", replacement)
|
2012-08-06 03:29:59 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
return outtable
|
|
|
|
end
|
|
|
|
|
2012-08-19 07:56:30 +02:00
|
|
|
function pipe_addbox(t, b)
|
2012-08-18 14:46:17 +02:00
|
|
|
for i in ipairs(b)
|
|
|
|
do table.insert(t, b[i])
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2013-06-08 07:00:49 +02:00
|
|
|
function pipeworks_node_is_owned(pos, placer)
|
|
|
|
local ownername = false
|
|
|
|
if type(IsPlayerNodeOwner) == "function" then -- node_ownership mod
|
|
|
|
if HasOwner(pos, placer) then -- returns true if the node is owned
|
|
|
|
if not IsPlayerNodeOwner(pos, placer:get_player_name()) then
|
|
|
|
if type(getLastOwner) == "function" then -- ...is an old version
|
|
|
|
ownername = getLastOwner(pos)
|
|
|
|
elseif type(GetNodeOwnerName) == "function" then -- ...is a recent version
|
|
|
|
ownername = GetNodeOwnerName(pos)
|
|
|
|
else
|
|
|
|
ownername = S("someone")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
elseif type(isprotect)=="function" then -- glomie's protection mod
|
|
|
|
if not isprotect(5, pos, placer) then
|
|
|
|
ownername = S("someone")
|
|
|
|
end
|
|
|
|
elseif type(protector)=="table" and type(protector.can_dig)=="function" then -- Zeg9's protection mod
|
|
|
|
if not protector.can_dig(5, pos, placer) then
|
|
|
|
ownername = S("someone")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
if ownername ~= false then
|
|
|
|
minetest.chat_send_player( placer:get_player_name(), S("Sorry, %s owns that spot."):format(ownername) )
|
|
|
|
return true
|
|
|
|
else
|
|
|
|
return false
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2012-08-18 14:46:17 +02:00
|
|
|
-- now define the nodes!
|
|
|
|
|
2013-01-04 07:34:25 +01:00
|
|
|
pipes_empty_nodenames = {}
|
|
|
|
pipes_full_nodenames = {}
|
2013-01-04 06:15:23 +01:00
|
|
|
|
2012-08-18 14:46:17 +02:00
|
|
|
for xm = 0, 1 do
|
|
|
|
for xp = 0, 1 do
|
|
|
|
for ym = 0, 1 do
|
|
|
|
for yp = 0, 1 do
|
|
|
|
for zm = 0, 1 do
|
|
|
|
for zp = 0, 1 do
|
2012-08-19 07:56:30 +02:00
|
|
|
local outboxes = {}
|
|
|
|
local outsel = {}
|
|
|
|
local outimgs = {}
|
|
|
|
|
2012-08-18 14:46:17 +02:00
|
|
|
if yp==1 then
|
2012-08-19 07:56:30 +02:00
|
|
|
pipe_addbox(outboxes, pipe_topstub)
|
|
|
|
table.insert(outsel, pipe_selectboxes[4])
|
2012-08-18 14:46:17 +02:00
|
|
|
table.insert(outimgs, "pipeworks_pipe_end.png")
|
|
|
|
else
|
|
|
|
table.insert(outimgs, "pipeworks_plain.png")
|
|
|
|
end
|
|
|
|
if ym==1 then
|
2012-08-19 07:56:30 +02:00
|
|
|
pipe_addbox(outboxes, pipe_bottomstub)
|
|
|
|
table.insert(outsel, pipe_selectboxes[3])
|
2012-08-18 14:46:17 +02:00
|
|
|
table.insert(outimgs, "pipeworks_pipe_end.png")
|
|
|
|
else
|
|
|
|
table.insert(outimgs, "pipeworks_plain.png")
|
|
|
|
end
|
|
|
|
if xp==1 then
|
2012-08-19 07:56:30 +02:00
|
|
|
pipe_addbox(outboxes, pipe_rightstub)
|
|
|
|
table.insert(outsel, pipe_selectboxes[2])
|
2012-08-18 14:46:17 +02:00
|
|
|
table.insert(outimgs, "pipeworks_pipe_end.png")
|
|
|
|
else
|
|
|
|
table.insert(outimgs, "pipeworks_plain.png")
|
|
|
|
end
|
|
|
|
if xm==1 then
|
2012-08-19 07:56:30 +02:00
|
|
|
pipe_addbox(outboxes, pipe_leftstub)
|
|
|
|
table.insert(outsel, pipe_selectboxes[1])
|
2012-08-18 14:46:17 +02:00
|
|
|
table.insert(outimgs, "pipeworks_pipe_end.png")
|
|
|
|
else
|
|
|
|
table.insert(outimgs, "pipeworks_plain.png")
|
|
|
|
end
|
|
|
|
if zp==1 then
|
2012-08-19 07:56:30 +02:00
|
|
|
pipe_addbox(outboxes, pipe_backstub)
|
|
|
|
table.insert(outsel, pipe_selectboxes[6])
|
2012-08-18 14:46:17 +02:00
|
|
|
table.insert(outimgs, "pipeworks_pipe_end.png")
|
|
|
|
else
|
|
|
|
table.insert(outimgs, "pipeworks_plain.png")
|
|
|
|
end
|
|
|
|
if zm==1 then
|
2012-08-19 07:56:30 +02:00
|
|
|
pipe_addbox(outboxes, pipe_frontstub)
|
|
|
|
table.insert(outsel, pipe_selectboxes[5])
|
2012-08-18 14:46:17 +02:00
|
|
|
table.insert(outimgs, "pipeworks_pipe_end.png")
|
|
|
|
else
|
|
|
|
table.insert(outimgs, "pipeworks_plain.png")
|
|
|
|
end
|
|
|
|
|
2012-08-19 07:56:30 +02:00
|
|
|
local jx = xp+xm
|
|
|
|
local jy = yp+ym
|
|
|
|
local jz = zp+zm
|
2012-08-19 04:12:29 +02:00
|
|
|
|
|
|
|
if (jx+jy+jz) == 1 then
|
|
|
|
if xm == 1 then
|
|
|
|
table.remove(outimgs, 3)
|
2013-01-06 03:14:09 +01:00
|
|
|
table.insert(outimgs, 3, "^pipeworks_plain.png")
|
2012-08-19 04:12:29 +02:00
|
|
|
end
|
|
|
|
if xp == 1 then
|
|
|
|
table.remove(outimgs, 4)
|
2013-01-06 03:14:09 +01:00
|
|
|
table.insert(outimgs, 4, "^pipeworks_plain.png")
|
2012-08-19 04:12:29 +02:00
|
|
|
end
|
|
|
|
if ym == 1 then
|
|
|
|
table.remove(outimgs, 1)
|
2013-01-06 03:14:09 +01:00
|
|
|
table.insert(outimgs, 1, "^pipeworks_plain.png")
|
2012-08-19 04:12:29 +02:00
|
|
|
end
|
|
|
|
if xp == 1 then
|
|
|
|
table.remove(outimgs, 2)
|
2013-01-06 03:14:09 +01:00
|
|
|
table.insert(outimgs, 2, "^pipeworks_plain.png")
|
2012-08-19 04:12:29 +02:00
|
|
|
end
|
|
|
|
if zm == 1 then
|
|
|
|
table.remove(outimgs, 5)
|
2013-01-06 03:14:09 +01:00
|
|
|
table.insert(outimgs, 5, "^pipeworks_plain.png")
|
2012-08-19 04:12:29 +02:00
|
|
|
end
|
|
|
|
if zp == 1 then
|
|
|
|
table.remove(outimgs, 6)
|
2013-01-06 03:14:09 +01:00
|
|
|
table.insert(outimgs, 6, "^pipeworks_plain.png")
|
2012-08-19 04:12:29 +02:00
|
|
|
end
|
|
|
|
end
|
2012-08-18 14:46:17 +02:00
|
|
|
|
2013-01-01 23:51:55 +01:00
|
|
|
if jx+jy+jz >= 2 then
|
2012-08-19 07:56:30 +02:00
|
|
|
pipe_addbox(outboxes, pipe_bendsphere)
|
2012-08-18 14:46:17 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
if (jx==2 and jy~=2 and jz~=2) then
|
|
|
|
table.remove(outimgs, 5)
|
|
|
|
table.remove(outimgs, 5)
|
2013-01-06 03:14:09 +01:00
|
|
|
table.insert(outimgs, 5, pipeworks_liquid_texture.."^pipeworks_windowed_XXXXX.png")
|
|
|
|
table.insert(outimgs, 5, pipeworks_liquid_texture.."^pipeworks_windowed_XXXXX.png")
|
2012-08-18 14:46:17 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
if (jx~=2 and jy~=2 and jz==2) or (jx~=2 and jy==2 and jz~=2) then
|
|
|
|
table.remove(outimgs, 3)
|
|
|
|
table.remove(outimgs, 3)
|
2013-01-06 03:14:09 +01:00
|
|
|
table.insert(outimgs, 3, pipeworks_liquid_texture.."^pipeworks_windowed_XXXXX.png")
|
|
|
|
table.insert(outimgs, 3, pipeworks_liquid_texture.."^pipeworks_windowed_XXXXX.png")
|
2012-08-18 14:46:17 +02:00
|
|
|
end
|
|
|
|
|
2012-08-19 07:56:30 +02:00
|
|
|
local pname = xm..xp..ym..yp..zm..zp
|
|
|
|
local pgroups = ""
|
2012-08-06 03:29:59 +02:00
|
|
|
|
2012-08-19 03:24:30 +02:00
|
|
|
if pname ~= "110000" then
|
|
|
|
pgroups = {snappy=3, pipe=1, not_in_creative_inventory=1}
|
|
|
|
pipedesc = "Pipe segment (empty, "..pname..")... You hacker, you."
|
2013-03-19 03:00:00 +01:00
|
|
|
image = "pipeworks_plain.png"
|
2012-08-19 03:24:30 +02:00
|
|
|
else
|
|
|
|
pgroups = {snappy=3, pipe=1}
|
|
|
|
pipedesc = "Pipe segment"
|
2013-03-19 03:00:00 +01:00
|
|
|
image = nil
|
2012-08-19 03:24:30 +02:00
|
|
|
end
|
|
|
|
|
2012-08-18 14:46:17 +02:00
|
|
|
minetest.register_node("pipeworks:pipe_"..pname.."_empty", {
|
2012-08-19 03:24:30 +02:00
|
|
|
description = pipedesc,
|
2012-08-06 03:29:59 +02:00
|
|
|
drawtype = "nodebox",
|
2012-08-24 19:39:29 +02:00
|
|
|
tiles = pipes_fix_image_names(outimgs, "_empty"),
|
2013-03-19 03:00:00 +01:00
|
|
|
inventory_image = image,
|
2013-06-10 01:19:28 +02:00
|
|
|
sunlight_propagates=true,
|
2012-08-06 03:29:59 +02:00
|
|
|
paramtype = "light",
|
2012-08-06 04:52:18 +02:00
|
|
|
selection_box = {
|
2012-08-18 14:46:17 +02:00
|
|
|
type = "fixed",
|
|
|
|
fixed = outsel
|
2012-08-06 04:52:18 +02:00
|
|
|
},
|
2012-08-06 03:29:59 +02:00
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
2012-08-18 14:46:17 +02:00
|
|
|
fixed = outboxes
|
2012-08-06 03:29:59 +02:00
|
|
|
},
|
2012-08-19 03:24:30 +02:00
|
|
|
groups = pgroups,
|
2012-08-06 03:29:59 +02:00
|
|
|
sounds = default.node_sound_wood_defaults(),
|
|
|
|
walkable = true,
|
2012-08-18 14:46:17 +02:00
|
|
|
drop = "pipeworks:pipe_110000_empty",
|
2012-08-19 09:48:34 +02:00
|
|
|
pipelike=1,
|
|
|
|
on_construct = function(pos)
|
2013-01-04 06:15:23 +01:00
|
|
|
local meta = minetest.env:get_meta(pos)
|
|
|
|
meta:set_int("pipelike",1)
|
2012-08-19 09:48:34 +02:00
|
|
|
end,
|
2012-08-18 14:46:17 +02:00
|
|
|
after_place_node = function(pos)
|
2012-08-21 20:32:44 +02:00
|
|
|
pipe_scanforobjects(pos)
|
2012-08-18 14:46:17 +02:00
|
|
|
end,
|
|
|
|
after_dig_node = function(pos)
|
2012-08-21 20:32:44 +02:00
|
|
|
pipe_scanforobjects(pos)
|
2012-08-24 16:31:18 +02:00
|
|
|
end,
|
2012-08-06 03:29:59 +02:00
|
|
|
})
|
|
|
|
|
2012-08-18 14:46:17 +02:00
|
|
|
minetest.register_node("pipeworks:pipe_"..pname.."_loaded", {
|
2012-08-19 03:24:30 +02:00
|
|
|
description = "Pipe segment (loaded, "..pname..")... You hacker, you.",
|
2012-08-06 03:29:59 +02:00
|
|
|
drawtype = "nodebox",
|
2012-08-24 19:39:29 +02:00
|
|
|
tiles = pipes_fix_image_names(outimgs, "_loaded"),
|
2013-03-19 03:00:00 +01:00
|
|
|
inventory_image = image,
|
2013-06-10 01:19:28 +02:00
|
|
|
sunlight_propagates = true,
|
2012-08-06 03:29:59 +02:00
|
|
|
paramtype = "light",
|
2012-08-06 04:52:18 +02:00
|
|
|
selection_box = {
|
2012-08-18 14:46:17 +02:00
|
|
|
type = "fixed",
|
|
|
|
fixed = outsel
|
|
|
|
},
|
2012-08-06 03:29:59 +02:00
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
2012-08-18 14:46:17 +02:00
|
|
|
fixed = outboxes
|
2012-08-06 03:29:59 +02:00
|
|
|
},
|
2012-08-19 03:24:30 +02:00
|
|
|
groups = {snappy=3, pipe=1, not_in_creative_inventory=1},
|
2012-08-06 03:29:59 +02:00
|
|
|
sounds = default.node_sound_wood_defaults(),
|
|
|
|
walkable = true,
|
2013-01-01 22:30:21 +01:00
|
|
|
drop = "pipeworks:pipe_110000_empty",
|
2012-08-19 09:48:34 +02:00
|
|
|
pipelike=1,
|
|
|
|
on_construct = function(pos)
|
2013-01-04 06:15:23 +01:00
|
|
|
local meta = minetest.env:get_meta(pos)
|
|
|
|
meta:set_int("pipelike",1)
|
2012-08-19 09:48:34 +02:00
|
|
|
end,
|
2012-08-18 14:46:17 +02:00
|
|
|
after_place_node = function(pos)
|
2012-08-21 20:32:44 +02:00
|
|
|
pipe_scanforobjects(pos)
|
2012-08-18 14:46:17 +02:00
|
|
|
end,
|
|
|
|
after_dig_node = function(pos)
|
2012-08-21 20:32:44 +02:00
|
|
|
pipe_scanforobjects(pos)
|
2012-08-18 14:46:17 +02:00
|
|
|
end
|
2012-08-06 03:29:59 +02:00
|
|
|
})
|
2013-01-04 07:34:25 +01:00
|
|
|
table.insert(pipes_empty_nodenames,"pipeworks:pipe_"..pname.."_empty") -- for the abms
|
|
|
|
table.insert(pipes_full_nodenames,"pipeworks:pipe_"..pname.."_loaded") -- for bacon
|
2012-08-06 03:29:59 +02:00
|
|
|
end
|
2012-08-18 14:46:17 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2013-06-22 23:51:57 +02:00
|
|
|
local modpath = minetest.get_modpath("pipeworks")
|
|
|
|
|
|
|
|
dofile(modpath.."/tubes.lua")
|
|
|
|
dofile(modpath.."/teleport_tube.lua")
|
|
|
|
dofile(modpath.."/devices.lua")
|
|
|
|
dofile(modpath.."/autoplace.lua")
|
|
|
|
dofile(modpath.."/crafts.lua")
|
|
|
|
dofile(modpath.."/flowing_logic.lua")
|
|
|
|
dofile(modpath.."/compat.lua")
|
|
|
|
dofile(modpath.."/item_transport.lua")
|
|
|
|
dofile(modpath.."/autocrafter.lua")
|
2013-06-24 01:15:31 +02:00
|
|
|
dofile(modpath.."/deployer.lua")
|
|
|
|
dofile(modpath.."/node_breaker.lua")
|
2013-02-01 00:49:47 +01:00
|
|
|
|
2012-08-06 03:29:59 +02:00
|
|
|
print("Pipeworks loaded!")
|