add compatibility with the hopper mod, via the API I just added over in a fork of the hopper mod. Hopefully this API will be merged.

This commit is contained in:
FaceDeer 2017-01-13 01:17:05 -07:00
parent 9da077c9ef
commit 11ceefa358
3 changed files with 19 additions and 2 deletions

@ -233,7 +233,7 @@ end
-- Rotates 90 degrees widdershins around the axis defined by facedir (which in this case is pointing out the front of the node, so it needs to be converted into an upward-pointing axis internally)
function DigtronLayout.rotate_layout_image(self, facedir)
-- To convert this into the direction the "top" of the axel node is pointing in:
-- To convert this into the direction the "top" of the axle node is pointing in:
-- 0, 1, 2, 3 == (0,1,0)
-- 4, 5, 6, 7 == (0,0,1)
-- 8, 9, 10, 11 == (0,0,-1)

1
mod.conf Normal file

@ -0,0 +1 @@
name = digtron

@ -230,5 +230,21 @@ minetest.register_node("digtron:combined_storage",
after_place_node = (function() if minetest.get_modpath("pipeworks") then return pipeworks.after_place end end)(),
after_dig_node = (function() if minetest.get_modpath("pipeworks") then return pipeworks.after_dig end end)()
})
-- Hopper compatibility
if minetest.get_modpath("hopper") and hopper ~= nil and hopper.add_source ~= nil and hopper.add_destination ~= nil then
hopper.add_source("hopper:hopper", "digtron:inventory", "main")
hopper.add_source("hopper:hopper", "digtron:fuelstore", "fuel")
hopper.add_source("hopper:hopper", "digtron:combined_storage", "main")
hopper.add_destination("hopper:hopper", "digtron:inventory", "main")
hopper.add_destination("hopper:hopper", "digtron:fuelstore", "fuel")
hopper.add_destination("hopper:hopper", "digtron:combined_storage", "main")
hopper.add_source("hopper:hopper_side", "digtron:inventory", "main")
hopper.add_source("hopper:hopper_side", "digtron:fuelstore", "fuel")
hopper.add_source("hopper:hopper_side", "digtron:combined_storage", "main")
hopper.add_destination("hopper:hopper_side", "digtron:inventory", "main")
hopper.add_destination("hopper:hopper_side", "digtron:fuelstore", "fuel")
hopper.add_destination("hopper:hopper_side", "digtron:combined_storage", "fuel")
end