more_chests/wifi.lua
Megaf 4aa3219574 Removed Pipeworks compatibility.
It seems like this chest can not use pipeworks.
When one connect a filter to it and punch or signal the filter it will cause the server to crash.
```
17:27:24: ACTION[ServerThread]: Megaf joins game. List of players: Megaf
17:27:37: ACTION[ServerThread]: Megaf places node pipeworks:filter at (5,7,-17)
17:27:37: ACTION[ServerThread]: facedir: 3
17:27:39: ERROR[main]: ERROR: An unhandled exception occurred: ...minetest/Server/bin/../mods/pipeworks/item_transport.lua:54: bad argument #1 to 'ipairs' (table expected, got nil
)
17:27:39: ERROR[main]: stack traceback:
17:27:39: ERROR[main]:  [C]: in function 'ipairs'
17:27:39: ERROR[main]:  ...minetest/Server/bin/../mods/pipeworks/item_transport.lua:54: in function 'grabAndFire'
17:27:39: ERROR[main]:  ...minetest/Server/bin/../mods/pipeworks/item_transport.lua:150: in function 'punch_filter'
17:27:39: ERROR[main]:  ...minetest/Server/bin/../mods/pipeworks/item_transport.lua:214: in function <...minetest/Server/bin/../mods/pipeworks/item_transport.lua:213>

In thread b693c220:
/home/minetest/Server/src/main.cpp:1955: int main(int, char**): Assertion '0' failed.
Debug stacks:
DEBUG STACK FOR THREAD b23ff440:
#0  virtual void* CurlFetchThread::Thread()
DEBUG STACK FOR THREAD b693c220:
#0  int main(int, char**)
(Leftover data: #1  Dedicated server branch)
(Leftover data: #2  virtual void ServerMap::save(ModifiedState))
(Leftover data: #3  void ItemStack::serialize(std::ostream&) const)
Aborted
```
2014-10-02 21:46:19 +01:00

47 lines
1.7 KiB
Lua

minetest.register_node("more_chests:wifi", {
description = "Wifi Chest",
tiles = {"wifi_top.png", "wifi_top.png", "wifi_side.png",
"wifi_side.png", "wifi_side.png",
{name="wifi_front_animated.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=2.0}}
},
paramtype2 = "facedir",
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2,},
legacy_facedir_simple = true,
sounds = default.node_sound_wood_defaults(),
on_construct = function(pos)
local meta = minetest.env:get_meta(pos)
meta:set_string("formspec",
"size[8,9]"..
"list[current_player;more_chests:wifi;0,0;8,4;]"..
"list[current_player;main;0,5;8,4;]")
meta:set_string("infotext", "Wifi Chest")
end,
on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
minetest.log("action", player:get_player_name()..
" moves stuff in wifi chest at "..minetest.pos_to_string(pos))
end,
on_metadata_inventory_put = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name()..
" moves stuff to wifi chest at "..minetest.pos_to_string(pos))
end,
on_metadata_inventory_take = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name()..
" takes stuff from wifi chest at "..minetest.pos_to_string(pos))
end,
})
minetest.register_craft({
output = 'more_chests:wifi',
recipe = {
{'default:wood','default:mese','default:wood'},
{'default:wood','default:steel_ingot','default:wood'},
{'default:wood','default:wood','default:wood'}
}
})
minetest.register_on_joinplayer(function(player)
local inv = player:get_inventory()
inv:set_size("more_chests:wifi", 8*4)
end)