summaryrefslogtreecommitdiff
path: root/lua/visual.lua
diff options
context:
space:
mode:
authorLNJ <git@lnj.li>2017-04-05 14:52:34 +0200
committerLNJ <git@lnj.li>2017-04-05 14:53:17 +0200
commitdd97f22586580b5aa4e383cb900bb42414fd1497 (patch)
tree6c71d0094bdfd226f822972e8ba0f592e1a5bc71 /lua/visual.lua
parentf1156cc1da2f61d3996878213d5a3b358ce7ec57 (diff)
Add 1x2 drawers, Add crafting recipes for 1x2 and 2x2
Diffstat (limited to 'lua/visual.lua')
-rwxr-xr-xlua/visual.lua26
1 files changed, 18 insertions, 8 deletions
diff --git a/lua/visual.lua b/lua/visual.lua
index e85bd53..43eb81f 100755
--- a/lua/visual.lua
+++ b/lua/visual.lua
@@ -85,14 +85,24 @@ core.register_entity("drawers:visual", {
local node = core.get_node(self.drawer_pos)
-- collisionbox
- local colbox = {-0.4374, -0.4374, 0, 0.4374, 0.4374, 0} -- for param2 = 0 or 2
- if node.param2 == 1 or node.param2 == 3 then
- colbox = {0, -0.4374, -0.4374, 0, 0.4374, 0.4374}
- end
- -- only half the size if it's a small drawer
- if self.drawerType >= 2 then
- for i,j in pairs(colbox) do
- colbox[i] = j * 0.5
+ local colbox
+ if self.drawerType ~= 2 then
+ if node.param2 == 1 or node.param2 == 3 then
+ colbox = {0, -0.4374, -0.4374, 0, 0.4374, 0.4374}
+ else
+ colbox = {-0.4374, -0.4374, 0, 0.4374, 0.4374, 0} -- for param2 = 0 or 2
+ end
+ -- only half the size if it's a small drawer
+ if self.drawerType > 1 then
+ for i,j in pairs(colbox) do
+ colbox[i] = j * 0.5
+ end
+ end
+ else
+ if node.param2 == 1 or node.param2 == 3 then
+ colbox = {0, -0.2187, -0.4374, 0, 0.2187, 0.4374}
+ else
+ colbox = {-0.4374, -0.2187, 0, 0.4374, 0.2187, 0} -- for param2 = 0 or 2
end
end