1
0
mirror of https://github.com/minetest-mods/technic.git synced 2025-05-21 18:30:32 +02:00

split chests off into a separate modpack component

This commit is contained in:
RealBadAngel 2013-04-05 04:30:33 +02:00
parent dca23bbdb3
commit fd3f25b5e0
114 changed files with 163 additions and 172 deletions
technic
config.luainit.luamithril_subspace_chest.lua
textures
technic_copper_chest_front.pngtechnic_copper_chest_locked.pngtechnic_copper_chest_side.pngtechnic_copper_chest_top.pngtechnic_diamond.pngtechnic_diamond_block.pngtechnic_gold_chest_front.pngtechnic_gold_chest_front_black.pngtechnic_gold_chest_front_blue.pngtechnic_gold_chest_front_brown.pngtechnic_gold_chest_front_cyan.pngtechnic_gold_chest_front_dark_green.pngtechnic_gold_chest_front_dark_grey.pngtechnic_gold_chest_front_green.pngtechnic_gold_chest_front_grey.pngtechnic_gold_chest_front_magenta.pngtechnic_gold_chest_front_orange.pngtechnic_gold_chest_front_pink.pngtechnic_gold_chest_front_red.pngtechnic_gold_chest_front_violet.pngtechnic_gold_chest_front_white.pngtechnic_gold_chest_front_yellow.pngtechnic_gold_chest_locked.pngtechnic_gold_chest_locked_black.pngtechnic_gold_chest_locked_blue.pngtechnic_gold_chest_locked_brown.pngtechnic_gold_chest_locked_cyan.pngtechnic_gold_chest_locked_dark_green.pngtechnic_gold_chest_locked_dark_grey.pngtechnic_gold_chest_locked_green.pngtechnic_gold_chest_locked_grey.pngtechnic_gold_chest_locked_magenta.pngtechnic_gold_chest_locked_orange.pngtechnic_gold_chest_locked_pink.pngtechnic_gold_chest_locked_red.pngtechnic_gold_chest_locked_violet.pngtechnic_gold_chest_locked_white.pngtechnic_gold_chest_locked_yellow.pngtechnic_gold_chest_side.pngtechnic_gold_chest_top.pngtechnic_iron_chest_front.pngtechnic_iron_chest_locked.pngtechnic_iron_chest_side.pngtechnic_iron_chest_top.pngtechnic_mithril_chest_front.pngtechnic_mithril_chest_locked.pngtechnic_mithril_chest_side.pngtechnic_mithril_chest_top.pngtechnic_mithril_dust.pngtechnic_silver_chest_front.pngtechnic_silver_chest_locked.pngtechnic_silver_chest_side.pngtechnic_silver_chest_top.png
technicx32

@ -7,4 +7,3 @@ enable_flashlight=true
enable_rubber_tree_generation=true
enable_marble_generation=true
enable_granite_generation=true
enable_obsidian_generation=true

@ -9,14 +9,6 @@ dofile(modpath.."/config.lua")
--helper functions
dofile(modpath.."/helpers.lua")
-- chests
dofile(modpath.."/chest_commons.lua")
dofile(modpath.."/iron_chest.lua")
dofile(modpath.."/copper_chest.lua")
dofile(modpath.."/silver_chest.lua")
dofile(modpath.."/gold_chest.lua")
dofile(modpath.."/mithril_chest.lua")
--items
dofile(modpath.."/items.lua")

