Beispiel #1
0
        // i actually dont know where this code came from, but i just yoinked it anyways
        /// <summary>
        /// Gets the top left of a multitile.
        /// </summary>
        /// <param name="i">The X coordinate of any multitile part.</param>
        /// <param name="j">The Y coordinate of any multitile part.</param>
        /// <returns>The top left coordinate of the multitile.</returns>
        public static Point GetTileTopLeft(int i, int j)
        {
            if (WorldGenUtils.SafeCoordinates(i, j))
            {
                Tile tile = Main.tile[i, j];

                int fX = 0;
                int fY = 0;

                if (tile != null)
                {
                    TileObjectData data = TileObjectData.GetTileData(tile.type, 0);

                    if (data != null)
                    {
                        fX = tile.frameX % (18 * data.Width) / 18;
                        fY = tile.frameY % (18 * data.Height) / 18;
                    }
                }

                return(new Point(i - fX, j - fY));
            }

            return(new Point(-1, -1));
        }
Beispiel #2
0
        public static void worldgentest(User user, float initialspread = 1f, float spreaddecay = 0.95f, int coresize = 0)
        {
            Vector3 pos = user.Position + new Vector3(0, 5, 0);

            WorldGenUtils.CreateVein(pos.WorldPosition3i, new DirtBlock(), initialspread: initialspread, spreaddecay: spreaddecay, coreSize: coresize);
        }