Survivalcraft API 1.8.2.3 v1.8.2.3
Survivalcraft 2.4
载入中...
搜索中...
未找到
SubsystemCarpetBlockBehavior.cs
浏览该文件的文档.
2
3namespace Game {
6
7 public Random m_random = new();
8
9 public override int[] HandledBlocks => [];
10
11 public override void Load(ValuesDictionary valuesDictionary) {
12 m_subsystemWeather = Project.FindSubsystem<SubsystemWeather>(true);
13 base.Load(valuesDictionary);
14 }
15
16 public override void OnNeighborBlockChanged(int x, int y, int z, int neighborX, int neighborY, int neighborZ) {
17 int cellValue = SubsystemTerrain.Terrain.GetCellValue(x, y - 1, z);
18 if (BlocksManager.Blocks[Terrain.ExtractContents(cellValue)].IsNonAttachable(cellValue)) {
20 0,
21 x,
22 y,
23 z,
24 0,
25 false,
26 false
27 );
28 }
29 }
30
31 public override void OnPoll(int value, int x, int y, int z, int pollPass) {
32 if (m_random.Float(0f, 1f) < 0.25f) {
33 PrecipitationShaftInfo precipitationShaftInfo = m_subsystemWeather.GetPrecipitationShaftInfo(x, z);
34 if (precipitationShaftInfo.Intensity > 0f
35 && y >= precipitationShaftInfo.YLimit - 1) {
37 0,
38 x,
39 y,
40 z,
41 0,
42 true,
43 false
44 );
45 }
46 }
47 }
48 }
49}
virtual bool IsNonAttachable(int value)
override void Load(ValuesDictionary valuesDictionary)
override void OnNeighborBlockChanged(int x, int y, int z, int neighborX, int neighborY, int neighborZ)
override void OnPoll(int value, int x, int y, int z, int pollPass)
virtual void DestroyCell(int toolLevel, int x, int y, int z, int newValue, bool noDrop, bool noParticleSystem, MovingBlock movingBlock=null)
override void Load(ValuesDictionary valuesDictionary)
static int ExtractContents(int value)
virtual int GetCellValue(int x, int y, int z)
ValuesDictionary ValuesDictionary