technic/technic_chests/mithril_chest.lua

72 lines
1.7 KiB
Lua
Raw Normal View History

if minetest.get_modpath("moreores") then
minetest.register_craft({
output = 'technic:mithril_chest 1',
recipe = {
{'moreores:mithril_ingot','moreores:mithril_ingot','moreores:mithril_ingot'},
{'moreores:mithril_ingot','technic:gold_chest','moreores:mithril_ingot'},
{'moreores:mithril_ingot','moreores:mithril_ingot','moreores:mithril_ingot'},
}
})
2013-01-27 14:03:46 +01:00
minetest.register_craft({
output = 'technic:mithril_locked_chest 1',
recipe = {
{'moreores:mithril_ingot','moreores:mithril_ingot','moreores:mithril_ingot'},
{'moreores:mithril_ingot','technic:gold_locked_chest','moreores:mithril_ingot'},
{'moreores:mithril_ingot','moreores:mithril_ingot','moreores:mithril_ingot'},
}
})
end
2013-01-27 14:03:46 +01:00
minetest.register_craft({
output = 'technic:mithril_locked_chest 1',
type = "shapeless",
2013-01-27 14:03:46 +01:00
recipe = {
{'basic_materials:padlock'},
2013-01-27 14:03:46 +01:00
{'technic:mithril_chest'},
}
})
-- plain chest
2013-12-18 01:15:20 +01:00
technic.chests:register("Mithril", {
Buff chest sizes Make the inventory sizes of all the technic chests larger, to provide a more appreciable benefit from upgrading chests, more in keeping with the resources spent on the upgrades. Currently the game engine doesn't handle large forms well. The size of an inventory slot is fixed relative to the screen height, and a form that exceeds either screen dimension will extend off the screen, making parts of it inaccessible. The tallest a form can get and remain usable is 13 slots, and even that slightly overspills the screen height. The maximum usable width depends on the screen aspect ratio. For the narrowest common ratio, 5:4, the widest a form can usably get is 15 slots, again slightly overspilling. Combined with the layout of the chest forms, this implies a maximum practical chest inventory size of 15x7 (= 105), slightly smaller than the largest Minecraft chests. To provide roughly equal size steps in the five upgrades from wooden chest (staying at 8x4 = 32) to mithril chest, the steps need to be of about 15 slots instead of the former 4. The new sizes are: wooden 8x4 32 iron 9x5 45 copper 12x5 60 silver 12x6 72 gold 15x6 90 mithril 15x7 105 To make upgrading from the old chest sizes to the new sizes more convenient, the inventory size is now set not only upon chest construction but also when accepting form input, at the same time as rewriting the formspec. So after upgrading the technic mod, viewing an existing chest upgrades it to the new size. The first time a pre-existing chest is viewed its form will have the old dimensions, looking broken due to the inventory background image now having the new number of slots. The second time it is viewed the form will have the new dimensions, and the full new number of slots will be usable.
2014-06-20 19:46:57 +02:00
width = 15,
height = 6,
2014-05-01 09:32:01 +02:00
sort = true,
autosort = true,
2013-12-18 01:15:20 +01:00
infotext = false,
color = false,
locked = false,
2013-01-27 14:03:46 +01:00
})
-- owned locked chest
2013-12-18 01:15:20 +01:00
technic.chests:register("Mithril", {
Buff chest sizes Make the inventory sizes of all the technic chests larger, to provide a more appreciable benefit from upgrading chests, more in keeping with the resources spent on the upgrades. Currently the game engine doesn't handle large forms well. The size of an inventory slot is fixed relative to the screen height, and a form that exceeds either screen dimension will extend off the screen, making parts of it inaccessible. The tallest a form can get and remain usable is 13 slots, and even that slightly overspills the screen height. The maximum usable width depends on the screen aspect ratio. For the narrowest common ratio, 5:4, the widest a form can usably get is 15 slots, again slightly overspilling. Combined with the layout of the chest forms, this implies a maximum practical chest inventory size of 15x7 (= 105), slightly smaller than the largest Minecraft chests. To provide roughly equal size steps in the five upgrades from wooden chest (staying at 8x4 = 32) to mithril chest, the steps need to be of about 15 slots instead of the former 4. The new sizes are: wooden 8x4 32 iron 9x5 45 copper 12x5 60 silver 12x6 72 gold 15x6 90 mithril 15x7 105 To make upgrading from the old chest sizes to the new sizes more convenient, the inventory size is now set not only upon chest construction but also when accepting form input, at the same time as rewriting the formspec. So after upgrading the technic mod, viewing an existing chest upgrades it to the new size. The first time a pre-existing chest is viewed its form will have the old dimensions, looking broken due to the inventory background image now having the new number of slots. The second time it is viewed the form will have the new dimensions, and the full new number of slots will be usable.
2014-06-20 19:46:57 +02:00
width = 15,
height = 6,
2014-05-01 09:32:01 +02:00
sort = true,
autosort = true,
2013-12-18 01:15:20 +01:00
infotext = false,
color = false,
locked = true,
2013-01-27 14:03:46 +01:00
})
2013-12-18 01:15:20 +01:00
if minetest.get_modpath("protector") or minetest.get_modpath("areas") then
-- protected chest (works with any protection mod that overrides minetest.is_protected)
technic.chests:register("Mithril", {
width = 15,
height = 6,
sort = true,
autosort = true,
infotext = false,
color = false,
protected = true,
})
minetest.register_craft({
output = 'technic:mithril_protected_chest 1',
recipe = {
{'basic_materials:padlock'},
{'technic:mithril_locked_chest'},
}
})
end