1
0
Fork 0

Add potions/brewing to creative inventory

This commit is contained in:
Brandon 2020-06-28 09:38:06 -04:00
parent abd1b682cb
commit 44ee9cde86
5 changed files with 37 additions and 39 deletions

View File

@ -10,10 +10,8 @@ local inventory_lists = {}
local show_armor = minetest.get_modpath("mcl_armor") ~= nil local show_armor = minetest.get_modpath("mcl_armor") ~= nil
local mod_player = minetest.get_modpath("mcl_player") ~= nil local mod_player = minetest.get_modpath("mcl_player") ~= nil
-- 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","mobs",--[["brew",]]"matr","misc","all"} local builtin_filter_ids = {"blocks","deco","redstone","rail","food","tools","combat","mobs","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
@ -67,11 +65,10 @@ do
table.insert(inventory_lists["mobs"], name) table.insert(inventory_lists["mobs"], name)
nonmisc = true nonmisc = true
end end
-- TODO: add brew if def.groups.brewitem then
--if def.groups.brewitem then table.insert(inventory_lists["brew"], name)
--table.insert(inventory_lists["brew"], name) nonmisc = true
--nonmisc = true end
--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
@ -182,6 +179,7 @@ next_noffset("blocks")
next_noffset("deco") next_noffset("deco")
next_noffset("redstone") next_noffset("redstone")
next_noffset("rail") next_noffset("rail")
next_noffset("brew")
next_noffset("misc") next_noffset("misc")
next_noffset("nix", true) next_noffset("nix", true)
@ -193,7 +191,6 @@ next_noffset("food")
next_noffset("tools") next_noffset("tools")
next_noffset("combat") next_noffset("combat")
next_noffset("mobs") next_noffset("mobs")
--next_noffset("brew") -- TODO: add brew
next_noffset("matr") next_noffset("matr")
next_noffset("inv", true) next_noffset("inv", true)
@ -206,6 +203,7 @@ hoch["blocks"] = ""
hoch["deco"] = "" hoch["deco"] = ""
hoch["redstone"] = "" hoch["redstone"] = ""
hoch["rail"] = "" hoch["rail"] = ""
hoch["brew"] = ""
hoch["misc"] = "" hoch["misc"] = ""
hoch["nix"] = "" hoch["nix"] = ""
hoch["default"] = "" hoch["default"] = ""
@ -213,7 +211,6 @@ hoch["food"] = "_down"
hoch["tools"] = "_down" hoch["tools"] = "_down"
hoch["combat"] = "_down" hoch["combat"] = "_down"
hoch["mobs"] = "_down" hoch["mobs"] = "_down"
--hoch["brew"] = "_down" -- TODO: add brew
hoch["matr"] = "_down" hoch["matr"] = "_down"
hoch["inv"] = "_down" hoch["inv"] = "_down"
@ -228,7 +225,7 @@ filtername["food"] = S("Foodstuffs")
filtername["tools"] = S("Tools") filtername["tools"] = S("Tools")
filtername["combat"] = S("Combat") filtername["combat"] = S("Combat")
filtername["mobs"] = S("Mobs") filtername["mobs"] = S("Mobs")
--filtername["brew"] = S("Brewing") -- TODO: add brew filtername["brew"] = S("Brewing")
filtername["matr"] = S("Materials") filtername["matr"] = S("Materials")
filtername["inv"] = S("Survival Inventory") filtername["inv"] = S("Survival Inventory")
@ -245,7 +242,7 @@ local function reset_menu_item_bg()
bg["tools"] = dark_bg bg["tools"] = dark_bg
bg["combat"] = dark_bg bg["combat"] = dark_bg
bg["mobs"] = dark_bg bg["mobs"] = dark_bg
--bg["brew"] = dark_bg -- TODO: add brew bg["brew"] = dark_bg
bg["matr"] = dark_bg bg["matr"] = dark_bg
bg["inv"] = dark_bg bg["inv"] = dark_bg
bg["default"] = dark_bg bg["default"] = dark_bg
@ -377,7 +374,7 @@ mcl_inventory.set_creative_formspec = function(player, start_i, pagenum, inv_siz
tools = "mcl_core:axe_iron", tools = "mcl_core:axe_iron",
combat = "mcl_core:sword_gold", combat = "mcl_core:sword_gold",
mobs = "mobs_mc:cow", mobs = "mobs_mc:cow",
brew = "mcl_potions:potion_water", brew = "mcl_potions:water",
matr = "mcl_core:stick", matr = "mcl_core:stick",
inv = "mcl_chests:chest", inv = "mcl_chests:chest",
} }
@ -428,9 +425,8 @@ mcl_inventory.set_creative_formspec = function(player, start_i, pagenum, inv_siz
"tooltip[combat;"..F(filtername["combat"]).."]".. "tooltip[combat;"..F(filtername["combat"]).."]"..
tab(name, "mobs") .. tab(name, "mobs") ..
"tooltip[mobs;"..F(filtername["mobs"]).."]".. "tooltip[mobs;"..F(filtername["mobs"]).."]"..
-- TODO: Add brew tab(name, "brew") ..
--tab(name, "brew") .. "tooltip[brew;"..F(filtername["brew"]).."]"..
--"tooltip[brew;"..F(filtername["brew"]).."]"..
tab(name, "matr") .. tab(name, "matr") ..
"tooltip[matr;"..F(filtername["matr"]).."]".. "tooltip[matr;"..F(filtername["matr"]).."]"..
tab(name, "inv") .. tab(name, "inv") ..
@ -504,12 +500,10 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
if players[name].page == "mobs" then return end if players[name].page == "mobs" then return end
set_inv_page("mobs",player) set_inv_page("mobs",player)
page = "mobs" page = "mobs"
--[[ 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

@ -3,3 +3,5 @@ mcl_formspec
mcl_player? mcl_player?
_mcl_autogroup? _mcl_autogroup?
mcl_armor? mcl_armor?
mcl_brewing?
mcl_potions?

View File

@ -384,7 +384,7 @@ minetest.register_node("mcl_brewing:stand_000", {
_doc_items_longdesc = S("The stand allows you to brew potions!"), _doc_items_longdesc = S("The stand allows you to brew potions!"),
_doc_items_usagehelp = doc_string, _doc_items_usagehelp = doc_string,
_tt_help = S("Brew Potions"), _tt_help = S("Brew Potions"),
groups = {pickaxey=1, material_stone=1, falling_node=1, crush_after_fall=1, deco_block=1, brewing_stand=1, not_in_creative_inventory = 0, not_in_craft_guide = 0}, groups = {pickaxey=1, material_stone=1, falling_node=1, crush_after_fall=1, brewitem=1, not_in_creative_inventory = 0, not_in_craft_guide = 0},
tiles = tiles, tiles = tiles,
drop = "mcl_brewing:stand", drop = "mcl_brewing:stand",
paramtype = "light", paramtype = "light",
@ -469,7 +469,7 @@ minetest.register_node("mcl_brewing:stand_100", {
_doc_items_longdesc = S("The stand allows you to brew potions!"), _doc_items_longdesc = S("The stand allows you to brew potions!"),
_doc_items_usagehelp = doc_string, _doc_items_usagehelp = doc_string,
_tt_help = S("Brew Potions"), _tt_help = S("Brew Potions"),
groups = {pickaxey=1, material_stone=1, falling_node=1, crush_after_fall=1, deco_block=1, brewing_stand=1, not_in_creative_inventory = 1, not_in_craft_guide = 1}, groups = {pickaxey=1, material_stone=1, falling_node=1, crush_after_fall=1, brewitem=1, not_in_creative_inventory = 1, not_in_craft_guide = 1},
tiles = tiles, tiles = tiles,
drop = "mcl_brewing:stand", drop = "mcl_brewing:stand",
paramtype = "light", paramtype = "light",
@ -553,7 +553,7 @@ minetest.register_node("mcl_brewing:stand_010", {
_doc_items_longdesc = S("The stand allows you to brew potions!"), _doc_items_longdesc = S("The stand allows you to brew potions!"),
_doc_items_usagehelp = doc_string, _doc_items_usagehelp = doc_string,
_tt_help = S("Brew Potions"), _tt_help = S("Brew Potions"),
groups = {pickaxey=1, material_stone=1, falling_node=1, crush_after_fall=1, deco_block=1, brewing_stand=1, not_in_creative_inventory = 1, not_in_craft_guide = 1}, groups = {pickaxey=1, material_stone=1, falling_node=1, crush_after_fall=1, brewitem=1, not_in_creative_inventory = 1, not_in_craft_guide = 1},
tiles = tiles, tiles = tiles,
drop = "mcl_brewing:stand", drop = "mcl_brewing:stand",
paramtype = "light", paramtype = "light",
@ -637,7 +637,7 @@ minetest.register_node("mcl_brewing:stand_001", {
_doc_items_longdesc = S("The stand allows you to brew potions!"), _doc_items_longdesc = S("The stand allows you to brew potions!"),
_doc_items_usagehelp = doc_string, _doc_items_usagehelp = doc_string,
_tt_help = S("Brew Potions"), _tt_help = S("Brew Potions"),
groups = {pickaxey=1, material_stone=1, falling_node=1, crush_after_fall=1, deco_block=1, brewing_stand=1, not_in_creative_inventory = 1, not_in_craft_guide = 1}, groups = {pickaxey=1, material_stone=1, falling_node=1, crush_after_fall=1, brewitem=1, not_in_creative_inventory = 1, not_in_craft_guide = 1},
tiles = tiles, tiles = tiles,
drop = "mcl_brewing:stand", drop = "mcl_brewing:stand",
paramtype = "light", paramtype = "light",
@ -721,7 +721,7 @@ minetest.register_node("mcl_brewing:stand_110", {
_doc_items_longdesc = S("The stand allows you to brew potions!"), _doc_items_longdesc = S("The stand allows you to brew potions!"),
_doc_items_usagehelp = doc_string, _doc_items_usagehelp = doc_string,
_tt_help = S("Brew Potions"), _tt_help = S("Brew Potions"),
groups = {pickaxey=1, material_stone=1, falling_node=1, crush_after_fall=1, deco_block=1, brewing_stand=1, not_in_creative_inventory = 1, not_in_craft_guide = 1}, groups = {pickaxey=1, material_stone=1, falling_node=1, crush_after_fall=1, brewitem=1, not_in_creative_inventory = 1, not_in_craft_guide = 1},
tiles = tiles, tiles = tiles,
drop = "mcl_brewing:stand", drop = "mcl_brewing:stand",
paramtype = "light", paramtype = "light",
@ -805,7 +805,7 @@ minetest.register_node("mcl_brewing:stand_101", {
_doc_items_longdesc = S("The stand allows you to brew potions!"), _doc_items_longdesc = S("The stand allows you to brew potions!"),
_doc_items_usagehelp = doc_string, _doc_items_usagehelp = doc_string,
_tt_help = S("Brew Potions"), _tt_help = S("Brew Potions"),
groups = {pickaxey=1, material_stone=1, falling_node=1, crush_after_fall=1, deco_block=1, brewing_stand=1, not_in_creative_inventory = 1, not_in_craft_guide = 1}, groups = {pickaxey=1, material_stone=1, falling_node=1, crush_after_fall=1, brewitem=1, not_in_creative_inventory = 1, not_in_craft_guide = 1},
tiles = tiles, tiles = tiles,
drop = "mcl_brewing:stand", drop = "mcl_brewing:stand",
paramtype = "light", paramtype = "light",
@ -889,7 +889,7 @@ minetest.register_node("mcl_brewing:stand_011", {
_doc_items_longdesc = S("The stand allows you to brew potions!"), _doc_items_longdesc = S("The stand allows you to brew potions!"),
_doc_items_usagehelp = doc_string, _doc_items_usagehelp = doc_string,
_tt_help = S("Brew Potions"), _tt_help = S("Brew Potions"),
groups = {pickaxey=1, material_stone=1, falling_node=1, crush_after_fall=1, deco_block=1, brewing_stand=1, not_in_creative_inventory = 1, not_in_craft_guide = 1}, groups = {pickaxey=1, material_stone=1, falling_node=1, crush_after_fall=1, brewitem=1, not_in_creative_inventory = 1, not_in_craft_guide = 1},
tiles = tiles, tiles = tiles,
drop = "mcl_brewing:stand", drop = "mcl_brewing:stand",
paramtype = "light", paramtype = "light",
@ -973,7 +973,7 @@ minetest.register_node("mcl_brewing:stand_111", {
_doc_items_longdesc = S("The stand allows you to brew potions!"), _doc_items_longdesc = S("The stand allows you to brew potions!"),
_doc_items_usagehelp = doc_string, _doc_items_usagehelp = doc_string,
_tt_help = S("Brew Potions"), _tt_help = S("Brew Potions"),
groups = {pickaxey=1, material_stone=1, falling_node=1, crush_after_fall=1, deco_block=1, brewing_stand=1, not_in_creative_inventory = 1, not_in_craft_guide = 1}, groups = {pickaxey=1, material_stone=1, falling_node=1, crush_after_fall=1, brewitem=1, not_in_creative_inventory = 1, not_in_craft_guide = 1},
tiles = tiles, tiles = tiles,
drop = "mcl_brewing:stand", drop = "mcl_brewing:stand",
paramtype = "light", paramtype = "light",

View File

@ -70,6 +70,7 @@ local function register_lingering(name, descr, color, def)
minetest.register_craftitem(id, { minetest.register_craftitem(id, {
description = descr, description = descr,
inventory_image = lingering_image(color), inventory_image = lingering_image(color),
groups = {brewitem=1, not_in_creative_inventory=0},
on_use = function(item, placer, pointed_thing) on_use = function(item, placer, pointed_thing)
local velocity = 10 local velocity = 10
local dir = placer:get_look_dir(); local dir = placer:get_look_dir();

View File

@ -12,6 +12,7 @@ local function register_splash(name, descr, color, def)
minetest.register_craftitem(id, { minetest.register_craftitem(id, {
description = descr, description = descr,
inventory_image = splash_image(color), inventory_image = splash_image(color),
groups = {brewitem=1, not_in_creative_inventory=0},
on_use = function(item, placer, pointed_thing) on_use = function(item, placer, pointed_thing)
local velocity = 10 local velocity = 10
local dir = placer:get_look_dir(); local dir = placer:get_look_dir();