mirror of
https://github.com/minetest-mods/unified_inventory.git
synced 2024-12-28 11:40: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)
|
||||
|
||||
-- register bag tools
|
||||
minetest.register_tool("unified_inventory:bag_small", {
|
||||
local register
|
||||
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"),
|
||||
inventory_image = "bags_small.png",
|
||||
groups = {bagslots=8},
|
||||
})
|
||||
|
||||
minetest.register_tool("unified_inventory:bag_medium", {
|
||||
register("unified_inventory:bag_medium", {
|
||||
description = S("Medium Bag"),
|
||||
inventory_image = "bags_medium.png",
|
||||
groups = {bagslots=16},
|
||||
})
|
||||
|
||||
minetest.register_tool("unified_inventory:bag_large", {
|
||||
register("unified_inventory:bag_large", {
|
||||
description = S("Large Bag"),
|
||||
inventory_image = "bags_large.png",
|
||||
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.
|
||||
# 0 disables this functionality.
|
||||
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