Survivalcraft API 1.8.2.3 v1.8.2.3
Survivalcraft 2.4
载入中...
搜索中...
未找到
EvergreenLeavesBlock.cs
浏览该文件的文档.
1namespace Game {
2 public abstract class EvergreenLeavesBlock : LeavesBlock {
3 public Random m_random1 = new();
4
5 public override void GetDropValues(SubsystemTerrain subsystemTerrain,
6 int oldValue,
7 int newValue,
8 int toolLevel,
9 List<BlockDropValue> dropValues,
10 out bool showDebris) {
11 if (m_random1.Bool(0.25f)) {
12 dropValues.Add(new BlockDropValue { Value = 23, Count = 1 });
13 showDebris = true;
14 }
15 else {
16 base.GetDropValues(subsystemTerrain, oldValue, newValue, toolLevel, dropValues, out showDebris);
17 }
18 }
19
20 public override IEnumerable<int> GetCreativeValues() {
21 yield return Terrain.MakeBlockValue(BlockIndex);
22 }
23 }
24}
int BlockIndex
定义 Block.cs:6
override void GetDropValues(SubsystemTerrain subsystemTerrain, int oldValue, int newValue, int toolLevel, List< BlockDropValue > dropValues, out bool showDebris)
override IEnumerable< int > GetCreativeValues()
static int MakeBlockValue(int contents)