forked from VoxeLibre/VoxeLibre
Don't use opaque globals.
This commit is contained in:
parent
c9ec16c2eb
commit
21531eb564
|
@ -6,12 +6,13 @@ local blocks = {
|
||||||
-- Color picked to be much lighter than above from MCL2, but still mostly green
|
-- Color picked to be much lighter than above from MCL2, but still mostly green
|
||||||
color = "#58ff3a",
|
color = "#58ff3a",
|
||||||
tiles = { "mcl_core_grass_block_top.png" }
|
tiles = { "mcl_core_grass_block_top.png" }
|
||||||
-- tiles = { terrain(0) }
|
-- TODO make this a setting
|
||||||
|
-- tiles = { mcljepc_core.helpers.terrain(0) }
|
||||||
},
|
},
|
||||||
cobblestone = {
|
cobblestone = {
|
||||||
description = "Cobblestone",
|
description = "Cobblestone",
|
||||||
tiles = { "default_cobble.png" },
|
tiles = { "default_cobble.png" },
|
||||||
-- tiles = { terrain(1) }
|
-- tiles = { mcljepc_core.helpers.terrain(1) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
--- Misc. Helper functions
|
--- Misc. Helper functions
|
||||||
|
mcljepc_core.helpers = {}
|
||||||
|
|
||||||
function atlas_id(tex, id)
|
function mcljepc_core.helpers.atlas_id(tex, id)
|
||||||
local x = id % 16
|
local x = id % 16
|
||||||
local y = math.floor(id / 16)
|
local y = math.floor(id / 16)
|
||||||
|
|
||||||
return tex..".png^[sheet:16x16:"..x..","..y
|
return tex..".png^[sheet:16x16:"..x..","..y
|
||||||
end
|
end
|
||||||
|
|
||||||
function terrain(id)
|
function mcljepc_core.helpers.terrain(id)
|
||||||
return atlas_id("terrain", id)
|
return atlas_id("terrain", id)
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
mcljepc_core = {}
|
||||||
dofile(minetest.get_modpath("mcljepc_core") .. "/helpers.lua")
|
dofile(minetest.get_modpath("mcljepc_core") .. "/helpers.lua")
|
||||||
dofile(minetest.get_modpath("mcljepc_core") .. "/blocks.lua")
|
dofile(minetest.get_modpath("mcljepc_core") .. "/blocks.lua")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue