From f3dafb5b6a82255a795972637377320f64c019b9 Mon Sep 17 00:00:00 2001 From: LNJ Date: Mon, 17 Apr 2017 16:04:16 +0200 Subject: Add Drawer Upgrades Yey, they're finally there! :) This will add steel, gold, obsidian and diamond upgrades for MTG and iron, gold, obsidian, diamond and emerald upgrades for MCL2. You can add them to a drawer by rightclicking it and adding them to the new drawer's upgrade inventory. --- init.lua | 99 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 98 insertions(+), 1 deletion(-) (limited to 'init.lua') diff --git a/init.lua b/init.lua index 41da496..2df4b18 100755 --- a/init.lua +++ b/init.lua @@ -51,8 +51,17 @@ drawers.enable_1x1 = not core.setting_getbool("drawers_disable_1x1") drawers.enable_1x2 = not core.setting_getbool("drawers_disable_1x2") drawers.enable_2x2 = not core.setting_getbool("drawers_disable_2x2") + +-- +-- GUI +-- + +drawers.gui_bg = "bgcolor[#080808BB;true]" +drawers.gui_bg_img = "background[5,5;1,1;gui_formbg.png;true]" +drawers.gui_slots = "listcolors[#00000069;#5A5A5A;#141318;#30434C;#FFF]" + -- --- Load files +-- Load API -- dofile(MP .. "/lua/helpers.lua") @@ -230,3 +239,91 @@ else }) end + +-- +-- Register drawer upgrades +-- + +if core.get_modpath("default") and default then + drawers.register_drawer_upgrade("drawers:upgrade_steel", { + description = S("Steel Drawer Upgrade (x2)"), + inventory_image = "drawers_upgrade_steel.png", + groups = {drawer_upgrade = 100}, + recipe_item = "default:steel_ingot" + }) + + drawers.register_drawer_upgrade("drawers:upgrade_gold", { + description = S("Gold Drawer Upgrade (x3)"), + inventory_image = "drawers_upgrade_gold.png", + groups = {drawer_upgrade = 200}, + recipe_item = "default:gold_ingot" + }) + + drawers.register_drawer_upgrade("drawers:upgrade_obsidian", { + description = S("Obsidian Drawer Upgrade (x5)"), + inventory_image = "drawers_upgrade_obsidian.png", + groups = {drawer_upgrade = 400}, + recipe_item = "default:obsidian" + }) + + drawers.register_drawer_upgrade("drawers:upgrade_diamond", { + description = S("Diamond Drawer Upgrade (x8)"), + inventory_image = "drawers_upgrade_diamond.png", + groups = {drawer_upgrade = 700}, + recipe_item = "default:diamond" + }) +elseif core.get_modpath("mcl_core") and mcl_core then + drawers.register_drawer_upgrade("drawers:upgrade_iron", { + description = S("Iron Drawer Upgrade (x2)"), + inventory_image = "drawers_upgrade_iron.png", + groups = {drawer_upgrade = 100}, + recipe_item = "mcl_core:iron_ingot" + }) + + drawers.register_drawer_upgrade("drawers:upgrade_gold", { + description = S("Gold Drawer Upgrade (x3)"), + inventory_image = "drawers_upgrade_gold.png", + groups = {drawer_upgrade = 200}, + recipe_item = "mcl_core:gold_ingot" + }) + + drawers.register_drawer_upgrade("drawers:upgrade_obsidian", { + description = S("Obsidian Drawer Upgrade (x5)"), + inventory_image = "drawers_upgrade_obsidian.png", + groups = {drawer_upgrade = 400}, + recipe_item = "mcl_core:obsidian" + }) + + drawers.register_drawer_upgrade("drawers:upgrade_diamond", { + description = S("Diamond Drawer Upgrade (x8)"), + inventory_image = "drawers_upgrade_diamond.png", + groups = {drawer_upgrade = 700}, + recipe_item = "mcl_core:diamond" + }) + + drawers.register_drawer_upgrade("drawers:upgrade_emerald", { + description = S("Emerald Drawer Upgrade (x13)"), + inventory_image = "drawers_upgrade_emerald.png", + groups = {drawer_upgrade = 1200}, + recipe_item = "mcl_core:emerald" + }) +end + + +-- +-- Register drawer upgrade template +-- + +core.register_craftitem("drawers:upgrade_template", { + description = S("Drawer Upgrade Template"), + inventory_image = "drawers_upgrade_template.png" +}) + +core.register_craft({ + output = "drawers:upgrade_template 4", + recipe = { + {"group:stick", "group:stick", "group:stick"}, + {"group:stick", "group:drawer", "group:stick"}, + {"group:stick", "group:stick", "group:stick"} + } +}) -- cgit v1.2.3