summaryrefslogtreecommitdiff
path: root/pipes.lua
diff options
context:
space:
mode:
Diffstat (limited to 'pipes.lua')
-rw-r--r--pipes.lua25
1 files changed, 9 insertions, 16 deletions
diff --git a/pipes.lua b/pipes.lua
index 602daab..82fadb1 100644
--- a/pipes.lua
+++ b/pipes.lua
@@ -7,6 +7,9 @@ local pipes_full_nodenames = {}
local new_flow_logic_register = pipeworks.flowables.register
+local polys = ""
+if pipeworks.enable_lowpoly then polys = "_lowpoly" end
+
local vti = {4, 3, 2, 1, 6, 5}
local cconnects = {{}, {1}, {1, 2}, {1, 3}, {1, 3, 5}, {1, 2, 3}, {1, 2, 3, 5}, {1, 2, 3, 4}, {1, 2, 3, 4, 5}, {1, 2, 3, 4, 5, 6}}
for index, connects in ipairs(cconnects) do
@@ -33,12 +36,10 @@ for index, connects in ipairs(cconnects) do
local pgroups = {snappy = 3, pipe = 1, not_in_creative_inventory = 1}
local pipedesc = "Pipe segement".." "..dump(connects).."... You hacker, you."
- local image = nil
if #connects == 0 then
pgroups = {snappy = 3, tube = 1}
pipedesc = "Pipe segment"
- image = "pipeworks_pipe_inv.png"
end
local outimg_e = { "pipeworks_pipe_plain.png" }
@@ -49,10 +50,10 @@ for index, connects in ipairs(cconnects) do
outimg_l = { "pipeworks_pipe_3_loaded.png" }
end
- local mesh = "pipeworks_pipe_"..index..".obj"
+ local mesh = "pipeworks_pipe_"..index..polys..".obj"
if index == 1 then
- mesh = "pipeworks_pipe_3.obj"
+ mesh = "pipeworks_pipe_3"..polys..".obj"
end
minetest.register_node("pipeworks:pipe_"..index.."_empty", {
@@ -61,8 +62,6 @@ for index, connects in ipairs(cconnects) do
mesh = mesh,
tiles = outimg_e,
sunlight_propagates = true,
- inventory_image = image,
- wield_image = image,
paramtype = "light",
paramtype2 = "facedir",
selection_box = {
@@ -135,8 +134,6 @@ if REGISTER_COMPATIBILITY then
drawtype = "airlike",
sunlight_propagates = true,
paramtype = "light",
- inventory_image = "pipeworks_pipe_inv.png",
- wield_image = "pipeworks_pipe_inv.png",
description = "Pipe Segment (legacy)",
groups = {not_in_creative_inventory = 1, pipe_to_update = 1},
drop = "pipeworks:pipe_1_empty",
@@ -150,7 +147,6 @@ if REGISTER_COMPATIBILITY then
drawtype = "airlike",
sunlight_propagates = true,
paramtype = "light",
- inventory_image = "pipeworks_pipe_inv.png",
groups = {not_in_creative_inventory = 1, pipe_to_update = 1},
drop = "pipeworks:pipe_1_empty",
after_place_node = function(pos)
@@ -188,35 +184,32 @@ if REGISTER_COMPATIBILITY then
})
end
-
-
local valve_on = "pipeworks:valve_on_empty"
local valve_off = "pipeworks:valve_off_empty"
local entry_panel_empty = "pipeworks:entry_panel_empty"
local flow_sensor_empty = "pipeworks:flow_sensor_empty"
+local sp_empty = "pipeworks:straight_pipe_empty"
-- XXX: why aren't these in devices.lua!?
table.insert(pipes_empty_nodenames, valve_on)
table.insert(pipes_empty_nodenames, valve_off)
table.insert(pipes_empty_nodenames, entry_panel_empty)
table.insert(pipes_empty_nodenames, flow_sensor_empty)
+table.insert(pipes_empty_nodenames, sp_empty)
local valve_on_loaded = "pipeworks:valve_on_loaded"
local entry_panel_loaded = "pipeworks:entry_panel_loaded"
local flow_sensor_loaded = "pipeworks:flow_sensor_loaded"
+local sp_loaded = "pipeworks:straight_pipe_loaded"
table.insert(pipes_full_nodenames, valve_on_loaded)
table.insert(pipes_full_nodenames, entry_panel_loaded)
table.insert(pipes_full_nodenames, flow_sensor_loaded)
+table.insert(pipes_full_nodenames, sp_loaded)
pipeworks.pipes_full_nodenames = pipes_full_nodenames
pipeworks.pipes_empty_nodenames = pipes_empty_nodenames
-
-
-
if pipeworks.toggles.pipe_mode == "classic" then
-
-
minetest.register_abm({
nodenames = pipes_empty_nodenames,
interval = 1,