{"TotalCount":3,"Files":[{"Ident":"trend.mcclouds","Path":".obj/__compiler_extra.cs","FileName":"__compiler_extra.cs","PackageType":"library","CodeKind":"Game","AssetVersionId":282324,"IsPrivate":false,"Code":"global using static Sandbox.Internal.GlobalGameNamespace;\r\nglobal using Microsoft.AspNetCore.Components;\r\nglobal using Microsoft.AspNetCore.Components.Rendering;\r\n[assembly: global::System.Reflection.AssemblyMetadata( \u0022AddonTitle\u0022, \u0022MC Clouds\u0022 )]\r\n[assembly: global::System.Reflection.AssemblyMetadata( \u0022AddonIdent\u0022, \u0022mcclouds\u0022 )]\r\n[assembly: global::System.Reflection.AssemblyMetadata( \u0022OrgIdent\u0022, \u0022trend\u0022 )]\r\n[assembly: global::System.Reflection.AssemblyMetadata( \u0022Ident\u0022, \u0022trend.mcclouds\u0022 )]\r\n[assembly: global::System.Reflection.AssemblyMetadata( \u0022EngineVersion\u0022, \u002226\u0022 )]\r\n[assembly: global::System.Reflection.AssemblyMetadata( \u0022EngineMinorVersion\u0022, \u00221\u0022 )]\r\n\r\n[assembly: System.Runtime.Versioning.TargetFramework( \u0022.NETCoreApp,Version=v9.0\u0022, FrameworkDisplayName = \u0022.NET 9.0\u0022 )]\r\n[assembly: global::System.Reflection.AssemblyMetadata( \u0022CompileTime\u0022, \u00222026-06-16T17:04:05.4666731Z\u0022 )]\r\n[assembly: global::System.Reflection.AssemblyVersion(\u00220.0.124.0\u0022)]\r\n[assembly: global::System.Reflection.AssemblyFileVersion(\u00220.0.124.0\u0022)]"},{"Ident":"trend.mcclouds","Path":"MinecraftClouds.cs","FileName":"MinecraftClouds.cs","PackageType":"library","CodeKind":"Game","AssetVersionId":282324,"IsPrivate":false,"Code":"using Sandbox;\r\nusing System.Collections.Generic;\r\n\r\n/// \u003Csummary\u003E\r\n/// Builds a 3D Minecraft \u0022fancy\u0022 cloud field from a clouds.png-style mask texture.\r\n/// One box per opaque pixel, interior faces culled, scrolled over time.\r\n/// RandomizeStart rolls the texture read to a random pixel offset so the field\r\n/// shows a different slice of the pattern without moving the GameObject.\r\n/// Pair with the clouds.shader material (face-shaded by normal).\r\n/// \u003C/summary\u003E\r\n[Title( \u0022Minecraft Clouds\u0022 )]\r\n[Category( \u0022Rendering\u0022 )]\r\npublic sealed class MinecraftClouds : Component\r\n{\r\n\t[Property] public Texture CloudTexture { get; set; }\r\n\t[Property] public Material CloudMaterial { get; set; }\r\n\r\n\t/// \u003Csummary\u003EWorld units per cloud pixel. MC = 12 blocks \u2248 472u. Lower this for a smaller map.\u003C/summary\u003E\r\n\t[Property, Range( 1f, 4096f )] public float CellSize { get; set; } = 472f;\r\n\r\n\t/// \u003Csummary\u003ECloud layer thickness. MC = 4 blocks \u2248 157u.\u003C/summary\u003E\r\n\t[Property, Range( 1f, 1024f )] public float Thickness { get; set; } = 157f;\r\n\r\n\t/// \u003Csummary\u003EScroll speed along \u002BX (units/sec). 0 = static.\u003C/summary\u003E\r\n\t[Property, Range( 0f, 512f )] public float ScrollSpeed { get; set; } = 24f;\r\n\r\n\t/// \u003Csummary\u003EAlpha threshold (0..255) for treating a pixel as cloud.\u003C/summary\u003E\r\n\t[Property, Range( 0, 255 )] public int AlphaThreshold { get; set; } = 127;\r\n\r\n\t/// \u003Csummary\u003EStart the field at a random point in the texture (rolls the pattern, no GameObject moving needed).\u003C/summary\u003E\r\n\t[Property] public bool RandomizeStart { get; set; } = true;\r\n\r\n\t/// \u003Csummary\u003EFixed seed for the random start. 0 = different every time.\u003C/summary\u003E\r\n\t[Property] public int Seed { get; set; } = 0;\r\n\r\n\tprivate Model _model;\r\n\tprivate SceneObject _a, _b;     // two copies so the field never gaps while scrolling in X\r\n\tprivate float _tileWidth;\r\n\tprivate Vector3 _basePos;\r\n\r\n\tprotected override void OnStart()\r\n\t{\r\n\t\tif ( !BuildModel() )\r\n\t\t\treturn;\r\n\r\n\t\t_basePos = Transform.World.Position;\r\n\t\t_a = new SceneObject( Scene.SceneWorld, _model );\r\n\t\t_b = new SceneObject( Scene.SceneWorld, _model );\r\n\t\tConfigureSceneObject( _a );\r\n\t\tConfigureSceneObject( _b );\r\n\t\tUpdatePositions( 0f );\r\n\t}\r\n\r\n\tprivate static void ConfigureSceneObject( SceneObject so )\r\n\t{\r\n\t\t// Put them in the translucent pass so they sort by distance correctly...\r\n\t\tso.Flags.IsOpaque = false;\r\n\t\tso.Flags.IsTranslucent = true;\r\n\r\n\t\t// ...and opt out of the lighting/shadow system so the sky\u0027s indirect\r\n\t\t// (light probe / ambient) doesn\u0027t tint them. The shader is already unlit;\r\n\t\t// this stops the renderer from feeding them probe lighting at all.\r\n\t\tso.Flags.NeedsLightProbe = false;\r\n\t\tso.Flags.CastShadows = false;\r\n\r\n\t\t// Optional: give them a tag so a camera could include/exclude them as a layer.\r\n\t\tso.Tags.Add( \u0022clouds\u0022 );\r\n\t}\r\n\r\n\tprotected override void OnUpdate()\r\n\t{\r\n\t\tif ( _a is null ) return;\r\n\t\tfloat offset = ScrollSpeed \u003C= 0f ? 0f : (Time.Now * ScrollSpeed) % _tileWidth;\r\n\t\tUpdatePositions( offset );\r\n\t}\r\n\r\n\tprotected override void OnDestroy()\r\n\t{\r\n\t\t_a?.Delete(); _a = null;\r\n\t\t_b?.Delete(); _b = null;\r\n\t}\r\n\r\n\tprivate void UpdatePositions( float offset )\r\n\t{\r\n\t\t_a.Transform = new Transform( _basePos \u002B new Vector3( offset, 0, 0 ) );\r\n\t\t_b.Transform = new Transform( _basePos \u002B new Vector3( offset - _tileWidth, 0, 0 ) );\r\n\t}\r\n\r\n\tprivate bool BuildModel()\r\n\t{\r\n\t\tif ( CloudTexture is null || CloudMaterial is null )\r\n\t\t{\r\n\t\t\tLog.Warning( \u0022MinecraftClouds: assign both CloudTexture and CloudMaterial.\u0022 );\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tint w = CloudTexture.Width;\r\n\t\tint h = CloudTexture.Height;\r\n\t\tColor32[] px = CloudTexture.GetPixels();\r\n\t\tif ( px is null || px.Length \u003C w * h )\r\n\t\t{\r\n\t\t\tLog.Warning( \u0022MinecraftClouds: couldn\u0027t read pixels. Import clouds.png uncompressed / readable.\u0022 );\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t// Roll the texture read to a random starting pixel. clouds.png tiles seamlessly,\r\n\t\t// so a wrapped offset is just as valid a cloud field \u2014 only the pattern shifts.\r\n\t\tint rx = 0, ry = 0;\r\n\t\tif ( RandomizeStart )\r\n\t\t{\r\n\t\t\tvar rng = Seed != 0 ? new System.Random( Seed ) : new System.Random();\r\n\t\t\trx = rng.Next( 0, w );\r\n\t\t\try = rng.Next( 0, h );\r\n\t\t}\r\n\r\n\t\tbool IsCloud( int x, int y )\r\n\t\t{\r\n\t\t\tint sx = ((x \u002B rx) % w \u002B w) % w;   // wrap (handles -1 at the edges too)\r\n\t\t\tint sy = ((y \u002B ry) % h \u002B h) % h;\r\n\t\t\tvar c = px[sy * w \u002B sx];\r\n\t\t\t// alpha mask (vanilla) with a luminance gate (handles opaque white-on-black sheets)\r\n\t\t\treturn c.a \u003E AlphaThreshold \u0026\u0026 (c.r \u003E 10 || c.g \u003E 10 || c.b \u003E 10);\r\n\t\t}\r\n\r\n\t\tvar verts = new List\u003CVertex\u003E( 1 \u003C\u003C 17 );\r\n\t\tvar indices = new List\u003Cint\u003E( 1 \u003C\u003C 17 );\r\n\r\n\t\tvoid Quad( Vector3 a, Vector3 b, Vector3 c, Vector3 d, Vector3 n )\r\n\t\t{\r\n\t\t\tVector3 t = Vector3.Cross( n, Vector3.Up );\r\n\t\t\tif ( t.LengthSquared \u003C 0.001f ) t = Vector3.Forward;\r\n\t\t\tt = t.Normal;\r\n\r\n\t\t\tint bi = verts.Count;\r\n\t\t\tverts.Add( new Vertex( a, n, t, new Vector2( 0, 0 ) ) );\r\n\t\t\tverts.Add( new Vertex( b, n, t, new Vector2( 1, 0 ) ) );\r\n\t\t\tverts.Add( new Vertex( c, n, t, new Vector2( 1, 1 ) ) );\r\n\t\t\tverts.Add( new Vertex( d, n, t, new Vector2( 0, 1 ) ) );\r\n\t\t\tindices.Add( bi \u002B 0 ); indices.Add( bi \u002B 1 ); indices.Add( bi \u002B 2 );\r\n\t\t\tindices.Add( bi \u002B 0 ); indices.Add( bi \u002B 2 ); indices.Add( bi \u002B 3 );\r\n\t\t}\r\n\r\n\t\tfloat cs = CellSize;\r\n\t\tfloat th = Thickness;\r\n\r\n\t\t// Center the field on the GameObject so clouds extend in every horizontal\r\n\t\t// direction (otherwise the GameObject sits at the corner and you see an edge).\r\n\t\tfloat halfW = w * cs * 0.5f;\r\n\t\tfloat halfH = h * cs * 0.5f;\r\n\r\n\t\tfor ( int y = 0; y \u003C h; y\u002B\u002B )\r\n\t\t\tfor ( int x = 0; x \u003C w; x\u002B\u002B )\r\n\t\t\t{\r\n\t\t\t\tif ( !IsCloud( x, y ) ) continue;\r\n\r\n\t\t\t\tfloat x0 = x * cs - halfW, x1 = x0 \u002B cs;\r\n\t\t\t\tfloat y0 = y * cs - halfH, y1 = y0 \u002B cs;\r\n\t\t\t\tfloat z0 = 0f, z1 = th;\r\n\r\n\t\t\t\tVector3 p000 = new( x0, y0, z0 );\r\n\t\t\t\tVector3 p100 = new( x1, y0, z0 );\r\n\t\t\t\tVector3 p110 = new( x1, y1, z0 );\r\n\t\t\t\tVector3 p010 = new( x0, y1, z0 );\r\n\t\t\t\tVector3 p001 = new( x0, y0, z1 );\r\n\t\t\t\tVector3 p101 = new( x1, y0, z1 );\r\n\t\t\t\tVector3 p111 = new( x1, y1, z1 );\r\n\t\t\t\tVector3 p011 = new( x0, y1, z1 );\r\n\r\n\t\t\t\t// Top \u0026 bottom are always exposed\r\n\t\t\t\tQuad( p001, p101, p111, p011, Vector3.Up );\r\n\t\t\t\tQuad( p010, p110, p100, p000, Vector3.Down );\r\n\r\n\t\t\t\t// Sides only where the neighbour cell is empty (face culling)\r\n\t\t\t\tif ( !IsCloud( x \u002B 1, y ) ) Quad( p100, p110, p111, p101, new Vector3( 1, 0, 0 ) );\r\n\t\t\t\tif ( !IsCloud( x - 1, y ) ) Quad( p010, p000, p001, p011, new Vector3( -1, 0, 0 ) );\r\n\t\t\t\tif ( !IsCloud( x, y \u002B 1 ) ) Quad( p110, p010, p011, p111, new Vector3( 0, 1, 0 ) );\r\n\t\t\t\tif ( !IsCloud( x, y - 1 ) ) Quad( p000, p100, p101, p001, new Vector3( 0, -1, 0 ) );\r\n\t\t\t}\r\n\r\n\t\tif ( verts.Count == 0 )\r\n\t\t{\r\n\t\t\tLog.Warning( \u0022MinecraftClouds: texture produced no cloud cells (check alpha / threshold).\u0022 );\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tvar mesh = new Mesh( CloudMaterial );\r\n\t\tmesh.CreateVertexBuffer\u003CVertex\u003E( verts.Count, Vertex.Layout, verts );\r\n\t\tmesh.CreateIndexBuffer( indices.Count, indices );\r\n\r\n\t\t_tileWidth = w * cs;\r\n\t\t_model = Model.Builder.AddMesh( mesh ).Create();\r\n\r\n\t\tLog.Info( $\u0022MinecraftClouds: built {verts.Count / 4} faces from {w}x{h} texture (offset {rx},{ry}).\u0022 );\r\n\t\treturn true;\r\n\t}\r\n}\r\n"},{"Ident":"trend.mcclouds","Path":"Code/MinecraftClouds.cs","FileName":"MinecraftClouds.cs","PackageType":"library","CodeKind":"Game","AssetVersionId":282324,"IsPrivate":false,"Code":"using Sandbox;\r\nusing System.Collections.Generic;\r\n\r\n/// \u003Csummary\u003E\r\n/// Builds a 3D Minecraft \u0022fancy\u0022 cloud field from a clouds.png-style mask texture.\r\n/// One box per opaque pixel, interior faces culled, scrolled over time.\r\n/// RandomizeStart rolls the texture read to a random pixel offset so the field\r\n/// shows a different slice of the pattern without moving the GameObject.\r\n/// Pair with the clouds.shader material (face-shaded by normal).\r\n/// \u003C/summary\u003E\r\n[Title( \u0022Minecraft Clouds\u0022 )]\r\n[Category( \u0022Rendering\u0022 )]\r\npublic sealed class MinecraftClouds : Component\r\n{\r\n\t[Property] public Texture CloudTexture { get; set; }\r\n\t[Property] public Material CloudMaterial { get; set; }\r\n\r\n\t/// \u003Csummary\u003EWorld units per cloud pixel. MC = 12 blocks \u2248 472u. Lower this for a smaller map.\u003C/summary\u003E\r\n\t[Property, Range( 1f, 4096f )] public float CellSize { get; set; } = 472f;\r\n\r\n\t/// \u003Csummary\u003ECloud layer thickness. MC = 4 blocks \u2248 157u.\u003C/summary\u003E\r\n\t[Property, Range( 1f, 1024f )] public float Thickness { get; set; } = 157f;\r\n\r\n\t/// \u003Csummary\u003EScroll speed along \u002BX (units/sec). 0 = static.\u003C/summary\u003E\r\n\t[Property, Range( 0f, 512f )] public float ScrollSpeed { get; set; } = 24f;\r\n\r\n\t/// \u003Csummary\u003EAlpha threshold (0..255) for treating a pixel as cloud.\u003C/summary\u003E\r\n\t[Property, Range( 0, 255 )] public int AlphaThreshold { get; set; } = 127;\r\n\r\n\t/// \u003Csummary\u003EStart the field at a random point in the texture (rolls the pattern, no GameObject moving needed).\u003C/summary\u003E\r\n\t[Property] public bool RandomizeStart { get; set; } = true;\r\n\r\n\t/// \u003Csummary\u003EFixed seed for the random start. 0 = different every time.\u003C/summary\u003E\r\n\t[Property] public int Seed { get; set; } = 0;\r\n\r\n\tprivate Model _model;\r\n\tprivate SceneObject _a, _b;     // two copies so the field never gaps while scrolling in X\r\n\tprivate float _tileWidth;\r\n\tprivate Vector3 _basePos;\r\n\r\n\tprotected override void OnStart()\r\n\t{\r\n\t\tif ( !BuildModel() )\r\n\t\t\treturn;\r\n\r\n\t\t_basePos = Transform.World.Position;\r\n\t\t_a = new SceneObject( Scene.SceneWorld, _model );\r\n\t\t_b = new SceneObject( Scene.SceneWorld, _model );\r\n\t\tConfigureSceneObject( _a );\r\n\t\tConfigureSceneObject( _b );\r\n\t\tUpdatePositions( 0f );\r\n\t}\r\n\r\n\tprivate static void ConfigureSceneObject( SceneObject so )\r\n\t{\r\n\t\t// Put them in the translucent pass so they sort by distance correctly...\r\n\t\tso.Flags.IsOpaque = false;\r\n\t\tso.Flags.IsTranslucent = true;\r\n\r\n\t\t// ...and opt out of the lighting/shadow system so the sky\u0027s indirect\r\n\t\t// (light probe / ambient) doesn\u0027t tint them. The shader is already unlit;\r\n\t\t// this stops the renderer from feeding them probe lighting at all.\r\n\t\tso.Flags.NeedsLightProbe = false;\r\n\t\tso.Flags.CastShadows = false;\r\n\r\n\t\t// Optional: give them a tag so a camera could include/exclude them as a layer.\r\n\t\tso.Tags.Add( \u0022clouds\u0022 );\r\n\t}\r\n\r\n\tprotected override void OnUpdate()\r\n\t{\r\n\t\tif ( _a is null ) return;\r\n\t\tfloat offset = ScrollSpeed \u003C= 0f ? 0f : (Time.Now * ScrollSpeed) % _tileWidth;\r\n\t\tUpdatePositions( offset );\r\n\t}\r\n\r\n\tprotected override void OnDestroy()\r\n\t{\r\n\t\t_a?.Delete(); _a = null;\r\n\t\t_b?.Delete(); _b = null;\r\n\t}\r\n\r\n\tprivate void UpdatePositions( float offset )\r\n\t{\r\n\t\t_a.Transform = new Transform( _basePos \u002B new Vector3( offset, 0, 0 ) );\r\n\t\t_b.Transform = new Transform( _basePos \u002B new Vector3( offset - _tileWidth, 0, 0 ) );\r\n\t}\r\n\r\n\tprivate bool BuildModel()\r\n\t{\r\n\t\tif ( CloudTexture is null || CloudMaterial is null )\r\n\t\t{\r\n\t\t\tLog.Warning( \u0022MinecraftClouds: assign both CloudTexture and CloudMaterial.\u0022 );\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tint w = CloudTexture.Width;\r\n\t\tint h = CloudTexture.Height;\r\n\t\tColor32[] px = CloudTexture.GetPixels();\r\n\t\tif ( px is null || px.Length \u003C w * h )\r\n\t\t{\r\n\t\t\tLog.Warning( \u0022MinecraftClouds: couldn\u0027t read pixels. Import clouds.png uncompressed / readable.\u0022 );\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t// Roll the texture read to a random starting pixel. clouds.png tiles seamlessly,\r\n\t\t// so a wrapped offset is just as valid a cloud field \u2014 only the pattern shifts.\r\n\t\tint rx = 0, ry = 0;\r\n\t\tif ( RandomizeStart )\r\n\t\t{\r\n\t\t\tvar rng = Seed != 0 ? new System.Random( Seed ) : new System.Random();\r\n\t\t\trx = rng.Next( 0, w );\r\n\t\t\try = rng.Next( 0, h );\r\n\t\t}\r\n\r\n\t\tbool IsCloud( int x, int y )\r\n\t\t{\r\n\t\t\tint sx = ((x \u002B rx) % w \u002B w) % w;   // wrap (handles -1 at the edges too)\r\n\t\t\tint sy = ((y \u002B ry) % h \u002B h) % h;\r\n\t\t\tvar c = px[sy * w \u002B sx];\r\n\t\t\t// alpha mask (vanilla) with a luminance gate (handles opaque white-on-black sheets)\r\n\t\t\treturn c.a \u003E AlphaThreshold \u0026\u0026 (c.r \u003E 10 || c.g \u003E 10 || c.b \u003E 10);\r\n\t\t}\r\n\r\n\t\tvar verts = new List\u003CVertex\u003E( 1 \u003C\u003C 17 );\r\n\t\tvar indices = new List\u003Cint\u003E( 1 \u003C\u003C 17 );\r\n\r\n\t\tvoid Quad( Vector3 a, Vector3 b, Vector3 c, Vector3 d, Vector3 n )\r\n\t\t{\r\n\t\t\tVector3 t = Vector3.Cross( n, Vector3.Up );\r\n\t\t\tif ( t.LengthSquared \u003C 0.001f ) t = Vector3.Forward;\r\n\t\t\tt = t.Normal;\r\n\r\n\t\t\tint bi = verts.Count;\r\n\t\t\tverts.Add( new Vertex( a, n, t, new Vector2( 0, 0 ) ) );\r\n\t\t\tverts.Add( new Vertex( b, n, t, new Vector2( 1, 0 ) ) );\r\n\t\t\tverts.Add( new Vertex( c, n, t, new Vector2( 1, 1 ) ) );\r\n\t\t\tverts.Add( new Vertex( d, n, t, new Vector2( 0, 1 ) ) );\r\n\t\t\tindices.Add( bi \u002B 0 ); indices.Add( bi \u002B 1 ); indices.Add( bi \u002B 2 );\r\n\t\t\tindices.Add( bi \u002B 0 ); indices.Add( bi \u002B 2 ); indices.Add( bi \u002B 3 );\r\n\t\t}\r\n\r\n\t\tfloat cs = CellSize;\r\n\t\tfloat th = Thickness;\r\n\r\n\t\t// Center the field on the GameObject so clouds extend in every horizontal\r\n\t\t// direction (otherwise the GameObject sits at the corner and you see an edge).\r\n\t\tfloat halfW = w * cs * 0.5f;\r\n\t\tfloat halfH = h * cs * 0.5f;\r\n\r\n\t\tfor ( int y = 0; y \u003C h; y\u002B\u002B )\r\n\t\t\tfor ( int x = 0; x \u003C w; x\u002B\u002B )\r\n\t\t\t{\r\n\t\t\t\tif ( !IsCloud( x, y ) ) continue;\r\n\r\n\t\t\t\tfloat x0 = x * cs - halfW, x1 = x0 \u002B cs;\r\n\t\t\t\tfloat y0 = y * cs - halfH, y1 = y0 \u002B cs;\r\n\t\t\t\tfloat z0 = 0f, z1 = th;\r\n\r\n\t\t\t\tVector3 p000 = new( x0, y0, z0 );\r\n\t\t\t\tVector3 p100 = new( x1, y0, z0 );\r\n\t\t\t\tVector3 p110 = new( x1, y1, z0 );\r\n\t\t\t\tVector3 p010 = new( x0, y1, z0 );\r\n\t\t\t\tVector3 p001 = new( x0, y0, z1 );\r\n\t\t\t\tVector3 p101 = new( x1, y0, z1 );\r\n\t\t\t\tVector3 p111 = new( x1, y1, z1 );\r\n\t\t\t\tVector3 p011 = new( x0, y1, z1 );\r\n\r\n\t\t\t\t// Top \u0026 bottom are always exposed\r\n\t\t\t\tQuad( p001, p101, p111, p011, Vector3.Up );\r\n\t\t\t\tQuad( p010, p110, p100, p000, Vector3.Down );\r\n\r\n\t\t\t\t// Sides only where the neighbour cell is empty (face culling)\r\n\t\t\t\tif ( !IsCloud( x \u002B 1, y ) ) Quad( p100, p110, p111, p101, new Vector3( 1, 0, 0 ) );\r\n\t\t\t\tif ( !IsCloud( x - 1, y ) ) Quad( p010, p000, p001, p011, new Vector3( -1, 0, 0 ) );\r\n\t\t\t\tif ( !IsCloud( x, y \u002B 1 ) ) Quad( p110, p010, p011, p111, new Vector3( 0, 1, 0 ) );\r\n\t\t\t\tif ( !IsCloud( x, y - 1 ) ) Quad( p000, p100, p101, p001, new Vector3( 0, -1, 0 ) );\r\n\t\t\t}\r\n\r\n\t\tif ( verts.Count == 0 )\r\n\t\t{\r\n\t\t\tLog.Warning( \u0022MinecraftClouds: texture produced no cloud cells (check alpha / threshold).\u0022 );\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tvar mesh = new Mesh( CloudMaterial );\r\n\t\tmesh.CreateVertexBuffer\u003CVertex\u003E( verts.Count, Vertex.Layout, verts );\r\n\t\tmesh.CreateIndexBuffer( indices.Count, indices );\r\n\r\n\t\t_tileWidth = w * cs;\r\n\t\t_model = Model.Builder.AddMesh( mesh ).Create();\r\n\r\n\t\tLog.Info( $\u0022MinecraftClouds: built {verts.Count / 4} faces from {w}x{h} texture (offset {rx},{ry}).\u0022 );\r\n\t\treturn true;\r\n\t}\r\n}\r\n"}]}