Terraria.ModLoader.ModTile.Drop C# (CSharp) Method

Drop() public method

public Drop ( int i, int j ) : bool
i int
j int
return bool
		public virtual bool Drop(int i, int j)
		{
			return true;
		}

Usage Example

Example #1
0
        //in Terraria.WorldGen.KillTile before if statements checking num49 and num50
        //  add bool vanillaDrop = TileLoader.Drop(i, j, tile.type);
        //  add "vanillaDrop && " to beginning of these if statements
        public static bool Drop(int i, int j, int type)
        {
            foreach (var hook in HookDrop)
            {
                if (!hook(i, j, type))
                {
                    return(false);
                }
            }
            ModTile modTile = GetTile(type);

            if (modTile != null)
            {
                if (!modTile.Drop(i, j))
                {
                    return(false);
                }
                if (modTile.drop > 0)
                {
                    Item.NewItem(i * 16, j * 16, 16, 16, modTile.drop, 1, false, -1);
                }
                return(false);
            }
            return(true);
        }
All Usage Examples Of Terraria.ModLoader.ModTile::Drop