summaryrefslogtreecommitdiff
path: root/technic_chests/wooden_chest.lua
diff options
context:
space:
mode:
authorZefram <zefram@fysh.org>2014-07-02 18:45:35 +0100
committerZefram <zefram@fysh.org>2014-07-23 16:49:07 +0100
commit1d7cb740538b1d97f29d7771ec5cd9435591128f (patch)
treed43ab07d84a0096264c04d8d24713197275b459d /technic_chests/wooden_chest.lua
parent2d9e06c4791f613c8ca86f0d1a71579bcee4a566 (diff)
Bring wooden chest fully into the chest system
Re-register most aspects of default:chest and default:chest_locked, using the technic chests code, so that the wooden chests fit properly into the sequence of chest types. This mainly affects the formspec, which now uses the style of the other chests, rather than the bare style used by the default mod.
Diffstat (limited to 'technic_chests/wooden_chest.lua')
-rw-r--r--technic_chests/wooden_chest.lua55
1 files changed, 46 insertions, 9 deletions
diff --git a/technic_chests/wooden_chest.lua b/technic_chests/wooden_chest.lua
index 8ff33b0..0fad12c 100644
--- a/technic_chests/wooden_chest.lua
+++ b/technic_chests/wooden_chest.lua
@@ -1,14 +1,51 @@
-local S
-if intllib then
- S = intllib.Getter()
-else
- S = function(s) return s end
-end
-
+local udef = technic.chests:definition("Wooden", {
+ width = 8,
+ height = 4,
+ sort = false,
+ autosort = false,
+ infotext = false,
+ color = false,
+ locked = false,
+})
+local uudef = {
+ groups = udef.groups,
+ tube = udef.tube,
+ on_construct = udef.on_construct,
+ can_dig = udef.can_dig,
+ on_receive_fields = udef.on_receive_fields,
+ on_metadata_inventory_move = udef.on_metadata_inventory_move,
+ on_metadata_inventory_put = udef.on_metadata_inventory_put,
+ on_metadata_inventory_take = udef.on_metadata_inventory_take,
+}
if minetest.registered_nodes["default:chest"].description == "Chest" then
- minetest.override_item("default:chest", { description = S("%s Chest"):format(S("Wooden")) })
+ uudef.description = udef.description
end
+minetest.override_item("default:chest", uudef)
+local ldef = technic.chests:definition("Wooden", {
+ width = 8,
+ height = 4,
+ sort = false,
+ autosort = false,
+ infotext = false,
+ color = false,
+ locked = true,
+})
+local lldef = {
+ groups = ldef.groups,
+ tube = ldef.tube,
+ after_place_node = ldef.after_place_node,
+ on_construct = ldef.on_construct,
+ can_dig = ldef.can_dig,
+ on_receive_fields = ldef.on_receive_fields,
+ allow_metadata_inventory_move = ldef.allow_metadata_inventory_move,
+ allow_metadata_inventory_put = ldef.allow_metadata_inventory_put,
+ allow_metadata_inventory_take = ldef.allow_metadata_inventory_take,
+ on_metadata_inventory_move = ldef.on_metadata_inventory_move,
+ on_metadata_inventory_put = ldef.on_metadata_inventory_put,
+ on_metadata_inventory_take = ldef.on_metadata_inventory_take,
+}
if minetest.registered_nodes["default:chest_locked"].description == "Locked Chest" then
- minetest.override_item("default:chest_locked", { description = S("%s Locked Chest"):format(S("Wooden")) })
+ lldef.description = ldef.description
end
+minetest.override_item("default:chest_locked", lldef)