Skip to content

Commit c8b4bed

Browse files
t4imparamat
authored andcommitted
Builtin: Add core.MAP_BLOCKSIZE constant
1 parent 58eb5f3 commit c8b4bed

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

builtin/game/constants.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,19 @@
44
-- Constants values for use with the Lua API
55
--
66

7+
-- mapnode.h
78
-- Built-in Content IDs (for use with VoxelManip API)
89
core.CONTENT_UNKNOWN = 125
910
core.CONTENT_AIR = 126
1011
core.CONTENT_IGNORE = 127
1112

13+
-- emerge.h
1214
-- Block emerge status constants (for use with core.emerge_area)
1315
core.EMERGE_CANCELLED = 0
1416
core.EMERGE_ERRORED = 1
1517
core.EMERGE_FROM_MEMORY = 2
1618
core.EMERGE_FROM_DISK = 3
1719
core.EMERGE_GENERATED = 4
20+
21+
-- constants.h
22+
core.MAP_BLOCKSIZE = 16

builtin/game/forceloading.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ core.forceload_free_block = nil
77
local blocks_forceloaded
88
local total_forceloaded = 0
99

10-
local BLOCKSIZE = 16
10+
local BLOCKSIZE = core.MAP_BLOCKSIZE
1111
local function get_blockpos(pos)
1212
return {
1313
x = math.floor(pos.x/BLOCKSIZE),

0 commit comments

Comments
 (0)