Survivalcraft API 1.8.2.3 v1.8.2.3
Survivalcraft 2.4
载入中...
搜索中...
未找到
KelpBlock.cs
浏览该文件的文档.
1using Engine;
3
4namespace Game {
5 public class KelpBlock : WaterPlantBlock {
6 public new const int Index = 232;
7
8 public override int GetFaceTextureSlot(int face, int value) {
9 if (face < 0) {
10 return 104;
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.Kelp.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.Kelp.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,
54 BlockColorsMap.Kelp.Lookup(subsystemTerrain.Terrain, Terrain.ToCell(position.X), Terrain.ToCell(position.Y), Terrain.ToCell(position.Z)),
55 104
56 );
57 }
58}
static BlockColorsMap Kelp
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 void DrawBlock(PrimitivesRenderer3D primitivesRenderer, int value, Color color, float size, ref Matrix matrix, DrawBlockEnvironmentData environmentData)
override int GetFaceTextureSlot(int face, int value)
const new int Index
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)
TerrainGeometrySubset SubsetAlphaTest
static int ToCell(float x)