Exemplo n.º 1
0
        public bool FillSelection(string blockNameOrId, int rotation)
        {
            BlockValue bv = BlockUtils.GetBlockValueByNameOrId(blockNameOrId);

            FixSelections();

            int width  = (end.x - start.x) + 1;
            int height = (end.y - start.y) + 1;
            int depth  = (end.z - start.z) + 1;

            Prefab tempPrefab = new Prefab(new Vector3i(width, height, depth));

            Log.Out("SETTING BLOCK FOR FILL:" + bv.ToItemValue().type.ToString());
            Log.Out(tempPrefab.size.ToString());
            for (var x = 0; x < tempPrefab.size.x; x++)
            {
                for (var y = 0; y < tempPrefab.size.y; y++)
                {
                    for (var z = 0; z < tempPrefab.size.z; z++)
                    {
                        tempPrefab.SetBlock(x, y, z, bv);
                    }
                }
            }

            this.selectionPrefab = tempPrefab;
            return(PasteSelection(new Vector3i(start.x, start.y, start.z)));
        }