mirror of
https://github.com/minetest-mods/unified_inventory.git
synced 2024-12-29 04:00:24 +01:00
add setting to allow bags to stack, by registering as a craftitem instead of a tool.
This commit is contained in:
parent
e7d03626b4
commit
597234970a
15
bags.lua
15
bags.lua
@ -249,20 +249,27 @@ minetest.register_allow_player_inventory_action(function(player, action, invento
|
|||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
-- register bag tools
|
local register
|
||||||
minetest.register_tool("unified_inventory:bag_small", {
|
if minetest.settings:get_bool("unified_inventory_stackable_bags", false) then
|
||||||
|
register = minetest.register_craftitem
|
||||||
|
else
|
||||||
|
register = minetest.register_tool
|
||||||
|
end
|
||||||
|
|
||||||
|
-- register bags
|
||||||
|
register("unified_inventory:bag_small", {
|
||||||
description = S("Small Bag"),
|
description = S("Small Bag"),
|
||||||
inventory_image = "bags_small.png",
|
inventory_image = "bags_small.png",
|
||||||
groups = {bagslots=8},
|
groups = {bagslots=8},
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_tool("unified_inventory:bag_medium", {
|
register("unified_inventory:bag_medium", {
|
||||||
description = S("Medium Bag"),
|
description = S("Medium Bag"),
|
||||||
inventory_image = "bags_medium.png",
|
inventory_image = "bags_medium.png",
|
||||||
groups = {bagslots=16},
|
groups = {bagslots=16},
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_tool("unified_inventory:bag_large", {
|
register("unified_inventory:bag_large", {
|
||||||
description = S("Large Bag"),
|
description = S("Large Bag"),
|
||||||
inventory_image = "bags_large.png",
|
inventory_image = "bags_large.png",
|
||||||
groups = {bagslots=24},
|
groups = {bagslots=24},
|
||||||
|
@ -30,3 +30,6 @@ unified_inventory_only_names (HUD item name: first line only) bool true
|
|||||||
# Crops the shown description to the specified length.
|
# Crops the shown description to the specified length.
|
||||||
# 0 disables this functionality.
|
# 0 disables this functionality.
|
||||||
unified_inventory_max_item_name_length (HUD item names: character limit) int 80
|
unified_inventory_max_item_name_length (HUD item names: character limit) int 80
|
||||||
|
|
||||||
|
# If true, bags will be stackable to the default stack max
|
||||||
|
unified_inventory_stackable_bags (Stackable bags) bool false
|
||||||
|
Loading…
Reference in New Issue
Block a user