diff options
Diffstat (limited to 'unified_inventory/bags.lua')
-rw-r--r-- | unified_inventory/bags.lua | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/unified_inventory/bags.lua b/unified_inventory/bags.lua index b0ec4b8..4d269db 100644 --- a/unified_inventory/bags.lua +++ b/unified_inventory/bags.lua @@ -1,20 +1,15 @@ ---[[ +-- Bags for Minetest -Bags for Minetest +-- Copyright (c) 2012 cornernote, Brett O'Donnell <cornernote@gmail.com> +-- License: GPLv3 -Copyright (c) 2012 cornernote, Brett O'Donnell <cornernote@gmail.com> -Source Code: https://github.com/cornernote/minetest-particles -License: GPLv3 - -]]-- - --- register_on_joinplayer minetest.register_on_joinplayer(function(player) local player_inv = player:get_inventory() local bags_inv = minetest.create_detached_inventory(player:get_player_name().."_bags",{ on_put = function(inv, listname, index, stack, player) player:get_inventory():set_stack(listname, index, stack) - player:get_inventory():set_size(listname.."contents", stack:get_definition().groups.bagslots) + player:get_inventory():set_size(listname.."contents", + stack:get_definition().groups.bagslots) end, on_take = function(inv, listname, index, stack, player) player:get_inventory():set_stack(listname, index, nil) @@ -41,7 +36,7 @@ minetest.register_on_joinplayer(function(player) local bag = "bag"..i player_inv:set_size(bag, 1) bags_inv:set_size(bag, 1) - bags_inv:set_stack(bag,1,player_inv:get_stack(bag,1)) + bags_inv:set_stack(bag, 1, player_inv:get_stack(bag, 1)) end end) @@ -51,11 +46,13 @@ minetest.register_tool("unified_inventory:bag_small", { inventory_image = "bags_small.png", groups = {bagslots=8}, }) + minetest.register_tool("unified_inventory:bag_medium", { description = "Medium Bag", inventory_image = "bags_medium.png", groups = {bagslots=16}, }) + minetest.register_tool("unified_inventory:bag_large", { description = "Large Bag", inventory_image = "bags_large.png", @@ -66,24 +63,27 @@ minetest.register_tool("unified_inventory:bag_large", { minetest.register_craft({ output = "unified_inventory:bag_small", recipe = { - {"", "default:stick", ""}, - {"default:wood", "default:wood", "default:wood"}, - {"default:wood", "default:wood", "default:wood"}, - }, + {"", "default:stick", ""}, + {"group:wood", "group:wood", "group:wood"}, + {"group:wood", "group:wood", "group:wood"}, + }, }) + minetest.register_craft({ output = "unified_inventory:bag_medium", recipe = { - {"", "default:stick", ""}, - {"unified_inventory:bag_small", "unified_inventory:bag_small", "unified_inventory:bag_small"}, - {"unified_inventory:bag_small", "unified_inventory:bag_small", "unified_inventory:bag_small"}, - }, + {"", "", ""}, + {"default:stick", "unified_inventory:bag_small", "default:stick"}, + {"default:stick", "unified_inventory:bag_small", "default:stick"}, + }, }) + minetest.register_craft({ output = "unified_inventory:bag_large", recipe = { - {"", "default:stick", ""}, - {"unified_inventory:bag_medium", "unified_inventory:bag_medium", "unified_inventory:bag_medium"}, - {"unified_inventory:bag_medium", "unified_inventory:bag_medium", "unified_inventory:bag_medium"}, + {"", "", ""}, + {"default:stick", "unified_inventory:bag_medium", "default:stick"}, + {"default:stick", "unified_inventory:bag_medium", "default:stick"}, }, }) + |