@ -1,145 +0,0 @@
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'},
}
})
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'},
}
})
minetest.register_craft({
output = 'technic:mithril_locked_chest 1',
recipe = {
{'default:steel_ingot'},
{'technic:mithril_chest'},
}
})
minetest.register_node("technic:mithril_chest", {
description = "Mithril Chest",
tiles = {"technic_mithril_chest_top.png", "technic_mithril_chest_top.png", "technic_mithril_chest_side.png",
"technic_mithril_chest_side.png", "technic_mithril_chest_side.png", "technic_mithril_chest_front.png"},
paramtype2 = "facedir",
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
legacy_facedir_simple = true,
sounds = default.node_sound_wood_defaults(),
on_construct = function(pos)
local meta = minetest.env:get_meta(pos)
meta:set_string("formspec",
"invsize[13,9;]"..
"list[current_name;main;0,0;13,4;]"..
"list[current_player;main;0,5;8,4;]")
meta:set_string("infotext", "Mithril Chest")
local inv = meta:get_inventory()
inv:set_size("main", 13*4)
end,
can_dig = function(pos,player)
local meta = minetest.env:get_meta(pos);
local inv = meta:get_inventory()
return inv:is_empty("main")
end,
on_metadata_inventory_move = function(pos, from_list, from_index,
to_list, to_index, count, player)
minetest.log("action", player:get_player_name()..
" moves stuff in chest at "..minetest.pos_to_string(pos))
return minetest.node_metadata_inventory_move_allow_all(
pos, from_list, from_index, to_list, to_index, count, player)
end,
on_metadata_inventory_offer = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name()..
" moves stuff to chest at "..minetest.pos_to_string(pos))
return minetest.node_metadata_inventory_offer_allow_all(
pos, listname, index, stack, player)
end,
on_metadata_inventory_take = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name()..
" takes stuff from chest at "..minetest.pos_to_string(pos))
end,
})
minetest.register_node("technic:mithril_locked_chest", {
description = "Mithril Locked Chest",
tiles = {"technic_mithril_chest_top.png", "technic_mithril_chest_top.png", "technic_mithril_chest_side.png",
"technic_mithril_chest_side.png", "technic_mithril_chest_side.png", "technic_mithril_chest_locked.png"},
paramtype2 = "facedir",
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
legacy_facedir_simple = true,
sounds = default.node_sound_wood_defaults(),
after_place_node = function(pos, placer)
local meta = minetest.env:get_meta(pos)
meta:set_string("owner", placer:get_player_name() or "")
meta:set_string("infotext", "Mithril Locked Chest (owned by "..
meta:get_string("owner")..")")
end,
on_construct = function(pos)
local meta = minetest.env:get_meta(pos)
meta:set_string("formspec",
"invsize[13,9;]"..
"list[current_name;main;0,0;13,4;]"..
"list[current_player;main;0,5;8,4;]")
meta:set_string("infotext", "Mithril Locked Chest")
meta:set_string("owner", "")
local inv = meta:get_inventory()
inv:set_size("main", 13*4)
end,
can_dig = function(pos,player)
local meta = minetest.env:get_meta(pos);
local inv = meta:get_inventory()
return inv:is_empty("main")
end,
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
local meta = minetest.env:get_meta(pos)
if not has_locked_chest_privilege(meta, player) then
minetest.log("action", player:get_player_name()..
" tried to access a locked chest belonging to "..
meta:get_string("owner").." at "..
minetest.pos_to_string(pos))
return 0
end
return count
end,
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
local meta = minetest.env:get_meta(pos)
if not has_locked_chest_privilege(meta, player) then
minetest.log("action", player:get_player_name()..
" tried to access a locked chest belonging to "..
meta:get_string("owner").." at "..
minetest.pos_to_string(pos))
return 0
end
return stack:get_count()
end,
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
local meta = minetest.env:get_meta(pos)
if not has_locked_chest_privilege(meta, player) then
minetest.log("action", player:get_player_name()..
" tried to access a locked chest belonging to "..
meta:get_string("owner").." at "..
minetest.pos_to_string(pos))
return 0
end
return stack:get_count()
end,
on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
minetest.log("action", player:get_player_name()..
" moves stuff in locked chest at "..minetest.pos_to_string(pos))
end,
on_metadata_inventory_put = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name()..
" moves stuff to locked chest at "..minetest.pos_to_string(pos))
end,
on_metadata_inventory_take = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name()..
" takes stuff from locked chest at "..minetest.pos_to_string(pos))
end,
})

Binary file not shown.

Before

(image error) Size: 607 B

Binary file not shown.

Before

(image error) Size: 605 B

Binary file not shown.

Before

(image error) Size: 570 B

Binary file not shown.

Before

(image error) Size: 557 B

Binary file not shown.

Before

(image error) Size: 693 B

Binary file not shown.

Before

(image error) Size: 610 B

Binary file not shown.

Before

(image error) Size: 778 B

Binary file not shown.

Before

(image error) Size: 858 B

Binary file not shown.

Before

(image error) Size: 866 B

Binary file not shown.

Before

(image error) Size: 866 B

Binary file not shown.

Before

(image error) Size: 855 B

Binary file not shown.

Before

(image error) Size: 851 B

Binary file not shown.

Before

(image error) Size: 846 B

Binary file not shown.

Before

(image error) Size: 851 B

Binary file not shown.

Before

(image error) Size: 831 B

Binary file not shown.

Before

(image error) Size: 856 B

Binary file not shown.

Before

(image error) Size: 844 B

Binary file not shown.

Before

(image error) Size: 846 B

Binary file not shown.

Before

(image error) Size: 848 B

Binary file not shown.

Before

(image error) Size: 860 B

Binary file not shown.

Before

(image error) Size: 857 B

Binary file not shown.

Before

(image error) Size: 855 B

Binary file not shown.

Before

(image error) Size: 778 B

Binary file not shown.

Before

(image error) Size: 865 B

Binary file not shown.

Before

(image error) Size: 864 B

Binary file not shown.

Before

(image error) Size: 869 B

Binary file not shown.

Before

