mirror of
https://github.com/joe7575/techpack.git
synced 2024-11-22 23:33:44 +01:00
Merge pull request #76 from oversword/issue-75
Implement valid sides for other nodes
This commit is contained in:
commit
d44a950eae
@ -76,15 +76,13 @@ tubelib.register_node("tubelib:blackhole", {}, {
|
|||||||
on_pull_item = nil, -- not needed
|
on_pull_item = nil, -- not needed
|
||||||
on_unpull_item = nil, -- not needed
|
on_unpull_item = nil, -- not needed
|
||||||
|
|
||||||
|
valid_sides = {"L"},
|
||||||
on_push_item = function(pos, side, item)
|
on_push_item = function(pos, side, item)
|
||||||
if side == "L" then
|
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
local disappeared = meta:get_int("disappeared") + item:get_count()
|
local disappeared = meta:get_int("disappeared") + item:get_count()
|
||||||
meta:set_int("disappeared", disappeared)
|
meta:set_int("disappeared", disappeared)
|
||||||
meta:set_string("infotext", disappeared.." "..S("items disappeared"))
|
meta:set_string("infotext", disappeared.." "..S("items disappeared"))
|
||||||
return true
|
return true
|
||||||
end
|
|
||||||
return false
|
|
||||||
end,
|
end,
|
||||||
|
|
||||||
on_recv_message = function(pos, topic, payload)
|
on_recv_message = function(pos, topic, payload)
|
||||||
|
@ -238,7 +238,7 @@ tubelib.register_node("tubelib:pusher",
|
|||||||
on_push_item = nil, -- pusher has no inventory
|
on_push_item = nil, -- pusher has no inventory
|
||||||
on_unpull_item = nil, -- pusher has no inventory
|
on_unpull_item = nil, -- pusher has no inventory
|
||||||
is_pusher = true, -- is a pulling/pushing node
|
is_pusher = true, -- is a pulling/pushing node
|
||||||
|
valid_sides = {"R","L"},
|
||||||
on_recv_message = function(pos, topic, payload)
|
on_recv_message = function(pos, topic, payload)
|
||||||
local resp = State:on_receive_message(pos, topic, payload)
|
local resp = State:on_receive_message(pos, topic, payload)
|
||||||
if resp then
|
if resp then
|
||||||
|
@ -132,6 +132,7 @@ minetest.register_craft({
|
|||||||
|
|
||||||
|
|
||||||
tubelib.register_node("tubelib_addons1:detector", {"tubelib_addons1:detector_active"}, {
|
tubelib.register_node("tubelib_addons1:detector", {"tubelib_addons1:detector_active"}, {
|
||||||
|
valid_sides = {"R","L"},
|
||||||
on_push_item = function(pos, side, item)
|
on_push_item = function(pos, side, item)
|
||||||
if side ~= "L" then return false end
|
if side ~= "L" then return false end
|
||||||
local player_name = minetest.get_meta(pos):get_string("player_name")
|
local player_name = minetest.get_meta(pos):get_string("player_name")
|
||||||
|
@ -139,6 +139,7 @@ minetest.register_craft({
|
|||||||
|
|
||||||
|
|
||||||
tubelib.register_node("tubelib_addons1:funnel", {}, {
|
tubelib.register_node("tubelib_addons1:funnel", {}, {
|
||||||
|
invalid_sides = {"U"},
|
||||||
on_pull_item = function(pos, side)
|
on_pull_item = function(pos, side)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
return tubelib.get_item(meta, "main")
|
return tubelib.get_item(meta, "main")
|
||||||
|
@ -281,6 +281,7 @@ minetest.register_craft({
|
|||||||
|
|
||||||
tubelib.register_node("tubelib_addons1:liquidsampler",
|
tubelib.register_node("tubelib_addons1:liquidsampler",
|
||||||
{"tubelib_addons1:liquidsampler_active", "tubelib_addons1:liquidsampler_defect"}, {
|
{"tubelib_addons1:liquidsampler_active", "tubelib_addons1:liquidsampler_defect"}, {
|
||||||
|
invalid_sides = {"L"},
|
||||||
on_pull_item = function(pos, side)
|
on_pull_item = function(pos, side)
|
||||||
return tubelib.get_item(M(pos), "dst")
|
return tubelib.get_item(M(pos), "dst")
|
||||||
end,
|
end,
|
||||||
|
@ -237,6 +237,7 @@ tubelib.register_node("tubelib_addons1:pusher_fast",
|
|||||||
on_push_item = nil, -- pusher has no inventory
|
on_push_item = nil, -- pusher has no inventory
|
||||||
on_unpull_item = nil, -- pusher has no inventory
|
on_unpull_item = nil, -- pusher has no inventory
|
||||||
is_pusher = true, -- is a pulling/pushing node
|
is_pusher = true, -- is a pulling/pushing node
|
||||||
|
valid_sides = {"R","L"},
|
||||||
|
|
||||||
on_recv_message = function(pos, topic, payload)
|
on_recv_message = function(pos, topic, payload)
|
||||||
local resp = State:on_receive_message(pos, topic, payload)
|
local resp = State:on_receive_message(pos, topic, payload)
|
||||||
|
@ -448,6 +448,7 @@ minetest.register_craft({
|
|||||||
|
|
||||||
tubelib.register_node("tubelib_addons1:quarry",
|
tubelib.register_node("tubelib_addons1:quarry",
|
||||||
{"tubelib_addons1:quarry_active", "tubelib_addons1:quarry_defect"}, {
|
{"tubelib_addons1:quarry_active", "tubelib_addons1:quarry_defect"}, {
|
||||||
|
invalid_sides = {"L"},
|
||||||
on_pull_item = function(pos, side)
|
on_pull_item = function(pos, side)
|
||||||
return tubelib.get_item(M(pos), "main")
|
return tubelib.get_item(M(pos), "main")
|
||||||
end,
|
end,
|
||||||
|
@ -141,6 +141,7 @@ minetest.register_craft({
|
|||||||
|
|
||||||
|
|
||||||
tubelib.register_node("tubelib_addons3:funnel", {}, {
|
tubelib.register_node("tubelib_addons3:funnel", {}, {
|
||||||
|
invalid_sides = {"U"},
|
||||||
on_pull_stack = function(pos, side)
|
on_pull_stack = function(pos, side)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
return tubelib.get_stack(meta, "main")
|
return tubelib.get_stack(meta, "main")
|
||||||
|
@ -219,6 +219,7 @@ minetest.register_craft({
|
|||||||
tubelib.register_node("tubelib_addons3:pusher",
|
tubelib.register_node("tubelib_addons3:pusher",
|
||||||
{"tubelib_addons3:pusher_active", "tubelib_addons3:pusher_defect"}, {
|
{"tubelib_addons3:pusher_active", "tubelib_addons3:pusher_defect"}, {
|
||||||
is_pusher = true, -- is a pulling/pushing node
|
is_pusher = true, -- is a pulling/pushing node
|
||||||
|
valid_sides = {"R","L"},
|
||||||
|
|
||||||
on_recv_message = function(pos, topic, payload)
|
on_recv_message = function(pos, topic, payload)
|
||||||
local resp = State:on_receive_message(pos, topic, payload)
|
local resp = State:on_receive_message(pos, topic, payload)
|
||||||
|
Loading…
Reference in New Issue
Block a user