core: some fixes

This commit is contained in:
2026-01-09 17:02:35 +02:00
parent 2a0dd51659
commit 4785795640
10 changed files with 166 additions and 96 deletions

View File

@@ -43,9 +43,10 @@ local function rebuildBlockCatalog()
for _, block in ipairs(blocksFolder:GetChildren()) do
local id = block:GetAttribute("n")
if id ~= nil then
local displayName = block:GetAttribute("name") or block:GetAttribute("displayName") or block:GetAttribute("dn") or block.Name
table.insert(blockCatalog, {
id = tostring(id),
name = block:GetAttribute("displayName") or block:GetAttribute("dn") or block.Name,
name = displayName,
})
end
end

View File

@@ -1,47 +0,0 @@
--!native
--!optimize 2
local Players = game:GetService("Players")
local SCALE = 1.3
local function applyScale(character: Model)
if character.ScaleTo then
pcall(function()
character:ScaleTo(SCALE)
end)
return
end
local humanoid = character:FindFirstChildOfClass("Humanoid")
if not humanoid then
return
end
if humanoid.RigType == Enum.HumanoidRigType.R15 then
for _, name in ipairs({"BodyHeightScale", "BodyWidthScale", "BodyDepthScale", "HeadScale"}) do
local scaleValue = humanoid:FindFirstChild(name)
if scaleValue then
scaleValue.Value = SCALE
end
end
end
end
local function onCharacterAdded(character: Model)
character:WaitForChild("Humanoid", 5)
applyScale(character)
end
local function onPlayerAdded(player: Player)
player.CharacterAdded:Connect(onCharacterAdded)
if player.Character then
onCharacterAdded(player.Character)
end
end
for _, player in ipairs(Players:GetPlayers()) do
onPlayerAdded(player)
end
Players.PlayerAdded:Connect(onPlayerAdded)

View File

@@ -63,9 +63,7 @@ function TerrainGen:GetChunk(x, y, z)
if y == 1 then
for cx = 1, 8 do
for cz = 1, 8 do
--local perlin = math.noise(((x*8)+cx)/100,((z*8)+cz)/100)
chunk:CreateBlock(cx, 1, cz, { id = 1, state = {} })
--chunk:CreateBlock(x, 2, z, { id = 1, state = {} })
chunk:CreateBlock(cx, 1, cz, { id = "mc:grass_block", state = {} })
end
end
end
@@ -73,9 +71,7 @@ function TerrainGen:GetChunk(x, y, z)
for cx = 1, 8 do
for cy = 1, 8 do
for cz = 1, 8 do
--local perlin = math.noise(((x*8)+cx)/100,((z*8)+cz)/100)
chunk:CreateBlock(cx, cy, cz, { id = 2, state = {} })
--chunk:CreateBlock(x, 2, z, { id = 1, state = {} })
chunk:CreateBlock(cx, cy, cz, { id = "mc:dirt_block", state = {} })
end
end
end
@@ -93,9 +89,7 @@ function TerrainGen:GetFakeChunk(x, y, z)
for cy = 1,8 do
for cx = 1, 8 do
for cz = 1, 8 do
--local perlin = math.noise(((x*8)+cx)/100,((z*8)+cz)/100)
chunk:CreateBlock(cx, cy, cz, { id = -2, state = {} })
--chunk:CreateBlock(x, 2, z, { id = 1, state = {} })
chunk:CreateBlock(cx, cy, cz, { id = "invalid", state = {} })
end
end
end