(image error) Size: 851 B

Binary file not shown.

Before

(image error) Size: 850 B

Binary file not shown.

Before

(image error) Size: 847 B

Binary file not shown.

Before

(image error) Size: 848 B

Binary file not shown.

Before

(image error) Size: 830 B

Binary file not shown.

Before

(image error) Size: 849 B

Binary file not shown.

Before

(image error) Size: 843 B

Binary file not shown.

Before

(image error) Size: 842 B

Binary file not shown.

Before

(image error) Size: 843 B

Binary file not shown.

Before

(image error) Size: 855 B

Binary file not shown.

Before

(image error) Size: 858 B

Binary file not shown.

Before

(image error) Size: 855 B

Binary file not shown.

Before

(image error) Size: 743 B

Binary file not shown.

Before

(image error) Size: 729 B

Binary file not shown.

Before

(image error) Size: 750 B

Binary file not shown.

Before

(image error) Size: 905 B

Binary file not shown.

Before

(image error) Size: 746 B

Binary file not shown.

Before

(image error) Size: 860 B

Binary file not shown.

Before

(image error) Size: 770 B

Binary file not shown.

Before

(image error) Size: 772 B

Binary file not shown.

Before

(image error) Size: 756 B

Binary file not shown.

Before

(image error) Size: 775 B

Binary file not shown.

Before

(image error) Size: 467 B

Binary file not shown.

Before

(image error) Size: 851 B

Binary file not shown.

Before

(image error) Size: 852 B

Binary file not shown.

Before

(image error) Size: 810 B

Binary file not shown.

Before

(image error) Size: 798 B

Binary file not shown.

Before

(image error) Size: 2.6 KiB

Binary file not shown.

Before

(image error) Size: 2.6 KiB

Binary file not shown.

Before

(image error) Size: 2.5 KiB

Binary file not shown.

Before

(image error) Size: 2.5 KiB

Binary file not shown.

Before

(image error) Size: 2.6 KiB

Binary file not shown.

Before

(image error) Size: 2.6 KiB

Binary file not shown.

Before

(image error) Size: 2.6 KiB

Binary file not shown.

Before

(image error) Size: 2.6 KiB

Binary file not shown.

Before

(image error) Size: 2.6 KiB

Binary file not shown.

Before

(image error) Size: 2.6 KiB

Binary file not shown.

Before

(image error) Size: 2.6 KiB

Binary file not shown.

Before

(image error) Size: 2.6 KiB

Binary file not shown.

Before

(image error) Size: 2.6 KiB

Binary file not shown.

Before

(image error) Size: 2.6 KiB

Binary file not shown.

Before

(image error) Size: 2.6 KiB

Binary file not shown.

Before

(image error) Size: 2.6 KiB

Binary file not shown.

Before

(image error) Size: 2.6 KiB

Binary file not shown.

Before

(image error) Size: 2.6 KiB

Binary file not shown.

Before

(image error) Size: 2.6 KiB

Binary file not shown.

Before

(image error) Size: 2.6 KiB

Binary file not shown.

Before

(image error) Size: 2.7 KiB

Binary file not shown.

Before

(image error) Size: 2.7 KiB

Binary file not shown.

Before

(image error) Size: 2.7 KiB

Binary file not shown.

Before

(image error) Size: 2.7 KiB

Binary file not shown.

Before

(image error) Size: 2.7 KiB

Binary file not shown.

Before

(image error) Size: 2.7 KiB

Binary file not shown.

Before

(image error) Size: 2.7 KiB

Binary file not shown.

Before

(image error) Size: 2.7 KiB

Binary file not shown.

Before

(image error) Size: 2.7 KiB

Binary file not shown.

Before

(image error) Size: 2.7 KiB

Binary file not shown.

Before

(image error) Size: 2.7 KiB

Binary file not shown.

Before

(image error) Size: 2.7 KiB

Binary file not shown.

Before

(image error) Size: 2.7 KiB

Binary file not shown.

Before

(image error) Size: 2.7 KiB

Binary file not shown.

Before

(image error) Size: 2.7 KiB

Binary file not shown.

Before

(image error) Size: 2.7 KiB

Binary file not shown.

Before

(image error) Size: 2.6 KiB

Binary file not shown.

Before

(image error) Size: 2.5 KiB

Binary file not shown.

Before

(image error) Size: 2.5 KiB

Binary file not shown.

Before

(image error) Size: 2.5 KiB

Binary file not shown.

Before

(image error) Size: 2.4 KiB

Binary file not shown.

Before

(image error) Size: 2.4 KiB

Binary file not shown.

Before

(image error) Size: 2.6 KiB

Binary file not shown.

Before

(image error) Size: 2.7 KiB

Some files were not shown because too many files have changed in this diff Show More