Hide "useless" items from creative and craft guide

This commit is contained in:
Wuzzy 2019-02-06 10:57:23 +01:00
parent 37b9b6fbfc
commit 66c99efb2f
5 changed files with 47 additions and 28 deletions

View file

@ -43,7 +43,10 @@ mobs:register_mob("mobs_mc:ghast", {
chance = 1, chance = 1,
min = 0, min = 0,
max = 2,}, max = 2,},
{name = mobs_mc.items.ghast_tear, -- TODO: drop tear when it's useful
-- ghast tear replaced with gunpowder
--{name = mobs_mc.items.ghast_tear,
{name = mobs_mc.items.gunpowder,
chance = 1, chance = 1,
min = 0, min = 0,
max = 1,}, max = 1,},

View file

@ -34,7 +34,8 @@ local rabbit = {
drops = { drops = {
{name = mobs_mc.items.rabbit_raw, chance = 1, min = 0, max = 1}, {name = mobs_mc.items.rabbit_raw, chance = 1, min = 0, max = 1},
{name = mobs_mc.items.rabbit_hide, chance = 1, min = 0, max = 1}, {name = mobs_mc.items.rabbit_hide, chance = 1, min = 0, max = 1},
{name = mobs_mc.items.rabbit_foot, chance = 10, min = 1, max = 1}, -- TODO: Drop rabbit's foot when it's useful
--{name = mobs_mc.items.rabbit_foot, chance = 10, min = 1, max = 1},
}, },
water_damage = 1, water_damage = 1,
lava_damage = 4, lava_damage = 4,

View file

@ -4,8 +4,10 @@ local players = {}
-- Containing all the items for each Creative Mode tab -- Containing all the items for each Creative Mode tab
local inventory_lists = {} local inventory_lists = {}
-- TODO: Brewing is disabled. Add brewing (uncommented code) when it is implemented properly
-- Create tables -- Create tables
local builtin_filter_ids = {"blocks","deco","redstone","rail","food","tools","combat","brew","matr","misc","all"} local builtin_filter_ids = {"blocks","deco","redstone","rail","food","tools","combat",--[["brew",]]"matr","misc","all"}
for _, f in pairs(builtin_filter_ids) do for _, f in pairs(builtin_filter_ids) do
inventory_lists[f] = {} inventory_lists[f] = {}
end end
@ -55,10 +57,11 @@ do
table.insert(inventory_lists["combat"], name) table.insert(inventory_lists["combat"], name)
nonmisc = true nonmisc = true
end end
if def.groups.brewitem then -- TODO: add brew
table.insert(inventory_lists["brew"], name) --if def.groups.brewitem then
nonmisc = true --table.insert(inventory_lists["brew"], name)
end --nonmisc = true
--end
if def.groups.craftitem then if def.groups.craftitem then
table.insert(inventory_lists["matr"], name) table.insert(inventory_lists["matr"], name)
nonmisc = true nonmisc = true
@ -178,7 +181,7 @@ noffset_y = 8.12
next_noffset("food") next_noffset("food")
next_noffset("tools") next_noffset("tools")
next_noffset("combat") next_noffset("combat")
next_noffset("brew") --next_noffset("brew") -- TODO: add brew
next_noffset("matr") next_noffset("matr")
next_noffset("inv", true) next_noffset("inv", true)
@ -197,7 +200,7 @@ hoch["default"] = ""
hoch["food"] = "^[transformfy" hoch["food"] = "^[transformfy"
hoch["tools"] = "^[transformfy" hoch["tools"] = "^[transformfy"
hoch["combat"] = "^[transformfy" hoch["combat"] = "^[transformfy"
hoch["brew"] = "^[transformfy" --hoch["brew"] = "^[transformfy" -- TODO: add brew
hoch["matr"] = "^[transformfy" hoch["matr"] = "^[transformfy"
hoch["inv"] = "^[transformfy" hoch["inv"] = "^[transformfy"
@ -213,7 +216,7 @@ local function reset_menu_item_bg()
bg["food"] = dark_bg bg["food"] = dark_bg
bg["tools"] = dark_bg bg["tools"] = dark_bg
bg["combat"] = dark_bg bg["combat"] = dark_bg
bg["brew"] = dark_bg --bg["brew"] = dark_bg -- TODO: add brew
bg["matr"] = dark_bg bg["matr"] = dark_bg
bg["inv"] = dark_bg bg["inv"] = dark_bg
bg["default"] = dark_bg bg["default"] = dark_bg
@ -380,8 +383,9 @@ mcl_inventory.set_creative_formspec = function(player, start_i, pagenum, inv_siz
"tooltip[tools;Tools]".. "tooltip[tools;Tools]"..
tab(name, "combat") .. tab(name, "combat") ..
"tooltip[combat;Combat]".. "tooltip[combat;Combat]"..
tab(name, "brew") .. -- TODO: Add brew
"tooltip[brew;Brewing]".. --tab(name, "brew") ..
--"tooltip[brew;Brewing]"..
tab(name, "matr") .. tab(name, "matr") ..
"tooltip[matr;Materials]".. "tooltip[matr;Materials]"..
tab(name, "inv") .. tab(name, "inv") ..
@ -450,10 +454,12 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
if players[name].page == "combat" then return end if players[name].page == "combat" then return end
set_inv_page("combat",player) set_inv_page("combat",player)
page = "combat" page = "combat"
--[[ TODO: add brew
elseif fields.brew then elseif fields.brew then
if players[name].page == "brew" then return end if players[name].page == "brew" then return end
set_inv_page("brew",player) set_inv_page("brew",player)
page = "brew" page = "brew"
]]
elseif fields.matr then elseif fields.matr then
if players[name].page == "matr" then return end if players[name].page == "matr" then return end
set_inv_page("matr",player) set_inv_page("matr",player)

View file

@ -198,7 +198,7 @@ minetest.register_craftitem("mcl_mobitems:blaze_powder", {
_doc_items_longdesc = "This item is mainly used for crafting.", _doc_items_longdesc = "This item is mainly used for crafting.",
wield_image = "mcl_mobitems_blaze_powder.png", wield_image = "mcl_mobitems_blaze_powder.png",
inventory_image = "mcl_mobitems_blaze_powder.png", inventory_image = "mcl_mobitems_blaze_powder.png",
groups = { brewitem = 1 }, groups = { craftitem = 1, brewitem = 1 },
stack_max = 64, stack_max = 64,
}) })
@ -207,25 +207,27 @@ minetest.register_craftitem("mcl_mobitems:magma_cream", {
_doc_items_longdesc = "Magma cream is a crafting component.", _doc_items_longdesc = "Magma cream is a crafting component.",
wield_image = "mcl_mobitems_magma_cream.png", wield_image = "mcl_mobitems_magma_cream.png",
inventory_image = "mcl_mobitems_magma_cream.png", inventory_image = "mcl_mobitems_magma_cream.png",
groups = { brewitem = 1 }, groups = { craftitem = 1, brewitem = 1 },
stack_max = 64, stack_max = 64,
}) })
minetest.register_craftitem("mcl_mobitems:ghast_tear", { minetest.register_craftitem("mcl_mobitems:ghast_tear", {
description = "Ghast Tear", description = "Ghast Tear",
_doc_items_longdesc = "A ghast tear is dropped from dead ghasts. It has no purpose yet.", _doc_items_longdesc = "Place this item in an item frame as decoration.",
wield_image = "mcl_mobitems_ghast_tear.png", wield_image = "mcl_mobitems_ghast_tear.png",
inventory_image = "mcl_mobitems_ghast_tear.png", inventory_image = "mcl_mobitems_ghast_tear.png",
groups = { brewitem = 1 }, -- TODO: Reveal item when it's useful
groups = { brewitem = 1, not_in_creative_inventory = 1 },
stack_max = 64, stack_max = 64,
}) })
minetest.register_craftitem("mcl_mobitems:nether_star", { minetest.register_craftitem("mcl_mobitems:nether_star", {
description = "Nether Star", description = "Nether Star",
_doc_items_longdesc = "A nether star is a crafting component. It is dropped from the Wither.", _doc_items_longdesc = "A nether star is dropped when the Wither dies. Place it in an item frame to show the world how hardcore you are! Or just as decoration.",
wield_image = "mcl_mobitems_nether_star.png", wield_image = "mcl_mobitems_nether_star.png",
inventory_image = "mcl_mobitems_nether_star.png", inventory_image = "mcl_mobitems_nether_star.png",
groups = { craftitem = 1 }, -- TODO: Reveal item when it's useful
groups = { craftitem = 1, not_in_creative_inventory = 1 },
stack_max = 64, stack_max = 64,
}) })
@ -258,10 +260,11 @@ minetest.register_craftitem("mcl_mobitems:rabbit_hide", {
minetest.register_craftitem("mcl_mobitems:rabbit_foot", { minetest.register_craftitem("mcl_mobitems:rabbit_foot", {
description = "Rabbit's Foot", description = "Rabbit's Foot",
_doc_items_longdesc = "This item currently has no purpose.", _doc_items_longdesc = "Must be your lucky day! Place this item in an item frame for decoration.",
wield_image = "mcl_mobitems_rabbit_foot.png", wield_image = "mcl_mobitems_rabbit_foot.png",
inventory_image = "mcl_mobitems_rabbit_foot.png", inventory_image = "mcl_mobitems_rabbit_foot.png",
groups = { brewitem = 1 }, -- TODO: Reveal item when it's useful
groups = { brewitem = 1, not_in_creative_inventory = 1 },
stack_max = 64, stack_max = 64,
}) })

View file

@ -1,11 +1,12 @@
local brewhelp = "This item currently has no purpose." local brewhelp = "Put this item in an item frame for decoration. It's useless otherwise."
minetest.register_craftitem("mcl_potions:fermented_spider_eye", { minetest.register_craftitem("mcl_potions:fermented_spider_eye", {
description = "Fermented Spider Eye", description = "Fermented Spider Eye",
_doc_items_longdesc = brewhelp, _doc_items_longdesc = brewhelp,
wield_image = "mcl_potions_spider_eye_fermented.png", wield_image = "mcl_potions_spider_eye_fermented.png",
inventory_image = "mcl_potions_spider_eye_fermented.png", inventory_image = "mcl_potions_spider_eye_fermented.png",
groups = { brewitem = 1 }, -- TODO: Reveal item when it's actually useful
groups = { brewitem = 1, not_in_creative_inventory = 1, not_in_craft_guide = 1 },
stack_max = 64, stack_max = 64,
}) })
@ -218,7 +219,8 @@ minetest.register_craftitem("mcl_potions:potion_awkward", {
stack_max = 1, stack_max = 1,
inventory_image = potion_image("#0000FF"), inventory_image = potion_image("#0000FF"),
wield_image = potion_image("#0000FF"), wield_image = potion_image("#0000FF"),
groups = {brewitem=1, food=3, can_eat_when_full=1}, -- TODO: Reveal item when it's actually useful
groups = {brewitem=1, food=3, can_eat_when_full=1, not_in_creative_inventory=1},
on_place = minetest.item_eat(0, "mcl_potions:glass_bottle"), on_place = minetest.item_eat(0, "mcl_potions:glass_bottle"),
on_secondary_use = minetest.item_eat(0, "mcl_potions:glass_bottle"), on_secondary_use = minetest.item_eat(0, "mcl_potions:glass_bottle"),
}) })
@ -229,7 +231,8 @@ minetest.register_craftitem("mcl_potions:potion_mundane", {
stack_max = 1, stack_max = 1,
inventory_image = potion_image("#0000FF"), inventory_image = potion_image("#0000FF"),
wield_image = potion_image("#0000FF"), wield_image = potion_image("#0000FF"),
groups = {brewitem=1, food=3, can_eat_when_full=1}, -- TODO: Reveal item when it's actually useful
groups = {brewitem=1, food=3, can_eat_when_full=1, not_in_creative_inventory=1 },
on_place = minetest.item_eat(0, "mcl_potions:glass_bottle"), on_place = minetest.item_eat(0, "mcl_potions:glass_bottle"),
on_secondary_use = minetest.item_eat(0, "mcl_potions:glass_bottle"), on_secondary_use = minetest.item_eat(0, "mcl_potions:glass_bottle"),
}) })
@ -240,16 +243,18 @@ minetest.register_craftitem("mcl_potions:potion_thick", {
stack_max = 1, stack_max = 1,
inventory_image = potion_image("#0000FF"), inventory_image = potion_image("#0000FF"),
wield_image = potion_image("#0000FF"), wield_image = potion_image("#0000FF"),
groups = {brewitem=1, food=3, can_eat_when_full=1}, -- TODO: Reveal item when it's actually useful
groups = {brewitem=1, food=3, can_eat_when_full=1, not_in_creative_inventory=1 },
on_place = minetest.item_eat(0, "mcl_potions:glass_bottle"), on_place = minetest.item_eat(0, "mcl_potions:glass_bottle"),
on_secondary_use = minetest.item_eat(0, "mcl_potions:glass_bottle"), on_secondary_use = minetest.item_eat(0, "mcl_potions:glass_bottle"),
}) })
minetest.register_craftitem("mcl_potions:speckled_melon", { minetest.register_craftitem("mcl_potions:speckled_melon", {
description = "Glistering Melon", description = "Glistering Melon",
_doc_items_longdesc = brewhelp, _doc_items_longdesc = "This shiny melon is full of tiny gold nuggets and would be nice in an item frame. It isn't edible and not useful for anything else.",
stack_max = 64, stack_max = 64,
groups = { brewitem = 1 }, -- TODO: Reveal item when it's actually useful
groups = { brewitem = 1, not_in_creative_inventory = 1, not_in_craft_guide = 1 },
inventory_image = "mcl_potions_melon_speckled.png", inventory_image = "mcl_potions_melon_speckled.png",
}) })
@ -267,6 +272,7 @@ minetest.register_craftitem("mcl_potions:dragon_breath", {
_doc_items_longdesc = brewhelp, _doc_items_longdesc = brewhelp,
wield_image = "mcl_potions_dragon_breath.png", wield_image = "mcl_potions_dragon_breath.png",
inventory_image = "mcl_potions_dragon_breath.png", inventory_image = "mcl_potions_dragon_breath.png",
groups = { brewitem = 1 }, -- TODO: Reveal item when it's actually useful
groups = { brewitem = 1, not_in_creative_inventory = 1 },
stack_max = 64, stack_max = 64,
}) })