Survivalcraft API 1.8.2.3 v1.8.2.3
Survivalcraft 2.4
载入中...
搜索中...
未找到
SeagrassBlock.cs
浏览该文件的文档.
1using Engine;
3
4namespace Game {
6 public new const int Index = 233;
7
8 public override int GetFaceTextureSlot(int face, int value) {
9 if (face < 0) {
10 return 105;
11 }
12 return base.GetFaceTextureSlot(face, value);
13 }
14
15 public override void DrawBlock(PrimitivesRenderer3D primitivesRenderer,
16 int value,
17 Color color,
18 float size,
19 ref Matrix matrix,
20 DrawBlockEnvironmentData environmentData) {
22 primitivesRenderer,
23 value,
24 size,
25 ref matrix,
26 null,
27 color * BlockColorsMap.Seagrass.Lookup(environmentData.Temperature, environmentData.Humidity),
28 false,
29 environmentData
30 );
31 }
32
33 public override void GenerateTerrainVertices(BlockGeometryGenerator generator, TerrainGeometry geometry, int value, int x, int y, int z) {
34 Color color = BlockColorsMap.Seagrass.Lookup(generator.Terrain, x, y, z);
36 this,
37 value,
38 x,
39 y,
40 z,
41 color,
42 GetFaceTextureSlot(-1, value),
43 geometry.SubsetAlphaTest
44 );
45 base.GenerateTerrainVertices(generator, geometry, value, x, y, z);
46 }
47
48 public override BlockDebrisParticleSystem
49 CreateDebrisParticleSystem(SubsystemTerrain subsystemTerrain, Vector3 position, int value, float strength) => new(
50 subsystemTerrain,
51 position,
52 0.75f * strength,
55 subsystemTerrain.Terrain,
56 Terrain.ToCell(position.X),
57 Terrain.ToCell(position.Y),
58 Terrain.ToCell(position.Z)
59 ),
60 104
61 );
62 }
63}
static BlockColorsMap Seagrass
Color Lookup(int temperature, int humidity)
virtual void GenerateCrossfaceVertices(Block block, int value, int x, int y, int z, Color color, int textureSlot, TerrainGeometrySubset subset)
float DestructionDebrisScale
static void DrawFlatOrImageExtrusionBlock(PrimitivesRenderer3D primitivesRenderer, int value, float size, ref Matrix matrix, Texture2D texture, Color color, bool isEmissive, DrawBlockEnvironmentData environmentData)
override BlockDebrisParticleSystem CreateDebrisParticleSystem(SubsystemTerrain subsystemTerrain, Vector3 position, int value, float strength)
override void GenerateTerrainVertices(BlockGeometryGenerator generator, TerrainGeometry geometry, int value, int x, int y, int z)
override void DrawBlock(PrimitivesRenderer3D primitivesRenderer, int value, Color color, float size, ref Matrix matrix, DrawBlockEnvironmentData environmentData)
override int GetFaceTextureSlot(int face, int value)
TerrainGeometrySubset SubsetAlphaTest
static int ToCell(float x)