Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions autocrafter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -511,10 +511,6 @@ minetest.register_node("pipeworks:autocrafter", {
local inv = meta:get_inventory()
return (inv:is_empty("src") and inv:is_empty("dst"))
end,
after_place_node = pipeworks.scan_for_tube_objects,
after_dig_node = function(pos)
pipeworks.scan_for_tube_objects(pos)
end,
on_destruct = function(pos)
autocrafterCache[minetest.hash_node_position(pos)] = nil
end,
Expand Down
139 changes: 0 additions & 139 deletions autoplace_tubes.lua

This file was deleted.

35 changes: 3 additions & 32 deletions chests.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ pipeworks.chests = {}
-- @param connect_sides: which directions the chests shall connect to
function pipeworks.override_chest(chestname, override, connect_sides)
local old_def = minetest.registered_nodes[chestname]
local nodebox_connection = {}

local tube_entry = "^pipeworks_tube_connection_wooden.png"
override.tiles = override.tiles or old_def.tiles
Expand All @@ -22,6 +23,7 @@ function pipeworks.override_chest(chestname, override, connect_sides)
local tile_directions = {"top", "bottom", "right", "left", "back", "front"}
for i, direction in ipairs(tile_directions) do
if connect_sides[direction] then
table.insert( nodebox_connection, direction )
if type(override.tiles[i]) == "string" then
override.tiles[i] = override.tiles[i] .. tube_entry
elseif type(override.tiles[i]) == "table" and not override.tiles[i].animation then
Expand All @@ -30,38 +32,6 @@ function pipeworks.override_chest(chestname, override, connect_sides)
end
end

local old_after_place_node = override.after_place_node or old_def.after_place_node or function() end
override.after_place_node = function(pos, placer, itemstack, pointed_thing)
old_after_place_node(pos, placer, itemstack, pointed_thing)
pipeworks.after_place(pos)
end

local old_after_dig = override.after_dig or old_def.after_dig_node or function() end
override.after_dig_node = function(pos, oldnode, oldmetadata, digger)
old_after_dig(pos, oldnode, oldmetadata, digger)
pipeworks.after_dig(pos, oldnode, oldmetadata, digger)
end

local old_on_rotate
if override.on_rotate ~= nil then
old_on_rotate = override.on_rotate
elseif old_def.on_rotate ~= nil then
old_on_rotate = old_def.on_rotate
else
old_on_rotate = function() end
end
-- on_rotate = false -> rotation disabled, no need to update tubes
-- everything else: undefined by the most common screwdriver mods
if type(old_on_rotate) == "function" then
override.on_rotate = function(pos, node, user, mode, new_param2)
if old_on_rotate(pos, node, user, mode, new_param2) ~= false then
return pipeworks.on_rotate(pos, node, user, mode, new_param2)
else
return false
end
end
end

override.tube = {
insert_object = function(pos, node, stack, direction)
local meta = minetest.get_meta(pos)
Expand All @@ -84,6 +54,7 @@ function pipeworks.override_chest(chestname, override, connect_sides)
override.groups = override.groups or old_def.groups or {}
override.groups.tubedevice = 1
override.groups.tubedevice_receiver = 1
override.connect_sides = nodebox_connection

minetest.override_item(chestname, override)
pipeworks.chests[chestname] = true
Expand Down
8 changes: 2 additions & 6 deletions compat-furnaces.lua
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,7 @@ local override = {
connect_sides = {left = 1, right = 1, back = 1, bottom = 1, top = 1}
},

after_place_node = pipeworks.after_place,
after_dig_node = pipeworks.after_dig,
on_rotate = pipeworks.on_rotate
connect_sides = {"left", "right", "back", "bottom", "top"}
}

local override_active = {
Expand Down Expand Up @@ -113,9 +111,7 @@ local override_active = {
connect_sides = {left = 1, right = 1, back = 1, bottom = 1, top = 1}
},

after_place_node = pipeworks.after_place,
after_dig_node = pipeworks.after_dig,
on_rotate = pipeworks.on_rotate
connect_sides = {"left", "right", "back", "bottom", "top"}
}

if minetest.get_modpath("default") then
Expand Down
4 changes: 1 addition & 3 deletions filter-injector.lua
Original file line number Diff line number Diff line change
Expand Up @@ -425,10 +425,7 @@ for _, data in ipairs({
end,
after_place_node = function (pos, placer)
minetest.get_meta(pos):set_string("owner", placer:get_player_name())
pipeworks.after_place(pos)
end,
after_dig_node = pipeworks.after_dig,
on_rotate = pipeworks.on_rotate,
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
if not pipeworks.may_configure(pos, player) then
return 0
Expand All @@ -452,6 +449,7 @@ for _, data in ipairs({
return count
end,
tube = {connect_sides = {right = 1}},
connect_sides = {"right"},
}

if data.digiline then
Expand Down
1 change: 0 additions & 1 deletion init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ end
dofile(pipeworks.modpath.."/common.lua")
dofile(pipeworks.modpath.."/models.lua")
dofile(pipeworks.modpath.."/autoplace_pipes.lua")
dofile(pipeworks.modpath.."/autoplace_tubes.lua")
dofile(pipeworks.modpath.."/luaentity.lua")
dofile(pipeworks.modpath.."/item_transport.lua")
dofile(pipeworks.modpath.."/flowing_logic.lua")
Expand Down
1 change: 0 additions & 1 deletion item_transport.lua
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ function pipeworks.break_tube(pos)
local meta = minetest.get_meta(pos)
meta:set_string("the_tube_was", minetest.serialize(node))
minetest.swap_node(pos, {name = "pipeworks:broken_tube_1"})
pipeworks.scan_for_tube_objects(pos)
end

local crunch_tube = function(pos, cnode, cmeta)
Expand Down
38 changes: 2 additions & 36 deletions mcl_furnaces.lua
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,9 @@ override.tube = {
end
end,
input_inventory = "dst",
connect_sides = {left = 1, right = 1, back = 1, bottom = 1, top = 1}
connect_sides = {left = 1, right = 1, back = 1, bottom = 1, top = 1},
}

override.after_place_node = function(pos, placer, itemstack, pointed_thing)
pipeworks.after_place(pos, placer, itemstack, pointed_thing)
end

override.after_dig_node = function(pos, oldnode, oldmetadata, digger)
old_furnace.after_dig_node(pos, oldnode, oldmetadata, digger)
pipeworks.after_dig(pos)
end

override.on_metadata_inventory_take = function(pos, listname, index, stack, player)
if listname == "dst" then
if stack:get_name() == "mcl_core:iron_ingot" then
Expand All @@ -99,8 +90,7 @@ override.on_metadata_inventory_take = function(pos, listname, index, stack, play
end
end

override.on_rotate = pipeworks.on_rotate

override.connect_sides = {"left", "right", "back", "bottom", "top"}

local override_active = table.copy(override)

Expand Down Expand Up @@ -188,15 +178,6 @@ override_blast_furnace.tube = {
connect_sides = {left = 1, right = 1, back = 1, bottom = 1, top = 1}
}

override_blast_furnace.after_place_node = function(pos, placer, itemstack, pointed_thing)
pipeworks.after_place(pos, placer, itemstack, pointed_thing)
end

override_blast_furnace.after_dig_node = function(pos, oldnode, oldmetadata, digger)
old_blast_furnace.after_dig_node(pos, oldnode, oldmetadata, digger)
pipeworks.after_dig(pos)
end

override_blast_furnace.on_metadata_inventory_take = function(pos, listname, index, stack, player)
-- Award smelting achievements
if listname == "dst" then
Expand All @@ -207,9 +188,6 @@ override_blast_furnace.on_metadata_inventory_take = function(pos, listname, inde
end
end

override_blast_furnace.on_rotate = pipeworks.on_rotate


local override_blast_active = table.copy(override)

override_blast_active.tiles = {
Expand Down Expand Up @@ -299,15 +277,6 @@ override_smoker.tube = {
connect_sides = {left = 1, right = 1, back = 1, bottom = 1, top = 1}
}

override_smoker.after_place_node = function(pos, placer, itemstack, pointed_thing)
pipeworks.after_place(pos, placer, itemstack, pointed_thing)
end

override_smoker.after_dig_node = function(pos, oldnode, oldmetadata, digger)
old_smoker.after_dig_node(pos, oldnode, oldmetadata, digger)
pipeworks.after_dig(pos)
end

override_smoker.on_metadata_inventory_take = function(pos, listname, index, stack, player)
-- Award fish achievements
if listname == "dst" then
Expand All @@ -318,9 +287,6 @@ override_smoker.on_metadata_inventory_take = function(pos, listname, index, stac
end
end

override_smoker.on_rotate = pipeworks.on_rotate


local override_smoker_active = table.copy(override)

override_smoker_active.tiles = {
Expand Down
Binary file modified textures/pipeworks_accelerator_tube_plain.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified textures/pipeworks_broken_tube_plain.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified textures/pipeworks_conductor_tube_on_plain.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified textures/pipeworks_conductor_tube_plain.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified textures/pipeworks_crossing_tube_plain.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified textures/pipeworks_detector_tube_plain.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified textures/pipeworks_digiline_conductor_tube_plain.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified textures/pipeworks_digiline_detector_tube_plain.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified textures/pipeworks_mese_sand_tube_plain.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified textures/pipeworks_mese_tube_plain_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified textures/pipeworks_mese_tube_plain_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified textures/pipeworks_mese_tube_plain_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified textures/pipeworks_mese_tube_plain_4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified textures/pipeworks_mese_tube_plain_5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified textures/pipeworks_mese_tube_plain_6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added textures/pipeworks_one_way_tube.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added textures/pipeworks_one_way_tube_port.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added textures/pipeworks_pane.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified textures/pipeworks_pane_embedded_tube_sides.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified textures/pipeworks_sand_tube_plain.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified textures/pipeworks_tag_tube_plain_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified textures/pipeworks_tag_tube_plain_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified textures/pipeworks_tag_tube_plain_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified textures/pipeworks_tag_tube_plain_4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified textures/pipeworks_tag_tube_plain_5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified textures/pipeworks_tag_tube_plain_6.png
Binary file modified textures/pipeworks_teleport_tube_plain.png
Binary file modified textures/pipeworks_tube_plain.png
7 changes: 3 additions & 4 deletions trashcan.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
local S = minetest.get_translator("pipeworks")
minetest.register_node("pipeworks:trashcan", {
local voidname = "pipeworks:trashcan"
minetest.register_node(voidname, {
description = S("Trash Can"),
drawtype = "normal",
tiles = {
Expand Down Expand Up @@ -43,10 +44,8 @@ minetest.register_node("pipeworks:trashcan", {
meta:set_string("infotext", S("Trash Can"))
meta:get_inventory():set_size("trash", 1)
end,
after_place_node = pipeworks.after_place,
after_dig_node = pipeworks.after_dig,
on_metadata_inventory_put = function(pos, listname, index, stack, player)
minetest.get_meta(pos):get_inventory():set_stack(listname, index, ItemStack(""))
end,
})
pipeworks.ui_cat_tube_list[#pipeworks.ui_cat_tube_list+1] = "pipeworks:trashcan"
pipeworks.ui_cat_tube_list[#pipeworks.ui_cat_tube_list+1] = voidname
3 changes: 0 additions & 3 deletions tubes/embedded_tube.lua
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@ function pipeworks.register_embedded_tube(nodename, opts)
return vector.equals(dir, direction) or vector.equals(vector.multiply(dir, -1), direction)
end
},
after_place_node = pipeworks.after_place,
after_dig_node = pipeworks.after_dig,
on_rotate = pipeworks.on_rotate,
})

minetest.register_craft( {
Expand Down
Loading