make pipeworks Game agnostic (#16)

* make it boot in non mtg

* make water flow

* fix water texture warnings

* fix missing steel texture issues

* remove depreciated/unnessary default function calls

* make sounds work

* fix default formspec crashes

* fix wierd tab spacing

* additionally game dig group support

* move crafts to crafts.lua

* make crafts support various games
This commit is contained in:
wsor4035
2022-03-14 21:39:58 -04:00
committed by GitHub
parent 5618003be3
commit 5aa0501872
21 changed files with 466 additions and 328 deletions

View File

@ -42,7 +42,7 @@ local check_for_liquids_v2 = function(pos, limit)
for _, tpos in ipairs(coords) do
if total >= limit then break end
local name = minetest.get_node(tpos).name
if name == "default:water_source" then
if name == pipeworks.liquids.water.source then
minetest.remove_node(tpos)
total = total + 1
end
@ -247,9 +247,9 @@ flowlogic.helpers.make_neighbour_output_fixed = function(neighbours)
-- in non-finite mode, pressure has to be sustained to keep the sources there.
-- so in non-finite mode, placing water is dependent on the target node;
-- draining pressure is not.
local canplace = (name == "air") or (name == "default:water_flowing")
local canplace = (name == "air") or (name == pipeworks.liquids.water.flowing)
if canplace then
minetest.swap_node(npos, {name="default:water_source"})
minetest.swap_node(npos, {name=pipeworks.liquids.water.source})
end
if (not finitemode) or canplace then
taken = taken + 1
@ -268,7 +268,7 @@ flowlogic.helpers.make_neighbour_cleanup_fixed = function(neighbours)
for _, offset in pairs(neighbours) do
local npos = vector.add(pos, offset)
local name = minetest.get_node(npos).name
if (name == "default:water_source") then
if (name == pipeworks.liquids.water.source) then
--pipeworks.logger("neighbour_cleanup_fixed removing "..formatvec(npos))
minetest.remove_node(npos)
end