repo
stringclasses
341 values
file_path
stringlengths
29
173
language
stringclasses
2 values
file_type
stringclasses
4 values
code
stringlengths
2
1.66M
tokens
int64
2
598k
ffrostfall/BridgeNet2
ffrostfall-BridgeNet2-d7fd18a/lune/installDependencies.luau
luau
.luau
local installGitDependencies = require("@ext/installGitDependencies") local installWallyDependencies = require("@ext/installWallyDependencies") local process = require("@lune/process") if #process.args == 0 then installGitDependencies() installWallyDependencies() elseif process.args[1] == "git" then installGitDepen...
93
ffrostfall/BridgeNet2
ffrostfall-BridgeNet2-d7fd18a/lune/tests.luau
luau
.luau
local colorful = require("@vendor/lunePackages/colorful") local fs = require("@lune/fs") local luau = require("@lune/luau") local process = require("@lune/process") local roblox = require("@lune/roblox") local serde = require("@lune/serde") local task = require("@lune/task") local tests = fs.readDir("tests/lune/") loc...
592
ffrostfall/BridgeNet2
ffrostfall-BridgeNet2-d7fd18a/src/api.luau
luau
.luau
export type BridgeNet2 = {} return nil
10
ffrostfall/BridgeNet2
ffrostfall-BridgeNet2-d7fd18a/src/client/bridge.luau
luau
.luau
local ClientBridge = {} local metatable = { __index = ClientBridge } export type Identity = typeof(setmetatable({} :: {}, metatable)) local function constructor(name: string): Identity local self = setmetatable({}, metatable) return self end function ClientBridge.Fire() end function ClientBridge.Connect() end fu...
114
ffrostfall/BridgeNet2
ffrostfall-BridgeNet2-d7fd18a/src/client/identifiers.luau
luau
.luau
local dataModelTree = require("@src/dataModelTree") local logStrings = require("@src/logStrings") local logger = require("@src/logger").new() local identifierMap = require("@src/identifierMap") local client = {} function client.init(tree: dataModelTree.Identity) for name, id in tree.identifiers:GetAttributes() do ...
196
ffrostfall/BridgeNet2
ffrostfall-BridgeNet2-d7fd18a/src/client/parallelBridge.luau
luau
.luau
local logger = require("@src/logger").new("client (parallel)") local logStrings = require("@src/logStrings") local identifierMap = require("@src/identifierMap") local dataModelTree = require("@src/dataModelTree") local tree: dataModelTree.Identity local function disallowed(name: string): never return logger:fatal(st...
397
ffrostfall/BridgeNet2
ffrostfall-BridgeNet2-d7fd18a/src/client/process.luau
luau
.luau
local RunService = game:GetService("RunService") local serializer = require("@src/core/serializer") local deserializer = require("@src/core/deserializer") local types = require("@src/types") local dataModelTree = require("@src/dataModelTree") local logger = require("@src/logger").new("main client process") local logSt...
390
ffrostfall/BridgeNet2
ffrostfall-BridgeNet2-d7fd18a/src/core/deserializer.luau
luau
.luau
--!native local signal = require("@pkg/signal") local idToSignal: { [number]: signal.Identity<...any> } = {} local deserializer = {} function deserializer.exists(id: number) return idToSignal[id] ~= nil end function deserializer.registerId(id: number): signal.Identity<...any> idToSignal[id] = signal() return idT...
408
ffrostfall/BridgeNet2
ffrostfall-BridgeNet2-d7fd18a/src/core/serializer.luau
luau
.luau
--!native local types = require("@src/types") local function serializer(queue: types.Queue): types.SerializedPacket local outgoingEvents: types.SerializedPacket = { events = {}, buff = buffer.create(0), } local idToIndex: { number } = {} local indexToId: { number } = {} for i = 1, #queue, 2 do local id = ...
230
ffrostfall/BridgeNet2
ffrostfall-BridgeNet2-d7fd18a/src/dataModelTree.luau
luau
.luau
local WFC_TIMEOUT = 3 local ReplicatedStorage = game:GetService("ReplicatedStorage") local RunService = game:GetService("RunService") local result = require("@src/util/result") local logStrings = require("@src/logStrings") local cached: Identity? = nil export type Identity = { container: Folder, remote: RemoteEve...
707
ffrostfall/BridgeNet2
ffrostfall-BridgeNet2-d7fd18a/src/identifierMap.luau
luau
.luau
local idToName: { [number]: string } = {} local nameToId: { [string]: number } = {} export type Identifier = number local identifierMap = {} function identifierMap.addIdentifier(name: string, id: Identifier) idToName[id] = name nameToId[name] = id end function identifierMap.removeIdentifier(name: string) local i...
145
ffrostfall/BridgeNet2
ffrostfall-BridgeNet2-d7fd18a/src/init.luau
luau
.luau
local RunService = game:GetService("RunService") local clientActor = require("@src/initialization/clientActor") local serverActor = require("@src/initialization/serverActor") local clientSerial = require("@src/initialization/clientSerial") local serverSerial = require("@src/initialization/serverSerial") local threadC...
196
ffrostfall/BridgeNet2
ffrostfall-BridgeNet2-d7fd18a/src/initialization/clientActor.luau
luau
.luau
return function() end
5
ffrostfall/BridgeNet2
ffrostfall-BridgeNet2-d7fd18a/src/initialization/clientSerial.luau
luau
.luau
local process = require("@src/client/process") local identifiers = require("@src/server/identifiers") local dataModelTree = require("@src/dataModelTree") local logger = require("@src/logger").new("client") local logStrings = require("@src/logStrings") return function() local treeRes = dataModelTree() if not treeRes....
137
ffrostfall/BridgeNet2
ffrostfall-BridgeNet2-d7fd18a/src/initialization/serverSerial.luau
luau
.luau
local process = require("@src/server/process") local identifiers = require("@src/server/identifiers") local dataModelTree = require("@src/dataModelTree") local logger = require("@src/logger").new("server") local logStrings = require("@src/logStrings") return function(): () local treeRes = dataModelTree(true) if not ...
139
ffrostfall/BridgeNet2
ffrostfall-BridgeNet2-d7fd18a/src/initialization/starter.client.luau
luau
.luau
require("@src/")
4
ffrostfall/BridgeNet2
ffrostfall-BridgeNet2-d7fd18a/src/logStrings.luau
luau
.luau
local errorStrings = { INSTANCE_NOT_FOUND = "couldn't find instances under replicatedstorage, waitforchild timeout hit", INSTANCE_NOT_VALID = "bridgenet2's internal instance tree wasnt valid, was it modified?", ID_PROPERTY_INCORRECT_TYPE = "identifier [%*] has an invalid attribute type, was it modified?", ACCESS_...
259
ffrostfall/BridgeNet2
ffrostfall-BridgeNet2-d7fd18a/src/logger.luau
luau
.luau
--!optimize 1 export type LogLevel = "trace" | "log" | "warn" | "fatal" | "halt" local function getNameFromStack() local name = debug.info(3, "s") local split = string.split(name, ".") return `{split[#split - 1]}/{split[#split]}` end local logger = {} local metatable = { __index = logger } export type Identity = ...
237
ffrostfall/BridgeNet2
ffrostfall-BridgeNet2-d7fd18a/src/server/bridge.luau
luau
.luau
local signal = require("@pkg/signal") local process = require("@src/server/process") local identifiers = require("@src/server/identifiers") local identifierMap = require("@src/identifierMap") local deserializer = require("@src/core/deserializer") local ServerBridge = {} local metatable = { __index = ServerBridge } exp...
406
ffrostfall/BridgeNet2
ffrostfall-BridgeNet2-d7fd18a/src/server/identifiers.luau
luau
.luau
local dataModelTree = require("@src/dataModelTree") local logger = require("@src/logger").new("server identifiers") local logStrings = require("@src/logStrings") local identifierMap = require("@src/identifierMap") local counter: Identifier = 1 local container: Folder export type Identifier = number local function as...
172
ffrostfall/BridgeNet2
ffrostfall-BridgeNet2-d7fd18a/src/server/process.luau
luau
.luau
--!native local Players = game:GetService("Players") local RunService = game:GetService("RunService") local dataModelTree = require("@src/dataModelTree") local types = require("@src/types") local serializer = require("@src/core/serializer") local deserializer = require("@src/core/deserializer") local remote: RemoteEv...
539
ffrostfall/BridgeNet2
ffrostfall-BridgeNet2-d7fd18a/src/types.luau
luau
.luau
--[[ Private ]] export type Content = unknown export type SerializedPacket = { events: { -- The numbers here don't cost anything, because it's an array. [number]: { -- Each value here is an individual call to an event. [number]: Content, }, }, -- The IDs are packed into this buffer buff: buffer, } --...
109
ffrostfall/BridgeNet2
ffrostfall-BridgeNet2-d7fd18a/src/util/result.luau
luau
.luau
export type Identity<T> = { success: true, value: T, } | { success: false, err: string, trace: string, } return ( ( function<T>(success: boolean, resultOrError: T & string): Identity<T> if success then return { success = true, value = resultOrError, } else return { success = fa...
149
ffrostfall/BridgeNet2
ffrostfall-BridgeNet2-d7fd18a/tests/roblox/clientRunner.client.luau
luau
.luau
if _G.__testmode__ == "benchmark" then return end local ReplicatedStorage = game:GetService("ReplicatedStorage") local _BridgeNet2 = require(ReplicatedStorage.Packages.BridgeNet2) local clientProcess = require("@src/client/process") clientProcess.registerEvent(1) clientProcess.connect(1, print)
73
ffrostfall/BridgeNet2
ffrostfall-BridgeNet2-d7fd18a/tests/roblox/clientStress.client.luau
luau
.luau
if _G.__testmode__ ~= "benchmark" then return end local ReplicatedStorage = game:GetService("ReplicatedStorage") local _BridgeNet2 = require(ReplicatedStorage.Packages.BridgeNet2) local clientProcess = require("@src/client/process") clientProcess.registerEvent(1) clientProcess.connect(1, function(data) end)
76
ffrostfall/BridgeNet2
ffrostfall-BridgeNet2-d7fd18a/tests/roblox/serverRunner.server.luau
luau
.luau
if _G.__testmode__ == "benchmark" then return end local ReplicatedStorage = game:GetService("ReplicatedStorage") local _BridgeNet2 = require(ReplicatedStorage.Packages.BridgeNet2) local serverProcess = require("@src/server/process") serverProcess.addEvent(1) serverProcess.connect(1, print) while true do serverPro...
94
ffrostfall/BridgeNet2
ffrostfall-BridgeNet2-d7fd18a/tests/roblox/serverStress.server.luau
luau
.luau
if _G.__testmode__ ~= "benchmark" then return end print("running stress test") local ReplicatedStorage = game:GetService("ReplicatedStorage") local RunService = game:GetService("RunService") local _BridgeNet2 = require(ReplicatedStorage.Packages.BridgeNet2) local serverProcess = require("@src/server/process") serv...
132
ffrostfall/BridgeNet2
ffrostfall-BridgeNet2-d7fd18a/tests/utils.luau
luau
.luau
local function bufferToDecimal(buff: buffer): string return string.gsub(buffer.tostring(buff), ".", function(c) return string.format("%03i ", string.byte(c :: any)) end) end local isPrimitiveType = { string = true, number = true, boolean = true, buffer = true } local function isPrimitiveArray(array) local max, n...
1,107
real2nix/mineblox
real2nix-mineblox-ec774db/src/ReplicatedStorage/Shared/ChunkSettings.luau
luau
.luau
return { CHUNK_SIZE = 8, CHUNK_DISTANCE = 10, MAX_CHUNK_DISTANCE = 1000, MAX_CHUNK_LOADING_ACTORS = 24, BLOCK_SIZE = 3, }
46
real2nix/mineblox
real2nix-mineblox-ec774db/src/ReplicatedStorage/Shared/ChunksUtil.luau
luau
.luau
local ChunksUtil = {} local ReplicatedStorage = game:GetService('ReplicatedStorage') local ChunkSettings = require(ReplicatedStorage.Shared.ChunkSettings) local CHUNK_SIZE: number = ChunkSettings['CHUNK_SIZE'] local BLOCK_SIZE: number = ChunkSettings['BLOCK_SIZE'] -- PUBLIC -- Converts [chunk_x][chunk_z][x][z][y] ...
983
real2nix/mineblox
real2nix-mineblox-ec774db/src/ReplicatedStorage/Shared/ItemsData.luau
luau
.luau
local itemsData = { Air = { isTransparent = true, }, Water = { isTransparent = true, }, Stone = { Hardness = 20, PreferredTool = 'Pickaxe', DropItem = 'Cobblestone', Type = 'Block', }, Cobblestone = { Hardness = 20, PreferredTool = 'Pickaxe', Type = 'Block', }, ['Grass Block'] = { Hardn...
1,058
real2nix/mineblox
real2nix-mineblox-ec774db/src/ReplicatedStorage/Shared/ItemsIDs.luau
luau
.luau
return { 'Air', 'Water', -- Everyday blocks 'Dirt', 'Grass Block', 'Stone', 'Cobblestone', 'Oak Wood Planks', 'Oak Leaves', 'Oak Log', 'Bedrock', 'Sand', 'Glass', -- Ore blocks 'Coal Ore', 'Gold Ore', 'Iron Ore', 'Diamond Ore', -- Tools 'Wooden Pickaxe', 'Wooden Axe', 'Wooden Shovel', 'W...
262
real2nix/mineblox
real2nix-mineblox-ec774db/src/StarterPlayer/ParallelScripts/BiomeLoaderParallel.client.luau
luau
.luau
--!native local actor: Actor = script:GetActor() local ReplicatedStorage = game:GetService('ReplicatedStorage') local StarterPlayer = game:GetService('StarterPlayer') local ChunkSettings = require(ReplicatedStorage.Shared.ChunkSettings) local BiomeSelector = require(StarterPlayer.StarterPlayerScripts.Modules.Chunks.L...
259
real2nix/mineblox
real2nix-mineblox-ec774db/src/StarterPlayer/ParallelScripts/TerrainLoaderParallel.client.luau
luau
.luau
--!native local actor: Actor = script:GetActor() local ReplicatedStorage = game:GetService('ReplicatedStorage') local StarterPlayer = game:GetService('StarterPlayer') local ChunkSettings = require(ReplicatedStorage.Shared.ChunkSettings) local ItemsData = require(ReplicatedStorage.Shared.ItemsData) local TerrainShapeG...
320
real2nix/mineblox
real2nix-mineblox-ec774db/src/StarterPlayer/StarterPlayerScripts/Main.client.luau
luau
.luau
local Players = game:GetService('Players') local Modules = Players.LocalPlayer.PlayerScripts:WaitForChild('Modules') require(Modules.Chunks.ChunksManager) --require(Modules.Lighting) task.delay(.1, function() require(Modules.Break) require(Modules.CollisionsManager) end)
63
real2nix/mineblox
real2nix-mineblox-ec774db/src/StarterPlayer/StarterPlayerScripts/Modules/Break.luau
luau
.luau
local Break = {} local Players = game:GetService('Players') local ReplicatedStorage = game:GetService('ReplicatedStorage') local UserInputService = game:GetService('UserInputService') local Player: Player = Players.LocalPlayer local PlayerScripts = Player.PlayerScripts local Modules = PlayerScripts:WaitForChild('Mod...
853
real2nix/mineblox
real2nix-mineblox-ec774db/src/StarterPlayer/StarterPlayerScripts/Modules/Chunks/ChunksManager.luau
luau
.luau
--!native local ChunkLoading = {} local Players = game:GetService('Players') local ReplicatedStorage = game:GetService('ReplicatedStorage') local RunService = game:GetService('RunService') local Player: Player = Players.LocalPlayer local Character: Model = Player.Character or Player.CharacterAdded:Wait() local Humano...
4,901
real2nix/mineblox
real2nix-mineblox-ec774db/src/StarterPlayer/StarterPlayerScripts/Modules/Chunks/Data/ChunkGenerationStages.luau
luau
.luau
-- Represents what stage has been completed by a chunk return { ['none'] = 0, ['terrain'] = 1, ['biome'] = 2, ['done'] = 3 }
47
real2nix/mineblox
real2nix-mineblox-ec774db/src/StarterPlayer/StarterPlayerScripts/Modules/Chunks/Data/ChunksData.luau
luau
.luau
return {}
2
real2nix/mineblox
real2nix-mineblox-ec774db/src/StarterPlayer/StarterPlayerScripts/Modules/Chunks/Loading/Caves/CheeseCavesGenerator.luau
luau
.luau
local CheeseCavesGenerator = {} return CheeseCavesGenerator
13
real2nix/mineblox
real2nix-mineblox-ec774db/src/StarterPlayer/StarterPlayerScripts/Modules/Chunks/Loading/Caves/SpaghettiCavesGenerator.luau
luau
.luau
local SpaghettiCavesGenerator = {} return SpaghettiCavesGenerator
15
real2nix/mineblox
real2nix-mineblox-ec774db/src/StarterPlayer/StarterPlayerScripts/Modules/Chunks/Loading/Terrain/BedrockGenerator.luau
luau
.luau
--!native local BedrockGeneration = {} local ReplicatedStorage = game:GetService('ReplicatedStorage') local ChunkSettings = require(ReplicatedStorage.Shared.ChunkSettings) local ItemsData = require(ReplicatedStorage.Shared.ItemsData) local CHUNK_SIZE: number = ChunkSettings['CHUNK_SIZE'] local MAX_CHUNK_DISTANCE: nu...
233
real2nix/mineblox
real2nix-mineblox-ec774db/src/StarterPlayer/StarterPlayerScripts/Modules/Chunks/Loading/Terrain/Biomes/BiomeSelector.luau
luau
.luau
local BiomeSelector = {} local ReplicatedStorage = game:GetService('ReplicatedStorage') local StarterPlayer = game:GetService('StarterPlayer') local SplineMaps = require(StarterPlayer.StarterPlayerScripts.Modules.Chunks.Loading.Terrain.SplineMaps) local BiomesData = require(StarterPlayer.StarterPlayerScripts.Modules....
496
real2nix/mineblox
real2nix-mineblox-ec774db/src/StarterPlayer/StarterPlayerScripts/Modules/Chunks/Loading/Terrain/Biomes/BiomesData.luau
luau
.luau
local Players = game:GetService('Players') local Player: Player = Players.LocalPlayer local PlayerScripts = Player.PlayerScripts local Modules = PlayerScripts:WaitForChild('Modules') local ForestGenerator = require(Modules.Chunks.Loading.Terrain.Biomes.Forest.ForestGenerator) local DesertGenerator = require(Modules....
347
real2nix/mineblox
real2nix-mineblox-ec774db/src/StarterPlayer/StarterPlayerScripts/Modules/Chunks/Loading/Terrain/Biomes/Desert/DesertGenerator.luau
luau
.luau
local DesertGenerator = {} function DesertGenerator.generate(chunkBlocks: buffer) end return DesertGenerator
20
real2nix/mineblox
real2nix-mineblox-ec774db/src/StarterPlayer/StarterPlayerScripts/Modules/Chunks/Loading/Terrain/Biomes/Forest/Decorations/DecorationsGenerator.luau
luau
.luau
local DecorationsGenerator = {} local StarterPlayer = game:GetService("StarterPlayer") local TreesGenerator = require(StarterPlayer.StarterPlayerScripts.Modules.Chunks.Loading.Terrain.Decorations.Trees.TreesGenerator) --local DandelionGenerator = require(StarterPlayer.StarterPlayerScripts.Modules.Chunks.Loading.Terra...
363
real2nix/mineblox
real2nix-mineblox-ec774db/src/StarterPlayer/StarterPlayerScripts/Modules/Chunks/Loading/Terrain/Biomes/Forest/Decorations/Trees/Tree.luau
luau
.luau
local Tree = {} local ReplicatedStorage = game:GetService("ReplicatedStorage") local ItemsData = require(ReplicatedStorage.Shared.ItemsData) local OAK_LOG_ID = ItemsData['Oak Log']['ID'] local OAK_LEAVES_ID = ItemsData['Oak Leaves']['ID'] local MIN_LOGS = 3 local MAX_LOGS = 5 local LOGS_INSIDE_TREE = 2 -- PRIVATE...
639
real2nix/mineblox
real2nix-mineblox-ec774db/src/StarterPlayer/StarterPlayerScripts/Modules/Chunks/Loading/Terrain/Biomes/Forest/Decorations/Trees/TreesGenerator.luau
luau
.luau
local TreeGeneration = {} local ReplicatedStorage = game:GetService('ReplicatedStorage') local StarterPlayer = game:GetService("StarterPlayer") local Modules = StarterPlayer.StarterPlayerScripts.Modules local ChunkSettings = require(ReplicatedStorage.Shared.ChunkSettings) local ChunksUtil = require(ReplicatedStorage...
785
real2nix/mineblox
real2nix-mineblox-ec774db/src/StarterPlayer/StarterPlayerScripts/Modules/Chunks/Loading/Terrain/Biomes/Forest/Decorations/Unused/DandelionGenerator.luau
luau
.luau
local DandelionGeneration = {} local ReplicatedStorage = game:GetService('ReplicatedStorage') local ChunkSettings = require(ReplicatedStorage.Shared.ChunkSettings) local ChunksUtil = require(ReplicatedStorage.Shared.ChunksUtil) local ItemsData = require(ReplicatedStorage.Shared.ItemsData) local CHUNK_SIZE = ChunkSet...
332
real2nix/mineblox
real2nix-mineblox-ec774db/src/StarterPlayer/StarterPlayerScripts/Modules/Chunks/Loading/Terrain/Biomes/Forest/Decorations/Unused/GrassGenerator.luau
luau
.luau
local GrassGeneration = {} local ReplicatedStorage = game:GetService('ReplicatedStorage') local ChunkSettings = require(ReplicatedStorage.Shared.ChunkSettings) local ChunksUtil = require(ReplicatedStorage.Shared.ChunksUtil) local ItemsData = require(ReplicatedStorage.Shared.ItemsData) local CHUNK_SIZE = ChunkSetting...
313
real2nix/mineblox
real2nix-mineblox-ec774db/src/StarterPlayer/StarterPlayerScripts/Modules/Chunks/Loading/Terrain/Biomes/Forest/Decorations/Unused/OxeyeDaisyGenerator.luau
luau
.luau
local OxeyeGeneration = {} local ReplicatedStorage = game:GetService('ReplicatedStorage') local ChunkSettings = require(ReplicatedStorage.Shared.ChunkSettings) local ChunksUtil = require(ReplicatedStorage.Shared.ChunksUtil) local ItemsData = require(ReplicatedStorage.Shared.ItemsData) local CHUNK_SIZE = ChunkSetting...
338
real2nix/mineblox
real2nix-mineblox-ec774db/src/StarterPlayer/StarterPlayerScripts/Modules/Chunks/Loading/Terrain/Biomes/Forest/Decorations/Unused/PoppyGenerator.luau
luau
.luau
local PoppyGeneration = {} local ReplicatedStorage = game:GetService('ReplicatedStorage') local ChunkSettings = require(ReplicatedStorage.Shared.ChunkSettings) local ChunksUtil = require(ReplicatedStorage.Shared.ChunksUtil) local ItemsData = require(ReplicatedStorage.Shared.ItemsData) local CHUNK_SIZE = ChunkSetting...
325
real2nix/mineblox
real2nix-mineblox-ec774db/src/StarterPlayer/StarterPlayerScripts/Modules/Chunks/Loading/Terrain/Biomes/Forest/ForestGenerator.luau
luau
.luau
local ForestGenerator = {} local Players = game:GetService('Players') local ReplicatedStorage = game:GetService('ReplicatedStorage') local Player: Player = Players.LocalPlayer local PlayerScripts = Player.PlayerScripts local Modules = PlayerScripts:WaitForChild('Modules') local ChunksUtil = require(ReplicatedStorag...
540
real2nix/mineblox
real2nix-mineblox-ec774db/src/StarterPlayer/StarterPlayerScripts/Modules/Chunks/Loading/Terrain/Biomes/Forest/GrassLayerGenerator.luau
luau
.luau
local GrassLayerGenerator = {} local ReplicatedStorage = game:GetService('ReplicatedStorage') local ChunksUtil = require(ReplicatedStorage.Shared.ChunksUtil) local ChunkSettings = require(ReplicatedStorage.Shared.ChunkSettings) local ItemsData = require(ReplicatedStorage.Shared.ItemsData) local CHUNK_SIZE: number = ...
687
real2nix/mineblox
real2nix-mineblox-ec774db/src/StarterPlayer/StarterPlayerScripts/Modules/Chunks/Loading/Terrain/Biomes/Jungle/JungleGenerator.luau
luau
.luau
local JungleGenerator = {} function JungleGenerator.generate(chunkBlocks: buffer) end return JungleGenerator
20
real2nix/mineblox
real2nix-mineblox-ec774db/src/StarterPlayer/StarterPlayerScripts/Modules/Chunks/Loading/Terrain/Biomes/Tundra/TundraGenerator.luau
luau
.luau
local TundraGenerator = {} function TundraGenerator.generate(chunkBlocks: buffer) end return TundraGenerator
23
real2nix/mineblox
real2nix-mineblox-ec774db/src/StarterPlayer/StarterPlayerScripts/Modules/Chunks/Loading/Terrain/TerrainShapeGenerator.luau
luau
.luau
--!native local TerrainShapeGenerator = {} local ReplicatedStorage = game:GetService('ReplicatedStorage') local Players = game:GetService('Players') local Player: Player = Players.LocalPlayer local PlayerScripts = Player.PlayerScripts local Modules = PlayerScripts:WaitForChild('Modules') local SplineMaps = require(...
751
real2nix/mineblox
real2nix-mineblox-ec774db/src/StarterPlayer/StarterPlayerScripts/Modules/Chunks/Rendering/ChunkRenderer.luau
luau
.luau
local ChunkRenderer = {} -- 3333 max blocks, if face culling implemented -- = 8 * 8 * 52 = 3328 blocks --local buffer = buffer.create(12288) local AssetService = game:GetService("AssetService") local Atlas = AssetService:CreateEditableImageAsync("rbxassetid://17400483416") local ReplicatedStorage = game:GetService('R...
1,647
real2nix/mineblox
real2nix-mineblox-ec774db/src/StarterPlayer/StarterPlayerScripts/Modules/Chunks/Rendering/Data/AtlasTextureData.luau
luau
.luau
return { [1] = {}, [2] = {}, [3] = {2, 2, 2, 2, 2, 2}, [4] = {3, 3, 3, 3, 1, 2}, [5] = {9, 9, 9, 9, 9, 9}, [6] = {17, 17, 17, 17, 17, 17}, [7] = {4, 4, 4, 4, 5, 5}, [8] = {54, 54, 54, 54, 54, 54}, [9] = {21, 21, 21, 21, 22, 22}, }
176
real2nix/mineblox
real2nix-mineblox-ec774db/src/StarterPlayer/StarterPlayerScripts/Modules/Chunks/Rendering/Data/BlockMeshData.luau
luau
.luau
local BlockMeshData = {} BlockMeshData.rightVertices = { Vector3.new(.5, .5, .5), Vector3.new(.5, .5, -.5), Vector3.new(.5, -.5, .5), Vector3.new(.5, -.5, -.5) } BlockMeshData.rightIndices = {3, 4, 2, 2, 1, 3} BlockMeshData.leftVertices = { Vector3.new(-.5, .5, -.5), Vector3.new(-.5, .5, .5), Vector3.new(-.5, ...
502
real2nix/mineblox
real2nix-mineblox-ec774db/src/StarterPlayer/StarterPlayerScripts/Modules/Chunks/Rendering/Data/PlantMeshData.luau
luau
.luau
local PlantMeshData = {} PlantMeshData.leftVertices = { Vector3.new(-.5, .5, -.5), Vector3.new(.5, .5, .5), Vector3.new(-.5, -.5, -.5), Vector3.new(.5, -.5, .5), } PlantMeshData.leftIndices = {3, 4, 2, 2, 1, 3} PlantMeshData.rightVertices = { Vector3.new(-.5, .5, .5), Vector3.new(.5, .5, -.5), Vector3.new(-.5,...
174
real2nix/mineblox
real2nix-mineblox-ec774db/src/StarterPlayer/StarterPlayerScripts/Modules/CollisionsManager.luau
luau
.luau
local CollisionsManager = {} local Players = game:GetService('Players') local ReplicatedStorage = game:GetService('ReplicatedStorage') local RunService = game:GetService('RunService') local Player: Player = Players.LocalPlayer local Character: Model = Player.Character or Player.CharacterAdded:Wait() local HumanoidRoo...
984
real2nix/mineblox
real2nix-mineblox-ec774db/src/StarterPlayer/StarterPlayerScripts/Modules/Lighting.luau
luau
.luau
local LightingController = {} local Lighting = game:GetService('Lighting') local ReplicatedStorage = game:GetService('ReplicatedStorage') local ChunkSettings = require(ReplicatedStorage.Shared.ChunkSettings) local CHUNK_DISTANCE: number = ChunkSettings['CHUNK_DISTANCE'] local CHUNK_SIZE: number = ChunkSettings['CHUN...
120
centau/ecr
centau-ecr-574ca8f/src/ecr.luau
luau
.luau
-------------------------------------------------------------------------------- -- ecr.luau -- v0.9.0 -------------------------------------------------------------------------------- local ID_SIZE = 4 local MAX_ENTITIES = 0x0000_FFFF -------------------------------------------------------------------------------- --...
19,273
flipbook-labs/flipbook
flipbook-labs-flipbook-8b74d51/.agents/skills/flipbook-diagnostics-and-tooling/scripts/check-sourcemap-freshness.luau
luau
.luau
#!/usr/bin/env lute -- Check whether sourcemaps are fresh relative to their source files. -- Run from the repo root: lute run .agents/skills/flipbook-diagnostics-and-tooling/scripts/check-sourcemap-freshness.luau -- Reports whether each sourcemap is newer than the newest source file it covers. local fs = require("@std...
868
flipbook-labs/flipbook
flipbook-labs-flipbook-8b74d51/.agents/skills/flipbook-diagnostics-and-tooling/scripts/detect-env-drift.luau
luau
.luau
#!/usr/bin/env lute -- Detect environment-variable drift by scanning source files. -- Run from the repo root: lute run .agents/skills/flipbook-diagnostics-and-tooling/scripts/detect-env-drift.luau -- Compares process.env reads in code against .env.template declarations. local fs = require("@std/fs") local path = requi...
937
flipbook-labs/flipbook
flipbook-labs-flipbook-8b74d51/.agents/skills/flipbook-diagnostics-and-tooling/scripts/inventory-stories.luau
luau
.luau
#!/usr/bin/env lute -- Inventory all stories and specs in the workspace. -- Run from the repo root: lute run .agents/skills/flipbook-diagnostics-and-tooling/scripts/inventory-stories.luau -- Outputs a summary of story/spec counts per workspace member. local fs = require("@std/fs") local path = require("@std/path") --...
611
flipbook-labs/flipbook
flipbook-labs-flipbook-8b74d51/.lune/lib/parseArgs.luau
luau
.luau
local FLAG_PATTERN = "%-%-(%w+)" local FLAG_ALL_IN_ONE_PATTERN = `{FLAG_PATTERN}=(%w+)` local function parseArgs(args: { string }) local parsedArgs: { [string]: string | boolean | number } = {} local skipNextToken = false for index, token in args do -- When `--foo bar` is used, these are both individual tokens ...
354
flipbook-labs/flipbook
flipbook-labs-flipbook-8b74d51/.lute/build.luau
luau
.luau
local FlipbookBatteries = require("@luaupkg/flipbook-batteries@v0.9.0") local cli = require("@luaupkg/lute@v1.0.0/batteries/cli") local dotenv = require("@luaupkg/dotenv@v0.1.0/src") local fs = require("@std/fs") local path = require("@std/path") local pp = require("@luaupkg/lute@v1.0.0/batteries/pp") local process = r...
1,786
flipbook-labs/flipbook
flipbook-labs-flipbook-8b74d51/.lute/bump-version.luau
luau
.luau
local cli = require("@luaupkg/lute@v1.0.0/batteries/cli") local fs = require("@std/fs") local path = require("@std/path") local findAndReplace = require("@scripts/lib/findAndReplace") local loomConfig = require("@repo/loom.config") local semver = require("@scripts/lib/semver") type VersionComponent = semver.VersionCo...
712
flipbook-labs/flipbook
flipbook-labs-flipbook-8b74d51/.lute/clean.luau
luau
.luau
local clean = require("@scripts/lib/clean") clean()
12
flipbook-labs/flipbook
flipbook-labs-flipbook-8b74d51/.lute/lib/build-system/compileWorkspaceMemberAsync.luau
luau
.luau
local FlipbookBatteries = require("@luaupkg/flipbook-batteries@v0.9.0") local fs = require("@std/fs") local path = require("@std/path") local project = require("@repo/project") local runBuildGroupAsync = require("@scripts/lib/build-system/runBuildGroupAsync") local types = require("@scripts/lib/build-system/types") l...
428
flipbook-labs/flipbook
flipbook-labs-flipbook-8b74d51/.lute/lib/build-system/hashPath.luau
luau
.luau
local crypto = require("@lute/crypto") local fs = require("@std/fs") local path = require("@std/path") local HASH_METHOD = crypto.hash.md5 local function bufferToHex(buf: buffer): string local hex = "" for i = 0, buffer.len(buf) - 1 do hex ..= ("%02x"):format(buffer.readu8(buf, i)) end return hex end local fun...
288
flipbook-labs/flipbook
flipbook-labs-flipbook-8b74d51/.lute/lib/build-system/init.luau
luau
.luau
local types = require("@self/types") export type BuildContext = types.BuildContext return { compileAsync = require("@self/compileAsync"), compileWorkspaceMemberAsync = require("@self/compileWorkspaceMemberAsync"), readBuildCacheAsync = require("@self/readBuildCacheAsync"), writeBuildCacheAsync = require("@self/wr...
85
flipbook-labs/flipbook
flipbook-labs-flipbook-8b74d51/.lute/lib/build-system/readBuildCacheAsync.luau
luau
.luau
local fs = require("@std/fs") local json = require("@std/json") local project = require("@repo/project") local types = require("@scripts/lib/build-system/types") local function readBuildCacheAsync(): types.BuildCache if fs.exists(project.BUILD_CACHE_PATH) then local content = fs.readFileToString(project.BUILD_CACH...
103
flipbook-labs/flipbook
flipbook-labs-flipbook-8b74d51/.lute/lib/build-system/runBuildGroupAsync.luau
luau
.luau
local fs = require("@std/fs") local process = require("@std/process") local richterm = require("@luaupkg/lute@v1.0.0/batteries/richterm") local hashPath = require("@scripts/lib/build-system/hashPath") local types = require("@scripts/lib/build-system/types") type BuildGroup = types.BuildGroup local function trimDecim...
424
flipbook-labs/flipbook
flipbook-labs-flipbook-8b74d51/.lute/lib/build-system/types.luau
luau
.luau
local path = require("@std/path") export type Channel = "prod" | "beta" | "dev" export type Target = "roblox" | "rotriever" export type BuildCache = { -- Maps file path to MD5 hash [string]: string, } export type BuildContext = { channel: Channel, target: Target, dest: path.Path, env: { [string]: string }, sh...
136
flipbook-labs/flipbook
flipbook-labs-flipbook-8b74d51/.lute/lib/build-system/writeBuildCacheAsync.luau
luau
.luau
local fs = require("@std/fs") local json = require("@std/json") local project = require("@repo/project") local types = require("@scripts/lib/build-system/types") local function writeBuildCacheAsync(buildCache: types.BuildCache) local contents = json.serialize(buildCache :: json.Object, true) fs.writeStringToFile(pr...
80
flipbook-labs/flipbook
flipbook-labs-flipbook-8b74d51/.lute/lib/clean.luau
luau
.luau
local fs = require("@std/fs") local path = require("@std/path") local getStudioPluginsPath = require("@scripts/lib/getStudioPluginsPath") local project = require("@repo/project") local PATHS_TO_CLEAN: { path.Pathlike } = { project.BUILD_PATH, path.join(getStudioPluginsPath(), project.PLUGIN_FILENAME), project.PLUG...
167
flipbook-labs/flipbook
flipbook-labs-flipbook-8b74d51/.lute/lib/createRojoProjectAsync.luau
luau
.luau
local fs = require("@std/fs") local json = require("@std/json") local path = require("@std/path") local function createRojoProjectAsync(projectPath: path.Pathlike, projectContent: json.Value): path.Path local resolvedProjectPath = path.resolve(projectPath) fs.writeStringToFile(resolvedProjectPath, json.serialize(pro...
86
flipbook-labs/flipbook
flipbook-labs-flipbook-8b74d51/.lute/lib/findAndReplace.luau
luau
.luau
local fs = require("@std/fs") local path = require("@std/path") local function findAndReplace(filePath: path.Pathlike, match: string, replacement: string) local content = fs.readFileToString(filePath) content = content:gsub(match, replacement) fs.writeStringToFile(filePath, content) end return findAndReplace
66
flipbook-labs/flipbook
flipbook-labs-flipbook-8b74d51/.lute/lib/getDescendants.luau
luau
.luau
local fs = require("@std/fs") local path = require("@std/path") local function reduce(rootPath: path.Path, accumulator: { path.Path }): { path.Path } for _, child in fs.listDirectory(rootPath) do local childPath = path.join(rootPath, child.name) table.insert(accumulator, childPath) if child.type == "dir" then ...
152
flipbook-labs/flipbook
flipbook-labs-flipbook-8b74d51/.lute/lib/getStudioPluginsPath.luau
luau
.luau
local path = require("@std/path") local process = require("@std/process") local system = require("@std/system") local function getStudioPluginPath(): path.Path if system.os == "Darwin" then return path.join(process.homedir(), "Documents/Roblox/Plugins") else return path.join(process.homedir(), "AppData/Local/Rob...
93
flipbook-labs/flipbook
flipbook-labs-flipbook-8b74d51/.lute/lib/packToRbxm.luau
luau
.luau
local path = require("@std/path") local rojoBuild = require("./rojoBuild") local function packToRbxm(filePath: path.Pathlike): path.Path local resolvedFilePath = path.resolve(filePath) local modelPath = rojoBuild({ output = path.resolve(`{resolvedFilePath}.rbxm`), project = { name = tostring(path.basename(f...
112
flipbook-labs/flipbook
flipbook-labs-flipbook-8b74d51/.lute/lib/rojoBuild.luau
luau
.luau
local FlipbookBatteries = require("@luaupkg/flipbook-batteries@v0.9.0") local fs = require("@std/fs") local path = require("@std/path") local system = require("@std/system") local createRojoProjectAsync = require("@scripts/lib/createRojoProjectAsync") local json = require("@std/json") local run = FlipbookBatteries.ru...
303
flipbook-labs/flipbook
flipbook-labs-flipbook-8b74d51/.lute/lib/semver.luau
luau
.luau
local fs = require("@std/fs") local toml = require("@luaupkg/lute@v1.0.0/batteries/toml") export type VersionComponent = "major" | "minor" | "patch" local function getVersionFromManifest(manifestPath: string) local manifest = toml.deserialize(fs.readFileToString(manifestPath)) if manifest.workspace then return (...
248
flipbook-labs/flipbook
flipbook-labs-flipbook-8b74d51/.lute/lib/waitForTasks.luau
luau
.luau
local task = require("@lute/task") local function waitForTasks(tasks: { thread }) local running = table.clone(tasks) while #running > 0 do for index, job in running do if coroutine.status(job) == "dead" then table.remove(running, index) end end task.wait() end end return waitForTasks
80
flipbook-labs/flipbook
flipbook-labs-flipbook-8b74d51/.lute/lint.luau
luau
.luau
local FlipbookBatteries = require("@luaupkg/flipbook-batteries@v0.9.0") local path = require("@std/path") local process = require("@std/process") local project = require("@repo/project") local run = FlipbookBatteries.run local findWhere = FlipbookBatteries.findWhere local function findLuaFiles() local result = {} ...
244
flipbook-labs/flipbook
flipbook-labs-flipbook-8b74d51/.lute/serve-docs.luau
luau
.luau
local FlipbookBatteries = require("@luaupkg/flipbook-batteries@v0.9.0") local run = FlipbookBatteries.run run("npm", { "install", }, { cwd = "docs", }) run("npm", { "start", }, { cwd = "docs", })
72
flipbook-labs/flipbook
flipbook-labs-flipbook-8b74d51/.lute/tasks/run-tests.luau
luau
.luau
local ReplicatedStorage = game:GetService("ReplicatedStorage") -- This path comes from the tests place built in `.lute/test.luau` local TestRunner = (require :: any)(ReplicatedStorage.Flipbook.workspace["test-runner"]) TestRunner.runTests() return nil
58
flipbook-labs/flipbook
flipbook-labs-flipbook-8b74d51/project.luau
luau
.luau
local path = require("@std/path") return { REPO_PATH = path.resolve("."), SOURCE_PATH = path.resolve("./src"), BUILD_PATH = path.resolve("./build"), BUILD_CACHE_PATH = path.resolve("./build/build-cache.json"), PACKAGES_PATH = path.resolve("./Packages"), ROBLOX_PACKAGES_PATH = path.resolve("./RobloxPackages"), R...
353
flipbook-labs/flipbook
flipbook-labs-flipbook-8b74d51/src/EmbeddedClientStarterScript.client.luau
luau
.luau
--[[ There are two ways to embed Flipbook into an experience: 1. By using the "Embed into Experience" dialog, which allows you to select a destination in the Explorer where Flipbook will clone itself to. 2. By using flipbook-cli to deploy the latest release of Flipbook to an experience ]] -- Exit immediat...
291
flipbook-labs/flipbook
flipbook-labs-flipbook-8b74d51/src/EmbeddedServerStarterScript.server.luau
luau
.luau
-- Exit immediately if this script isn't running in an embedded context. local PluginDebugService: PluginDebugService? = game:FindService("PluginDebugService") if PluginDebugService and PluginDebugService:IsAncestorOf(script) then return end local startTime = os.clock() local prefix = `[{script.Name}]` local Players...
120
flipbook-labs/flipbook
flipbook-labs-flipbook-8b74d51/workspace/code-samples/src/Default/Button.story.luau
luau
.luau
return { story = function() local button = Instance.new("TextButton") button.Text = "Button" button.TextSize = 16 button.Font = Enum.Font.BuilderSansExtraBold button.TextColor3 = Color3.fromRGB(50, 50, 50) button.BackgroundColor3 = Color3.fromRGB(255, 255, 255) button.BorderSizePixel = 0 button.Size = ...
126
flipbook-labs/flipbook
flipbook-labs-flipbook-8b74d51/workspace/code-samples/src/Default/ProjectName.storybook.luau
luau
.luau
return { storyRoots = { script.Parent, }, }
15
flipbook-labs/flipbook
flipbook-labs-flipbook-8b74d51/workspace/code-samples/src/Fusion/Fusion.storybook.luau
luau
.luau
local Fusion = require("@pkg/Fusion") return { name = "Fusion", storyRoots = { script.Parent, }, packages = { Fusion = Fusion, }, }
42
flipbook-labs/flipbook
flipbook-labs-flipbook-8b74d51/workspace/code-samples/src/Fusion/FusionButton.luau
luau
.luau
local Fusion = require("@pkg/Fusion") local New = Fusion.New local OnEvent = Fusion.OnEvent local function FusionButton(props: { text: string, onActivated: () -> (), }) return New("TextButton")({ Text = props.text, TextSize = 16, Font = Enum.Font.BuilderSansExtraBold, TextColor3 = Color3.fromRGB(50, 50, 50...
152
flipbook-labs/flipbook
flipbook-labs-flipbook-8b74d51/workspace/code-samples/src/Fusion/FusionButton.story.luau
luau
.luau
local FusionButton = require("./FusionButton") return { story = function() return FusionButton({ text = "Click Me", onActivated = function() print("click") end, }) end, }
49
flipbook-labs/flipbook
flipbook-labs-flipbook-8b74d51/workspace/code-samples/src/FusionStoryteller/Fusion.storybook.luau
luau
.luau
local Fusion = require("@pkg/Fusion") local Storyteller = require("@pkg/Storyteller") local storybook: Storyteller.Storybook = { name = "Fusion (Storyteller)", storyRoots = { script.Parent, }, packages = { Fusion = Fusion, }, } return storybook
73
flipbook-labs/flipbook
flipbook-labs-flipbook-8b74d51/workspace/code-samples/src/FusionStoryteller/FusionButton.story.luau
luau
.luau
local Storyteller = require("@pkg/Storyteller") local FusionButton = require("./FusionButton") local story: Storyteller.Story<any> = { story = function() return FusionButton({ text = "Click Me", onActivated = function() print("click") end, }) end, } return story
75