Exemplo n.º 1
0
        public override void OnLoaded(ICoreAPI api)
        {
            base.OnLoaded(api);
            axe = new ItemAxe();
            //if (LastCodePart(1) != "bottom") return;

            bottomOffsets   = AreaMethods.AreaBelowOffsetList().ToArray();
            offsets         = AreaMethods.AreaAroundOffsetList().ToArray();
            cardinaloffsets = AreaMethods.CardinalOffsetList().ToArray();

            rand = new LCGRandom(api.World.Seed);

            List <Block> trunkblocks = new List <Block>();
            List <Block> frondblocks = new List <Block>();

            List <Block> nannerblocks = new List <Block>();
            List <Block> cocoblocks   = new List <Block>();

            for (int i = 0; i < parts.Length; i++)
            {
                trunkblocks.Add(api.World.BlockAccessor.GetBlock(CodeWithPart(parts[i], 1)));
            }
            trunk = trunkblocks.ToArray();

            for (int i = 0; i < directions.Length; i++)
            {
                frondblocks.Add(api.World.BlockAccessor.GetBlock(new AssetLocation("neolithicmod:palmfrond-1-grown-" + directions[i])));
                nannerblocks.Add(api.World.BlockAccessor.GetBlock(new AssetLocation("neolithicmod:palmfruits-bananna-" + directions[i])));
                cocoblocks.Add(api.World.BlockAccessor.GetBlock(new AssetLocation("neolithicmod:palmfruits-coconut-" + directions[i])));
            }
            frond  = frondblocks.ToArray();
            fruits = new Block[][] { nannerblocks.ToArray(), cocoblocks.ToArray(), null };

            tip = api.World.BlockAccessor.GetBlock(CodeWithPart("tip", 1));
        }
Exemplo n.º 2
0
        public void SetupPalm(Block palmBase)
        {
            bottomOffsets   = AreaMethods.AreaBelowOffsetList().ToArray();
            offsets         = AreaMethods.AreaAroundOffsetList().ToArray();
            cardinaloffsets = AreaMethods.CardinalOffsetList().ToArray();
            sNoise          = NormalizedSimplexNoise.FromDefaultOctaves(16, 8.0, 0.5, api.WorldManager.Seed + 6514);
            sizeNoise       = NormalizedSimplexNoise.FromDefaultOctaves(4, 2.0, 1.0, api.WorldManager.Seed + 2361);
            frondNoise      = NormalizedSimplexNoise.FromDefaultOctaves(4, 2.0, 1.0, api.WorldManager.Seed + 6151);
            fruitNoise      = NormalizedSimplexNoise.FromDefaultOctaves(4, 2.0, 1.0, api.WorldManager.Seed + 4987);

            List <int> trunkblocks = new List <int>();
            List <int> frondblocks = new List <int>();

            List <int> bananablocks  = new List <int>();
            List <int> coconutblocks = new List <int>();

            for (int i = 0; i < parts.Length; i++)
            {
                trunkblocks.Add(api.World.BlockAccessor.GetBlock(palmBase.CodeWithPart(parts[i], 1)).Id);
            }
            trunk = trunkblocks.ToArray();

            for (int i = 0; i < directions.Length; i++)
            {
                frondblocks.Add(api.World.BlockAccessor.GetBlock(new AssetLocation("immersion:palmfrond-1-grown-" + directions[i])).Id);
                bananablocks.Add(api.World.BlockAccessor.GetBlock(new AssetLocation("immersion:palmfruits-bananna-" + directions[i])).Id);
                coconutblocks.Add(api.World.BlockAccessor.GetBlock(new AssetLocation("immersion:palmfruits-coconut-" + directions[i])).Id);
            }
            frond  = frondblocks.ToArray();
            fruits = new int[][] { bananablocks.ToArray(), coconutblocks.ToArray(), null };

            tip = api.World.BlockAccessor.GetBlock(palmBase.CodeWithPart("tip", 1)).Id;
            int c = api.World.BlockAccessor.GetBlock(new AssetLocation("game:sapling-palmcoconut")).Id;
            int b = api.World.BlockAccessor.GetBlock(new AssetLocation("game:sapling-palmbanana")).Id;
            int p = api.World.BlockAccessor.GetBlock(new AssetLocation("game:sapling-palm")).Id;

            saplings = new int[] { c, b, p };
        }
 public override void OnLoaded(ICoreAPI api)
 {
     base.OnLoaded(api);
     around = AreaMethods.AreaAroundOffsetList().ToArray();
 }