mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-11-28 13:53:45 +01:00
Creative inventory using new potions API
-creative inventory utilizes the new potions API -the new fancy tooltips are used there
This commit is contained in:
parent
ef2ce7e0d7
commit
6d927ab1a1
@ -105,7 +105,13 @@ minetest.register_on_mods_loaded(function()
|
||||
nonmisc = true
|
||||
end
|
||||
if def.groups.brewitem then
|
||||
table.insert(inventory_lists["brew"], name)
|
||||
local str = name
|
||||
if def.groups._mcl_potion == 1 then
|
||||
local stack = ItemStack(name)
|
||||
tt.reload_itemstack_description(stack)
|
||||
str = stack:to_string()
|
||||
end
|
||||
table.insert(inventory_lists["brew"], str)
|
||||
nonmisc = true
|
||||
end
|
||||
if def.groups.craftitem then
|
||||
@ -117,6 +123,21 @@ minetest.register_on_mods_loaded(function()
|
||||
table.insert(inventory_lists["misc"], name)
|
||||
end
|
||||
|
||||
if def.groups._mcl_potion == 1 then
|
||||
if def.has_potent then
|
||||
local stack = ItemStack(name)
|
||||
stack:get_meta():set_int("mcl_potions:potion_potent", 1)
|
||||
tt.reload_itemstack_description(stack)
|
||||
table.insert(inventory_lists["brew"], stack:to_string())
|
||||
end
|
||||
if def.has_plus then
|
||||
local stack = ItemStack(name)
|
||||
stack:get_meta():set_int("mcl_potions:potion_plus", 1)
|
||||
tt.reload_itemstack_description(stack)
|
||||
table.insert(inventory_lists["brew"], stack:to_string())
|
||||
end
|
||||
end
|
||||
|
||||
table.insert(inventory_lists["all"], name)
|
||||
end
|
||||
end
|
||||
|
@ -2,4 +2,4 @@ name = mcl_inventory
|
||||
author = BlockMen
|
||||
description = Adds the player inventory and creative inventory.
|
||||
depends = mcl_init, mcl_formspec, mcl_enchanting, mcl_gamemode
|
||||
optional_depends = mcl_armor, mcl_brewing, mcl_potions, mcl_enchanting, mcl_craftguide, mcl_player
|
||||
optional_depends = mcl_armor, mcl_brewing, mcl_potions, mcl_enchanting, mcl_craftguide, mcl_player, tt
|
||||
|
Loading…
Reference in New Issue
Block a user