Skip to content

Commit

Permalink
refactor nodebox params to variables
Browse files Browse the repository at this point in the history
  • Loading branch information
BuckarooBanzay committed Jan 29, 2024
1 parent dc6c2f6 commit f17f5fd
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ slats = {}

function slats.register_slat(subname, recipeitem, groups, image, description, sounds)
groups.slab = 1

-- nodebox limits
local nb1 = 0.5
local nb2 = 0.49

minetest.register_node(":slats:slat_" .. subname, {
description = description,
drawtype = "nodebox",
Expand All @@ -16,9 +21,9 @@ function slats.register_slat(subname, recipeitem, groups, image, description, so
sounds = sounds,
node_box = {
type = "wallmounted",
wall_top = {-0.5, 0.49, -0.5, 0.5, 0.49, 0.5},
wall_bottom = {-0.5, -0.49, -0.5, 0.5, -0.49, 0.5},
wall_side = {-0.49, -0.5, -0.5, -0.49, 0.5, 0.5},
wall_top = {-nb1, nb2, -nb1, nb1, nb2, nb1},
wall_bottom = {-nb1, -nb2, -nb1, nb1, -nb2, nb1},
wall_side = {-nb2, -nb1, -nb1, -nb2, nb1, nb1},
},
})

Expand Down

0 comments on commit f17f5fd

Please sign in to comment.