forked from mrkubax10/industrialtest
Begin implementing compatibility with Pipeworks mod
This commit is contained in:
parent
a5ef9eca00
commit
d800a22fe0
@ -12,6 +12,9 @@ Currently IndustrialTest supports following games:
|
||||
- MineClone2
|
||||
- none
|
||||
|
||||
## Optional dependencies
|
||||
- [Pipeworks](https://content.minetest.net/packages/VanessaE/pipeworks)
|
||||
|
||||
## Contributors
|
||||
- mrkubax10 <mrkubax10@onet.pl or mrkubax10 at irc.libera.chat> [programming, some graphics]
|
||||
- LuanHawk <Discord: LuanHawk#8733> [lead graphics]
|
||||
|
52
compat/pipeworks.lua
Normal file
52
compat/pipeworks.lua
Normal file
@ -0,0 +1,52 @@
|
||||
-- IndustrialTest
|
||||
-- Copyright (C) 2024 mrkubax10
|
||||
|
||||
-- This program is free software: you can redistribute it and/or modify
|
||||
-- it under the terms of the GNU General Public License as published by
|
||||
-- the Free Software Foundation, either version 3 of the License, or
|
||||
-- (at your option) any later version.
|
||||
|
||||
-- This program is distributed in the hope that it will be useful,
|
||||
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
-- GNU General Public License for more details.
|
||||
|
||||
-- You should have received a copy of the GNU General Public License
|
||||
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
-- Iron Furnace
|
||||
local def=table.copy(minetest.registered_nodes["industrialtest:iron_furnace"])
|
||||
|
||||
def.groups.tubedevice=1
|
||||
def.groups.tubedevice_receiver=1
|
||||
|
||||
local override={
|
||||
groups=def.groups,
|
||||
tube={
|
||||
insert_object=function(pos,node,stack,direction)
|
||||
local meta=minetest.get_meta(pos)
|
||||
local inv=meta:get_inventory()
|
||||
local result=inv:add_item(direction.y==1 and "fuel" or "src",stack)
|
||||
minetest.get_node_timer(pos):start(industrialtest.updateDelay)
|
||||
return result
|
||||
end,
|
||||
can_insert=function(pos,node,stack,direction)
|
||||
local meta=minetest.get_meta(pos)
|
||||
local inv=meta:get_inventory()
|
||||
return inv:room_for_item(direction.y==1 and "fuel" or "src",stack)
|
||||
end,
|
||||
input_inventory="dst",
|
||||
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
|
||||
}
|
||||
minetest.override_item("industrialtest:iron_furnace",override)
|
||||
minetest.override_item("industrialtest:iron_furnace_active",override)
|
@ -39,8 +39,9 @@ if industrialtest.mtgAvailable then
|
||||
elseif industrialtest.mclAvailable then
|
||||
industrialtest.mods.mclRubber=minetest.get_modpath("mcl_rubber")
|
||||
end
|
||||
industrialtest.mods.pipeworks=minetest.get_modpath("pipeworks")
|
||||
|
||||
if industrialtest.mtgAvailable and not industrialtest then
|
||||
if industrialtest.mtgAvailable and not industrialtest.mods._3dArmor then
|
||||
error("IndustrialTest requires 3D Armor when used with Minetest Game")
|
||||
end
|
||||
|
||||
|
5
init.lua
5
init.lua
@ -74,3 +74,8 @@ dofile(modpath.."/cables.lua")
|
||||
dofile(modpath.."/mapgen.lua")
|
||||
dofile(modpath.."/uu_matter_crafts.lua")
|
||||
dofile(modpath.."/crafts.lua")
|
||||
|
||||
-- compatibility with other mods
|
||||
if industrialtest.mods.pipeworks then
|
||||
dofile(modpath.."/compat/pipeworks.lua")
|
||||
end
|
||||
|
2
mod.conf
2
mod.conf
@ -1,5 +1,5 @@
|
||||
name=industrialtest
|
||||
description=Adds various machinery
|
||||
optional_depends=default,bucket,3d_armor,mcl_core,mcl_copper,mcl_armor,mcl_deepslate,mcl_nether,mcl_buckets
|
||||
optional_depends=default,bucket,3d_armor,mcl_core,mcl_copper,mcl_armor,mcl_deepslate,mcl_nether,mcl_buckets,pipeworks
|
||||
author=IndustrialTest Team
|
||||
title=IndustrialTest
|
Loading…
Reference in New Issue
Block a user