core: "optimizations"

This commit is contained in:
2026-01-06 23:58:52 +02:00
parent 97e142d3b2
commit 14931ef42d
14 changed files with 49 additions and 0 deletions

View File

@@ -1,3 +1,6 @@
--!native
--!optimize 2
local BlockManager = {} local BlockManager = {}
BlockManager.BlockIdMappings = {} :: {BasePart} BlockManager.BlockIdMappings = {} :: {BasePart}

View File

@@ -1,3 +1,6 @@
--!native
--!optimize 2
local Chunk = {} local Chunk = {}
Chunk.__index = Chunk Chunk.__index = Chunk

View File

@@ -1,3 +1,6 @@
--!native
--!optimize 2
local ChunkBuilder = {} local ChunkBuilder = {}
local Chunk = require("./Chunk") local Chunk = require("./Chunk")

View File

@@ -1,3 +1,6 @@
--!native
--!optimize 2
local ChunkManager = {} local ChunkManager = {}
local RunService = game:GetService("RunService") local RunService = game:GetService("RunService")

View File

@@ -1,3 +1,6 @@
--!native
--!optimize 2
local Globals = {} local Globals = {}
Globals.RenderDistance = 6 Globals.RenderDistance = 6

View File

@@ -1,3 +1,6 @@
--!native
--!optimize 2
local ML = {} local ML = {}
type modContext = { type modContext = {

View File

@@ -1,3 +1,6 @@
--!native
--!optimize 2
local PlacementManager = {} local PlacementManager = {}
local ChunkManager = require("./ChunkManager") local ChunkManager = require("./ChunkManager")

View File

@@ -1,5 +1,15 @@
local module = {} local module = {}
function module.isNaN(n: number): boolean
-- NaN is never equal to itself
return n ~= n
end
function module.isInf(n: number): boolean
-- Number could be -inf or +inf
return math.abs(n) == math.huge
end
function module.BlockPosStringToCoords(s: string): Vector3 function module.BlockPosStringToCoords(s: string): Vector3
-- a,b,c -- a,b,c
local split = string.split(s,",") local split = string.split(s,",")

View File

@@ -1,3 +1,6 @@
--!native
--!optimize 2
local TerrainGen = {} local TerrainGen = {}
local deflate = require("./TerrainGen/Deflate") local deflate = require("./TerrainGen/Deflate")

View File

@@ -1,3 +1,6 @@
--!native
--!optimize 2
print("Hello world!") print("Hello world!")
task.synchronize() task.synchronize()

View File

@@ -1,3 +1,6 @@
--!native
--!optimize 2
if not game:IsLoaded() then if not game:IsLoaded() then
game.Loaded:Wait() game.Loaded:Wait()
end end

View File

@@ -1,3 +1,6 @@
--!native
--!optimize 2
if not game:IsLoaded() then if not game:IsLoaded() then
game.Loaded:Wait() game.Loaded:Wait()
end end

View File

@@ -1,3 +1,6 @@
--!native
--!optimize 2
if not game:IsLoaded() then if not game:IsLoaded() then
game.Loaded:Wait() game.Loaded:Wait()
end end

View File

@@ -1,3 +1,6 @@
--!native
--!optimize 2
local mod = { local mod = {
name = "Blockscraft", name = "Blockscraft",
description = "Base Blockscraft blocks", description = "Base Blockscraft blocks",