1
0
mirror of https://github.com/HybridDog/connected_chests.git synced 2024-11-17 11:20:17 +01:00

dont use table.copy for copying the original nodedef and update readme

This commit is contained in:
HybridDog 2016-05-15 19:56:10 +02:00
parent 2702cf4ae8
commit ccac8fe4ca
4 changed files with 32 additions and 4 deletions

1
LICENSE.txt Normal file
View File

@ -0,0 +1 @@
WTFPL

19
README.md Normal file
View File

@ -0,0 +1,19 @@
[Mod] connected chests [connected_chests]
This mod allows making bigger default chests.
Just hold shift and place a chest onto another one's side.
This is not the first mod which adds big chests.
**Depends:** see [depends.txt](https://raw.githubusercontent.com/HybridDog/connected_chests/master/depends.txt)
**License:** see [LICENSE.txt](https://raw.githubusercontent.com/HybridDog/connected_chests/master/LICENSE.txt)
**Download:** [zip](https://github.com/HybridDog/connected_chests/archive/master.zip), [tar.gz](https://github.com/HybridDog/connected_chests/tarball/master)
![I'm a screenshot!](http://wiki.minetest.net/images/d/d1/Connected_chest.png)
If you got ideas or found bugs, please tell them to me.
[How to install a mod?](http://wiki.minetest.net/Installing_Mods)
TODO:
— disallow rotating the chest with a screwdriver

View File

@ -1,2 +0,0 @@
TODO:
— disallow rotating the chest with a screwdriver

View File

@ -154,7 +154,12 @@ end
local top_texture = "connected_chests_top.png^default_chest_top.png^([combine:16x16:5,0=default_chest_top.png^connected_chests_frame.png^[makealpha:255,126,126)^connected_chests_top.png"
local side_texture = "connected_chests_side.png^default_chest_side.png^([combine:16x16:5,0=default_chest_side.png^connected_chests_frame.png^[makealpha:255,126,126)^connected_chests_side.png"
local chest = table.copy(minetest.registered_nodes["default:chest"])
local chest = {}
local origdef = minetest.registered_nodes["default:chest"]
for i in pairs(origdef) do
chest[i] = rawget(origdef, i)
end
chest.description = nil
chest.legacy_facedir_simple = nil
chest.after_place_node = nil
@ -183,7 +188,12 @@ end
minetest.register_node("connected_chests:chest_left", chest)
local chest_locked = table.copy(minetest.registered_nodes["default:chest_locked"])
local chest_locked = {}
local origdef = minetest.registered_nodes["default:chest_locked"]
for i in pairs(origdef) do
chest_locked[i] = rawget(origdef, i)
end
chest_locked.description = nil
chest_locked.legacy_facedir_simple = nil
chest_locked.after_place_node = nil