init.lua 637 B

1234567891011121314151617181920212223
  1. local modname = minetest.get_current_modname()
  2. local S = minetest.get_translator(modname)
  3. local inventory =
  4. {
  5. "formspec_version[2]",
  6. "size[10,8.5]",
  7. "list[current_player;main;0.1,3.5;8,4]",
  8. "label[1,0.7;" .. S("Crafting") .. "]",
  9. "list[current_player;craft;1,1;1,1]",
  10. "image[2.1,1.1;0.8,0.8;" .. modname .. "_arrow.png]",
  11. "list[current_player;craftpreview;3,1;1,1]",
  12. }
  13. inventory = table.concat(inventory)
  14. minetest.register_on_joinplayer(function(player)
  15. local inv = player:get_inventory()
  16. inv:set_size("main", 32)
  17. inv:set_size("craftpreview", 1)
  18. inv:set_size("craft", 1)
  19. player:set_inventory_formspec(inventory)
  20. end)