-- FloatingSphere Plugin -- This plugin creates a floating glass sphere filled with lava in the sky. -- Function to create a floating glass sphere function CreateFloatingSphere(World, CenterX, CenterY, CenterZ, Radius, OuterBlock, InnerBlock) LOG("Creating sphere at (" .. CenterX .. ", " .. CenterY .. ", " .. CenterZ .. ") with radius " .. Radius) for x = -Radius, Radius do for y = -Radius, Radius do for z = -Radius, Radius do local distanceSquared = x * x + y * y + z * z if distanceSquared <= Radius * Radius then local blockType = InnerBlock if distanceSquared > (Radius - 1) * (Radius - 1) then blockType = OuterBlock end local Pos = Vector3i(CenterX + x, CenterY + y, CenterZ + z) World:SetBlock(Pos, blockType, 0) LOG("Placed " .. (blockType == E_BLOCK_GLASS and "glass" or "lava") .. " at: " .. Pos.x .. ", " .. Pos.y .. ", " .. Pos.z) end end end end LOG("Sphere creation complete!") end -- Initialization function (required by Cuberite) function Initialize(Plugin) Plugin:SetName("FloatingSphere") Plugin:SetVersion(1) LOG("Initialized FloatingSphere plugin!") -- Get the default world local World = cRoot:Get():GetDefaultWorld() if World == nil then LOGERROR("Could not find the default world!") return false end LOG("Default world is: " .. World:GetName()) -- Create the floating sphere local CenterX = 0 -- X coordinate of the sphere center local CenterY = 150 -- Y coordinate of the sphere center (height above ground) local CenterZ = 0 -- Z coordinate of the sphere center local Radius = 10 -- Radius of the sphere local OuterBlock = E_BLOCK_GLASS -- Material for the outer shell local InnerBlock = E_BLOCK_LAVA -- Material for the inner core LOG("Attempting to create a floating sphere...") CreateFloatingSphere(World, CenterX, CenterY, CenterZ, Radius, OuterBlock, InnerBlock) return true end