예제 #1
0
        public void GrowFlower(int value, int x, int y, int z, int pollPass)
        {
            int data = Terrain.ExtractData(value);

            if (FlowerBlock.GetIsSmall(data) && Terrain.ExtractLight(base.SubsystemTerrain.Terrain.GetCellValueFast(x, y + 1, z)) >= 9)
            {
                int data2  = FlowerBlock.SetIsSmall(data, isSmall: false);
                int value2 = Terrain.ReplaceData(value, data2);
                m_toReplace[new Point3(x, y, z)] = new Replacement
                {
                    Value         = value2,
                    RequiredValue = value
                };
            }
        }
예제 #2
0
        public override BlockPlacementData GetPlacementValue(SubsystemTerrain subsystemTerrain, ComponentMiner componentMiner, int value, TerrainRaycastResult raycastResult)
        {
            BlockPlacementData result = default(BlockPlacementData);

            result.CellFace = raycastResult.CellFace;
            if (raycastResult.CellFace.Face == 4)
            {
                switch (Terrain.ExtractData(value))
                {
                case 0:
                    result.Value = Terrain.MakeBlockValue(19, 0, TallGrassBlock.SetIsSmall(0, isSmall: true));
                    break;

                case 1:
                    result.Value = Terrain.MakeBlockValue(20, 0, FlowerBlock.SetIsSmall(0, isSmall: true));
                    break;

                case 2:
                    result.Value = Terrain.MakeBlockValue(24, 0, FlowerBlock.SetIsSmall(0, isSmall: true));
                    break;

                case 3:
                    result.Value = Terrain.MakeBlockValue(25, 0, FlowerBlock.SetIsSmall(0, isSmall: true));
                    break;

                case 4:
                    result.Value = Terrain.MakeBlockValue(174, 0, RyeBlock.SetSize(RyeBlock.SetIsWild(0, isWild: false), 0));
                    break;

                case 5:
                    result.Value = Terrain.MakeBlockValue(174, 0, RyeBlock.SetSize(RyeBlock.SetIsWild(0, isWild: false), 0));
                    break;

                case 6:
                    result.Value = Terrain.MakeBlockValue(204, 0, CottonBlock.SetSize(CottonBlock.SetIsWild(0, isWild: false), 0));
                    break;

                case 7:
                    result.Value = Terrain.MakeBlockValue(131, 0, BasePumpkinBlock.SetSize(BasePumpkinBlock.SetIsDead(0, isDead: false), 0));
                    break;
                }
            }
            return(result);
        }