Minecraft-like Roblox block game rblx.games/135624152691584
roblox roblox-game rojo

core: remove redundant waits

+11 -11
+4 -4
src/ReplicatedStorage/Shared/ChunkManager/BlockManager.lua
··· 5 5 6 6 BlockManager.BlockIdMappings = {} :: {BasePart} 7 7 8 - for i,v in pairs(game:GetService("ReplicatedStorage"):WaitForChild("Blocks"):GetChildren()) do 8 + for _,v in pairs(game:GetService("ReplicatedStorage"):WaitForChild("Blocks"):GetChildren()) do 9 9 BlockManager.BlockIdMappings[v:GetAttribute("n")] = v 10 10 end 11 11 12 12 BlockManager.UpdateIdMappings = {} :: {BasePart} 13 13 14 - for i,v in pairs(game:GetService("ReplicatedStorage"):WaitForChild("BlockUpdateOperations"):GetChildren()) do 14 + for _,v in pairs(game:GetService("ReplicatedStorage"):WaitForChild("BlockUpdateOperations"):GetChildren()) do 15 15 local success, reason = pcall(function() 16 16 BlockManager.UpdateIdMappings[v:GetAttribute("n")] = require(v) 17 17 end) ··· 37 37 local b = BlockManager.BlockIdMappings[blockId]:Clone() 38 38 b.Size = Vector3.new(3.95,3.95,3.95) 39 39 40 - for i,v in pairs(attr or {}) do 41 - b:SetAttribute(i,v) 40 + for _,v in pairs(attr or {}) do 41 + b:SetAttribute(_,v) 42 42 end 43 43 44 44 if BlockManager.UpdateIdMappings[blockId] then
+1 -1
src/ReplicatedStorage/Shared/ChunkManager/ChunkBuilder.lua
··· 117 117 if existing then 118 118 task.defer(function() 119 119 task.synchronize() 120 - RunService.RenderStepped:Wait() 120 + -- RunService.RenderStepped:Wait() 121 121 if existing.Parent then 122 122 existing:Destroy() 123 123 end
+6 -6
src/ReplicatedStorage/Shared/PlacementManager.lua
··· 139 139 print("[DEBUG] Client missing block; resyncing nearby chunks") 140 140 ChunkManager:ResyncAroundChunk(cx, cy, cz, 1) 141 141 task.defer(function() 142 - task.synchronize() 143 - RunService.RenderStepped:Wait() 144 - task.desynchronize() 142 + -- task.synchronize() 143 + -- RunService.RenderStepped:Wait() 144 + -- task.desynchronize() 145 145 local refreshed = ChunkManager:GetChunk(cx, cy, cz) 146 146 if refreshed and refreshed:GetBlockAt(x, y, z) then 147 147 task.synchronize() ··· 254 254 if not pendingBreakResync[key] then 255 255 pendingBreakResync[key] = true 256 256 task.defer(function() 257 - task.synchronize() 258 - RunService.RenderStepped:Wait() 259 - task.desynchronize() 257 + -- task.synchronize() 258 + -- RunService.RenderStepped:Wait() 259 + -- task.desynchronize() 260 260 pendingBreakResync[key] = nil 261 261 ChunkManager:ResyncAroundChunk(cx, cy, cz, 1) 262 262 end)