ChestControl.Chest.TileIsChest C# (CSharp) Method

TileIsChest() public static method

public static TileIsChest ( Terraria.TileData tile ) : bool
tile Terraria.TileData
return bool
        public static bool TileIsChest(TileData tile)
        {
            return tile.type == 0x15;
        }

Same methods

Chest::TileIsChest ( Terraria.Vector2 position ) : bool
Chest::TileIsChest ( int x, int y ) : bool

Usage Example

Example #1
0
        public static void Save()
        {
            var lines = new List <string>();

            foreach (Chest chest in Chests)
            {
                if (chest == null)
                {
                    return; //it shouldn't EVER be null
                }
                else
                {
                    if (Chest.TileIsChest(chest.GetPosition()))
                    {
                        if (chest.GetOwner() != "")
                        {
                            lines.Add(string.Format("{0}|{1}|{2}|{3}|{4}|{5}|{6}|{7}|{8}",
                                                    chest.GetID(), chest.GetPosition().X, chest.GetPosition().Y,
                                                    chest.GetOwner(), chest.IsLocked(), chest.IsRegionLocked(),
                                                    chest.GetPassword(), chest.IsRefill(),
                                                    string.Join(",", chest.GetRefillItemNames())));
                        }
                    }
                }
            }
            File.WriteAllLines(ChestSavePath, lines.ToArray());
        }
All Usage Examples Of ChestControl.Chest::TileIsChest