2019-04-28 22:34:21 +03:00
|
|
|
--[[
|
|
|
|
|
|
|
|
TechAge
|
|
|
|
=======
|
|
|
|
|
|
|
|
Copyright (C) 2019 Joachim Stolberg
|
|
|
|
|
2019-08-22 21:49:47 +03:00
|
|
|
GPL v3
|
2019-04-28 22:34:21 +03:00
|
|
|
See LICENSE.txt for more information
|
|
|
|
|
|
|
|
All items disappear.
|
|
|
|
|
|
|
|
]]--
|
|
|
|
|
2019-07-02 22:33:12 +03:00
|
|
|
local S = techage.S
|
|
|
|
|
2019-04-28 22:34:21 +03:00
|
|
|
minetest.register_node("techage:blackhole", {
|
2019-07-02 22:33:12 +03:00
|
|
|
description = S("Techage Black Hole"),
|
2019-04-28 22:34:21 +03:00
|
|
|
tiles = {
|
|
|
|
-- up, down, right, left, back, front
|
2019-04-28 22:51:26 +03:00
|
|
|
"techage_filling_ta2.png^techage_frame_ta2.png",
|
|
|
|
"techage_filling_ta2.png^techage_frame_ta2.png",
|
|
|
|
"techage_filling_ta2.png^techage_frame_ta2.png^techage_appl_blackhole.png",
|
|
|
|
"techage_filling_ta2.png^techage_frame_ta2.png^techage_appl_blackhole.png^techage_appl_inp.png",
|
|
|
|
"techage_filling_ta2.png^techage_frame_ta2.png^techage_appl_blackhole.png",
|
|
|
|
"techage_filling_ta2.png^techage_frame_ta2.png^techage_appl_blackhole.png",
|
2019-04-28 22:34:21 +03:00
|
|
|
},
|
|
|
|
|
|
|
|
after_place_node = function(pos, placer)
|
|
|
|
local meta = minetest.get_meta(pos)
|
|
|
|
local node = minetest.get_node(pos)
|
|
|
|
meta:set_int("push_dir", techage.side_to_indir("L", node.param2))
|
2019-07-02 22:33:12 +03:00
|
|
|
meta:set_string("infotext", S("Techage Black Hole (let items disappear)"))
|
2019-04-28 22:34:21 +03:00
|
|
|
end,
|
|
|
|
|
|
|
|
on_rotate = screwdriver.disallow,
|
|
|
|
paramtype2 = "facedir",
|
|
|
|
groups = {choppy=2, cracky=2, crumbly=2},
|
|
|
|
is_ground_content = false,
|
|
|
|
sounds = default.node_sound_wood_defaults(),
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
output = "techage:blackhole",
|
|
|
|
recipe = {
|
2019-04-28 22:51:26 +03:00
|
|
|
{"group:wood", "", "group:wood"},
|
2019-06-17 22:24:48 +03:00
|
|
|
{"techage:tubeS", "default:coal_lump", ""},
|
2019-04-28 22:51:26 +03:00
|
|
|
{"group:wood", "techage:iron_ingot", "group:wood"},
|
2019-04-28 22:34:21 +03:00
|
|
|
},
|
|
|
|
})
|
|
|
|
|
2019-06-08 23:57:01 +03:00
|
|
|
techage.register_node({"techage:blackhole"}, {
|
2019-04-28 22:34:21 +03:00
|
|
|
on_pull_item = nil, -- not needed
|
|
|
|
on_unpull_item = nil, -- not needed
|
|
|
|
|
|
|
|
on_push_item = function(pos, in_dir, stack)
|
|
|
|
local meta = minetest.get_meta(pos)
|
|
|
|
if meta:get_int("push_dir") == in_dir then
|
|
|
|
return true
|
|
|
|
end
|
|
|
|
end,
|
|
|
|
})
|
2019-07-02 22:33:12 +03:00
|
|
|
|
|
|
|
techage.register_entry_page("ta", "blackhole",
|
|
|
|
S("Techage Black Hole"),
|
|
|
|
S("The Techage Black Hole Block let items disappear. If your machine produces to much or unneeded items, push them into the Black Hole."),
|
|
|
|
"techage:blackhole")
|
|
|
|
|