public void IsIdTest()
        {
            BlockState state1 = BlockStates.Diorite();
            BlockState state2 = BlockStates.BirchLeaves(BirchLeavesDistanceType.Distance1, BirchLeavesPersistentType.False);
            BlockState state3 = BlockStates.BirchLog();
            BlockState state4 = BlockStates.OakLog();

            Assert.True(state1.IsId(BlockId.Diorite));

            // Assert.True(state2.IsId(BlockId.Leaves));
            // Assert.True(state3.IsId(BlockId.Wood));
            // Assert.True(state4.IsId(BlockId.Wood));
            Assert.False(state1.IsId(BlockId.Cobblestone));
            Assert.False(state2.IsId(BlockId.Dirt));
            Assert.False(state3.IsId(BlockId.Stone));
            Assert.False(state4.IsId(BlockId.Stone));
        }
Exemple #2
0
 public TreeGenerator(int treeHeight, bool vines, PlantsType treeType)
 {
     _minTreeHeight = treeHeight;
     _vines         = vines;
     _treeType      = treeType;
     if (treeType == PlantsType.Oak)
     {
         _wood   = BlockStates.OakLog();
         _leaves = BlockStates.OakLeaves(OakLeavesDistanceType.Distance1, OakLeavesPersistentType.False);
     }
     else if (treeType == PlantsType.Spruce)
     {
         _wood   = BlockStates.SpruceLog();
         _leaves = BlockStates.SpruceLeaves(SpruceLeavesDistanceType.Distance1, SpruceLeavesPersistentType.False);
     }
     else if (treeType == PlantsType.Birch)
     {
         _wood   = BlockStates.BirchLog();
         _leaves = BlockStates.BirchLeaves(BirchLeavesDistanceType.Distance1, BirchLeavesPersistentType.False);
     }
 }
        public async override Task OnActivateAsync()
        {
            await base.OnActivateAsync();

            _minTreeHeight = _generatorSettings.TreeHeight;
            _vines         = _generatorSettings.TreeVine;
            _treeType      = _generatorSettings.PlantType;
            if (_generatorSettings.PlantType == PlantsType.Oak)
            {
                _wood   = BlockStates.OakLog();
                _leaves = BlockStates.OakLeaves(OakLeavesDistanceType.Distance1, OakLeavesPersistentType.False);
            }
            else if (_generatorSettings.PlantType == PlantsType.Spruce)
            {
                _wood   = BlockStates.SpruceLog();
                _leaves = BlockStates.SpruceLeaves(SpruceLeavesDistanceType.Distance1, SpruceLeavesPersistentType.False);
            }
            else if (_generatorSettings.PlantType == PlantsType.Birch)
            {
                _wood   = BlockStates.BirchLog();
                _leaves = BlockStates.BirchLeaves(BirchLeavesDistanceType.Distance1, BirchLeavesPersistentType.False);
            }
        }